Commit 75b3b99 for stable-diffusion.cpp
commit 75b3b99053bd43c93fedd9077159c1d530a5bd4c
Author: leejet <leejet714@gmail.com>
Date: Tue Dec 1 00:17:12 2026 +0800
fix(server): honor WebUI scheduler changes for preset sigmas (#2472)
diff --git a/examples/server/README.md b/examples/server/README.md
index bde6dd5..4a80b06 100644
--- a/examples/server/README.md
+++ b/examples/server/README.md
@@ -94,6 +94,8 @@ loading progress alongside sampling and output encoding.
2. Open **Sample & Guidance** to set **Method**, **Scheduler**, **Steps**, and
**CFG Scale** when the model guide specifies values different from the recipe
defaults. Set the output dimensions in **Aspect Ratio & Resolution**.
+ For image generation, **Preset sigmas** displays the step count defined by
+ the preset. Select another scheduler to set your own step count.
3. Supply inputs for the chosen task. Editing recipes use **Reference Images**;
IP-Adapter uses **IP-Adapter Image**. For image-to-video, use video generation
and upload a **Start Frame**; add an **End Frame** only for a compatible
diff --git a/examples/server/api.md b/examples/server/api.md
index 1c9b15e..77cb807 100644
--- a/examples/server/api.md
+++ b/examples/server/api.md
@@ -1245,7 +1245,7 @@ Sampling fields:
| --- | --- |
| `sample_params.scheduler` | `string` |
| `sample_params.sample_method` | `string` |
-| `sample_params.sample_steps` | `integer` |
+| `sample_params.sample_steps` | `integer \| null` |
| `sample_params.eta` | `number` |
| `sample_params.shifted_timestep` | `integer` |
| `sample_params.custom_sigmas` | `array<number>` |
@@ -1258,6 +1258,10 @@ Sampling fields:
| `sample_params.guidance.slg.layer_end` | `number` |
| `sample_params.guidance.slg.scale` | `number` |
+An explicit `null` for `sample_params.sample_steps` clears the inherited step
+setting. When custom sigmas are active, their count minus one sets the number of
+steps in the schedule.
+
Other native fields:
| Field | Type |
diff --git a/examples/server/frontend b/examples/server/frontend
index 37c158f..0c27f95 160000
--- a/examples/server/frontend
+++ b/examples/server/frontend
@@ -1 +1 @@
-Subproject commit 37c158f2517c1657a20af6d8fb96e2a681b8c2fc
+Subproject commit 0c27f95a38c89bb601d6b1f0d70717a63c48a71e
diff --git a/src/api/generation_program.cpp b/src/api/generation_program.cpp
index f3b87be..30cb658 100644
--- a/src/api/generation_program.cpp
+++ b/src/api/generation_program.cpp
@@ -236,6 +236,8 @@ namespace sd::api {
schedule_options["extra_args"] = image.sample_params.extra_sample_args;
if (image.sample_params.custom_sigmas_count) {
values["custom_sigmas"] = std::vector<float>(image.sample_params.custom_sigmas, image.sample_params.custom_sigmas + image.sample_params.custom_sigmas_count);
+ if (!video)
+ values["steps"] = image.sample_params.custom_sigmas_count - 1;
}
GenerationProgram program;
if (video) {