From 4bbcb8e45d6700cf1b3729ed5853a265260b99f8 Mon Sep 17 00:00:00 2001 From: Mario Peng Lee <48773928+mariopenglee@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:26:18 -0300 Subject: [PATCH] fixed scheduling_euler_discrete.py In accordance to the deprecation message: deprecate("steps_offset!=1", "1.0.0", deprecation_message, standard_warn=False) is outdated. `steps_offset` should be set to 1 instead of 0. Please make sure to update the config accordingly as leaving `steps_offset` might led to incorrect results in future versions. If you have downloaded this checkpoint from the Hugging Face Hub, it would be very nice if you could open a Pull request for the `scheduler/scheduler_config.json` file --- src/diffusers/schedulers/scheduling_euler_discrete.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/diffusers/schedulers/scheduling_euler_discrete.py b/src/diffusers/schedulers/scheduling_euler_discrete.py index 05ae94eff0fc..c1adb4d8e5d2 100644 --- a/src/diffusers/schedulers/scheduling_euler_discrete.py +++ b/src/diffusers/schedulers/scheduling_euler_discrete.py @@ -161,10 +161,9 @@ class EulerDiscreteScheduler(SchedulerMixin, ConfigMixin): timestep_spacing (`str`, defaults to `"linspace"`): The way the timesteps should be scaled. Refer to Table 2 of the [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://huggingface.co/papers/2305.08891) for more information. - steps_offset (`int`, defaults to 0): - An offset added to the inference steps. You can use a combination of `offset=1` and - `set_alpha_to_one=False` to make the last step use step 0 for the previous alpha product like in Stable - Diffusion. + steps_offset (`int`, defaults to 1): + This is outdated. `steps_offset` should be set to 1 instead of 0. Please make sure to update the + config accordingly as leaving `steps_offset` might led to incorrect results in future versions. rescale_betas_zero_snr (`bool`, defaults to `False`): Whether to rescale the betas to have zero terminal SNR. This enables the model to generate very bright and dark samples instead of limiting it to samples with medium brightness. Loosely related to @@ -189,7 +188,7 @@ def __init__( sigma_max: Optional[float] = None, timestep_spacing: str = "linspace", timestep_type: str = "discrete", # can be "discrete" or "continuous" - steps_offset: int = 0, + steps_offset: int = 1, rescale_betas_zero_snr: bool = False, ): if trained_betas is not None: