From 665c03419e7c31400fa6d7e124ca09b84067afc1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E51EATJ\\user" Date: Fri, 5 Jun 2026 08:09:57 +0800 Subject: [PATCH] fix the bug on the leading time schedule --- src/diffusers/schedulers/scheduling_unipc_multistep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)