Skip to content

Commit d3986f1

Browse files
Beinseziisayakpaul
andauthored
Change step_offset scheduler docstrings (#7128)
* Change step_offset scheduler docstrings * Mention it may be needed by some models * More docstrings These ones failed literal S&R because I performed it case-sensitive which is fun. --------- Co-authored-by: Sayak Paul <[email protected]>
1 parent ee6a3a9 commit d3986f1

25 files changed

+25
-75
lines changed

examples/community/latent_consistency_img2img.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,7 @@ class LCMSchedulerWithTimestamp(SchedulerMixin, ConfigMixin):
513513
there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
514514
otherwise it uses the alpha value at step 0.
515515
steps_offset (`int`, defaults to 0):
516-
An offset added to the inference steps. You can use a combination of `offset=1` and
517-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
518-
Diffusion.
516+
An offset added to the inference steps, as required by some model families.
519517
prediction_type (`str`, defaults to `epsilon`, *optional*):
520518
Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process),
521519
`sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of [Imagen

examples/community/latent_consistency_txt2img.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ class LCMScheduler(SchedulerMixin, ConfigMixin):
418418
there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
419419
otherwise it uses the alpha value at step 0.
420420
steps_offset (`int`, defaults to 0):
421-
An offset added to the inference steps. You can use a combination of `offset=1` and
422-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
423-
Diffusion.
421+
An offset added to the inference steps, as required by some model families.
424422
prediction_type (`str`, defaults to `epsilon`, *optional*):
425423
Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process),
426424
`sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of [Imagen

examples/community/scheduling_ufogen.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ class UFOGenScheduler(SchedulerMixin, ConfigMixin):
171171
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
172172
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
173173
steps_offset (`int`, defaults to 0):
174-
An offset added to the inference steps. You can use a combination of `offset=1` and
175-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
176-
Diffusion.
174+
An offset added to the inference steps, as required by some model families.
177175
rescale_betas_zero_snr (`bool`, defaults to `False`):
178176
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
179177
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_ddim.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ class DDIMScheduler(SchedulerMixin, ConfigMixin):
157157
there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
158158
otherwise it uses the alpha value at step 0.
159159
steps_offset (`int`, defaults to 0):
160-
An offset added to the inference steps. You can use a combination of `offset=1` and
161-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
162-
Diffusion.
160+
An offset added to the inference steps, as required by some model families.
163161
prediction_type (`str`, defaults to `epsilon`, *optional*):
164162
Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process),
165163
`sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of [Imagen

src/diffusers/schedulers/scheduling_ddim_flax.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ class FlaxDDIMScheduler(FlaxSchedulerMixin, ConfigMixin):
9393
step there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
9494
otherwise it uses the value of alpha at step 0.
9595
steps_offset (`int`, default `0`):
96-
an offset added to the inference steps. You can use a combination of `offset=1` and
97-
`set_alpha_to_one=False`, to make the last step use step 0 for the previous alpha product, as done in
98-
stable diffusion.
96+
An offset added to the inference steps, as required by some model families.
9997
prediction_type (`str`, default `epsilon`):
10098
indicates whether the model predicts the noise (epsilon), or the samples. One of `epsilon`, `sample`.
10199
`v-prediction` is not supported for this scheduler.

src/diffusers/schedulers/scheduling_ddim_inverse.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ class DDIMInverseScheduler(SchedulerMixin, ConfigMixin):
155155
there is no previous alpha. When this option is `True` the previous alpha product is fixed to 0, otherwise
156156
it uses the alpha value at step `num_train_timesteps - 1`.
157157
steps_offset (`int`, defaults to 0):
158-
An offset added to the inference steps. You can use a combination of `offset=1` and
159-
`set_alpha_to_one=False` to make the last step use `num_train_timesteps - 1` for the previous alpha
160-
product.
158+
An offset added to the inference steps, as required by some model families.
161159
prediction_type (`str`, defaults to `epsilon`, *optional*):
162160
Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process),
163161
`sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of [Imagen

src/diffusers/schedulers/scheduling_ddim_parallel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ class DDIMParallelScheduler(SchedulerMixin, ConfigMixin):
159159
step there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
160160
otherwise it uses the value of alpha at step 0.
161161
steps_offset (`int`, default `0`):
162-
an offset added to the inference steps. You can use a combination of `offset=1` and
163-
`set_alpha_to_one=False`, to make the last step use step 0 for the previous alpha product, as done in
164-
stable diffusion.
162+
An offset added to the inference steps, as required by some model families.
165163
prediction_type (`str`, default `epsilon`, optional):
166164
prediction type of the scheduler function, one of `epsilon` (predicting the noise of the diffusion
167165
process), `sample` (directly predicting the noisy sample`) or `v_prediction` (see section 2.4

src/diffusers/schedulers/scheduling_ddpm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ class DDPMScheduler(SchedulerMixin, ConfigMixin):
167167
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
168168
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
169169
steps_offset (`int`, defaults to 0):
170-
An offset added to the inference steps. You can use a combination of `offset=1` and
171-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
172-
Diffusion.
170+
An offset added to the inference steps, as required by some model families.
173171
rescale_betas_zero_snr (`bool`, defaults to `False`):
174172
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
175173
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_ddpm_parallel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ class DDPMParallelScheduler(SchedulerMixin, ConfigMixin):
173173
The way the timesteps should be scaled. Refer to Table 2. of [Common Diffusion Noise Schedules and Sample
174174
Steps are Flawed](https://arxiv.org/abs/2305.08891) for more information.
175175
steps_offset (`int`, default `0`):
176-
an offset added to the inference steps. You can use a combination of `offset=1` and
177-
`set_alpha_to_one=False`, to make the last step use step 0 for the previous alpha product, as done in
178-
stable diffusion.
176+
An offset added to the inference steps, as required by some model families.
179177
rescale_betas_zero_snr (`bool`, defaults to `False`):
180178
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
181179
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_deis_multistep.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ class DEISMultistepScheduler(SchedulerMixin, ConfigMixin):
115115
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
116116
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
117117
steps_offset (`int`, defaults to 0):
118-
An offset added to the inference steps. You can use a combination of `offset=1` and
119-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
120-
Diffusion.
118+
An offset added to the inference steps, as required by some model families.
121119
"""
122120

123121
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_dpmsolver_multistep.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ class DPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
178178
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
179179
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
180180
steps_offset (`int`, defaults to 0):
181-
An offset added to the inference steps. You can use a combination of `offset=1` and
182-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
183-
Diffusion.
181+
An offset added to the inference steps, as required by some model families.
184182
rescale_betas_zero_snr (`bool`, defaults to `False`):
185183
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
186184
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ class DPMSolverMultistepInverseScheduler(SchedulerMixin, ConfigMixin):
134134
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
135135
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
136136
steps_offset (`int`, defaults to 0):
137-
An offset added to the inference steps. You can use a combination of `offset=1` and
138-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
139-
Diffusion.
137+
An offset added to the inference steps, as required by some model families.
140138
"""
141139

142140
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_dpmsolver_sde.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ class DPMSolverSDEScheduler(SchedulerMixin, ConfigMixin):
153153
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
154154
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
155155
steps_offset (`int`, defaults to 0):
156-
An offset added to the inference steps. You can use a combination of `offset=1` and
157-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
158-
Diffusion.
156+
An offset added to the inference steps, as required by some model families.
159157
"""
160158

161159
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ class EulerAncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
156156
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
157157
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
158158
steps_offset (`int`, defaults to 0):
159-
An offset added to the inference steps. You can use a combination of `offset=1` and
160-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
161-
Diffusion.
159+
An offset added to the inference steps, as required by some model families.
162160
rescale_betas_zero_snr (`bool`, defaults to `False`):
163161
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
164162
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_euler_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ class EulerDiscreteScheduler(SchedulerMixin, ConfigMixin):
162162
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
163163
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
164164
steps_offset (`int`, defaults to 0):
165-
An offset added to the inference steps. You can use a combination of `offset=1` and
166-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
167-
Diffusion.
165+
An offset added to the inference steps, as required by some model families.
168166
rescale_betas_zero_snr (`bool`, defaults to `False`):
169167
Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and
170168
dark samples instead of limiting it to samples with medium brightness. Loosely related to

src/diffusers/schedulers/scheduling_heun_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ class HeunDiscreteScheduler(SchedulerMixin, ConfigMixin):
101101
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
102102
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
103103
steps_offset (`int`, defaults to 0):
104-
An offset added to the inference steps. You can use a combination of `offset=1` and
105-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
106-
Diffusion.
104+
An offset added to the inference steps, as required by some model families.
107105
"""
108106

109107
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ class KDPM2AncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
9999
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
100100
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
101101
steps_offset (`int`, defaults to 0):
102-
An offset added to the inference steps. You can use a combination of `offset=1` and
103-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
104-
Diffusion.
102+
An offset added to the inference steps, as required by some model families.
105103
"""
106104

107105
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_k_dpm_2_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ class KDPM2DiscreteScheduler(SchedulerMixin, ConfigMixin):
9898
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
9999
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
100100
steps_offset (`int`, defaults to 0):
101-
An offset added to the inference steps. You can use a combination of `offset=1` and
102-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
103-
Diffusion.
101+
An offset added to the inference steps, as required by some model families.
104102
"""
105103

106104
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_lcm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ class LCMScheduler(SchedulerMixin, ConfigMixin):
165165
there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
166166
otherwise it uses the alpha value at step 0.
167167
steps_offset (`int`, defaults to 0):
168-
An offset added to the inference steps. You can use a combination of `offset=1` and
169-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
170-
Diffusion.
168+
An offset added to the inference steps, as required by some model families.
171169
prediction_type (`str`, defaults to `epsilon`, *optional*):
172170
Prediction type of the scheduler function; can be `epsilon` (predicts the noise of the diffusion process),
173171
`sample` (directly predicts the noisy sample`) or `v_prediction` (see section 2.4 of [Imagen

src/diffusers/schedulers/scheduling_lms_discrete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
119119
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
120120
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
121121
steps_offset (`int`, defaults to 0):
122-
An offset added to the inference steps. You can use a combination of `offset=1` and
123-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
124-
Diffusion.
122+
An offset added to the inference steps, as required by some model families.
125123
"""
126124

127125
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_pndm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
104104
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
105105
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
106106
steps_offset (`int`, defaults to 0):
107-
An offset added to the inference steps. You can use a combination of `offset=1` and
108-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
109-
Diffusion.
107+
An offset added to the inference steps, as required by some model families.
110108
"""
111109

112110
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

src/diffusers/schedulers/scheduling_pndm_flax.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ class FlaxPNDMScheduler(FlaxSchedulerMixin, ConfigMixin):
9999
step there is no previous alpha. When this option is `True` the previous alpha product is fixed to `1`,
100100
otherwise it uses the value of alpha at step 0.
101101
steps_offset (`int`, default `0`):
102-
an offset added to the inference steps. You can use a combination of `offset=1` and
103-
`set_alpha_to_one=False`, to make the last step use step 0 for the previous alpha product, as done in
104-
stable diffusion.
102+
An offset added to the inference steps, as required by some model families.
105103
prediction_type (`str`, default `epsilon`, optional):
106104
prediction type of the scheduler function, one of `epsilon` (predicting the noise of the diffusion
107105
process), `sample` (directly predicting the noisy sample`) or `v_prediction` (see section 2.4

src/diffusers/schedulers/scheduling_sasolver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ class SASolverScheduler(SchedulerMixin, ConfigMixin):
131131
The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and
132132
Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information.
133133
steps_offset (`int`, defaults to 0):
134-
An offset added to the inference steps. You can use a combination of `offset=1` and
135-
`set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable
136-
Diffusion.
134+
An offset added to the inference steps, as required by some model families.
137135
"""
138136

139137
_compatibles = [e.name for e in KarrasDiffusionSchedulers]

0 commit comments

Comments
 (0)