Skip to content

Commit a7f47cd

Browse files
author
bghira
committed
diffusers#4003 Subtract one from the begin step to match the ending step, due to the off-by-one count issue
1 parent 1763090 commit a7f47cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ def __call__(
887887
# In Diffusers pipelines, each generation always does ONE more step than asked.
888888
# As a result, we need to reduce the number of steps we do for this subsequent by one, to remain aligned.
889889
num_inference_steps -= 1
890+
begin_inference_step -= 1
890891
self.scheduler.set_timesteps(num_inference_steps, device=device)
891892
timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, begin_inference_step, strength, device)
892893
latent_timestep = timesteps[:1].repeat(batch_size * num_images_per_prompt)

0 commit comments

Comments
 (0)