Skip to content

Commit d3986f1

Browse files
Beinseziisayakpaul
andauthored
Change step_offset scheduler docstrings (huggingface#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]

0 commit comments

Comments
 (0)