diff --git a/src/diffusers/schedulers/scheduling_unipc_multistep.py b/src/diffusers/schedulers/scheduling_unipc_multistep.py index 5c2cbcc13ff1..3a703d655a7f 100644 --- a/src/diffusers/schedulers/scheduling_unipc_multistep.py +++ b/src/diffusers/schedulers/scheduling_unipc_multistep.py @@ -356,7 +356,7 @@ def set_timesteps( .astype(np.int64) ) elif self.config.timestep_spacing == "leading": - step_ratio = self.config.num_train_timesteps // (num_inference_steps + 1) + step_ratio = self.config.num_train_timesteps // (num_inference_steps) # creates integer timesteps by multiplying by ratio # casting to int to avoid issues when num_inference_step is power of 3 timesteps = (np.arange(0, num_inference_steps + 1) * step_ratio).round()[::-1][:-1].copy().astype(np.int64)