Skip to content

Commit 82b91c4

Browse files
authored
fix bug if we don't do_classifier_free_guidance (huggingface#1601)
* fix bug if we don't do_classifier_free_guidance * update for copied diffusers.pipelines..alt_diffusion..pipeline_alt_diffusion.AltDiffusionPipeline
1 parent 20da5a9 commit 82b91c4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pipelines/alt_diffusion/pipeline_alt_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ def __call__(
522522
noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
523523
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
524524

525-
# compute the previous noisy sample x_t -> x_t-1
526-
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
525+
# compute the previous noisy sample x_t -> x_t-1
526+
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
527527

528528
# call the callback, if provided
529529
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

pipelines/stable_diffusion/pipeline_stable_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ def __call__(
521521
noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
522522
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
523523

524-
# compute the previous noisy sample x_t -> x_t-1
525-
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
524+
# compute the previous noisy sample x_t -> x_t-1
525+
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
526526

527527
# call the callback, if provided
528528
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):

0 commit comments

Comments
 (0)