You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/using-diffusers/scheduler_features.md
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,49 @@ image = pipeline(
68
68
</div>
69
69
</div>
70
70
71
+
## Timestep spacing
72
+
73
+
The way sample steps are selected in the schedule can affect the quality of the generated image, especially with respect to [rescaling the noise schedule](#rescale-noise-schedule), which can enable a model to generate much brighter or darker images. Diffusers provides three timestep spacing methods:
74
+
75
+
-`leading` creates evenly spaced steps
76
+
-`linspace` includes the first and last steps and evenly selects the remaining intermediate steps
77
+
-`trailing` only includes the last step and evenly selects the remaining intermediate steps starting from the end
78
+
79
+
It is recommended to use the `trailing` spacing method because it generates higher quality images with more details when there are fewer sample steps. But the difference in quality is not as obvious for more standard sample step values.
80
+
81
+
```py
82
+
import torch
83
+
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler
<figcaption class="mt-2 text-center text-sm text-gray-500">leading spacing after 5 steps</figcaption>
111
+
</div>
112
+
</div>
113
+
71
114
## Sigmas
72
115
73
116
The `sigmas` parameter is the amount of noise added at each timestep according to the timestep schedule. Like the `timesteps` parameter, you can customize the `sigmas` parameter to control how much noise is added at each step. When you use a custom `sigmas` value, the `timesteps` are calculated from the custom `sigmas` value and the default scheduler configuration is ignored.
0 commit comments