Update pipeline.py
Browse files- pipeline.py +2 -2
pipeline.py
CHANGED
@@ -1070,7 +1070,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1070 |
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
|
1071 |
|
1072 |
# compute the previous noisy sample x_t -> x_t-1
|
1073 |
-
|
1074 |
|
1075 |
# call the callback, if provided
|
1076 |
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
|
@@ -1079,7 +1079,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1079 |
callback(i, t, None)
|
1080 |
|
1081 |
# shuffle rotate latent images by step places, wrapping around the last 2 to the start
|
1082 |
-
latents = torch.cat([
|
1083 |
|
1084 |
if output_type == "latent":
|
1085 |
return AnimateDiffPipelineOutput(frames=latents)
|
|
|
1070 |
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
|
1071 |
|
1072 |
# compute the previous noisy sample x_t -> x_t-1
|
1073 |
+
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
|
1074 |
|
1075 |
# call the callback, if provided
|
1076 |
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
|
|
|
1079 |
callback(i, t, None)
|
1080 |
|
1081 |
# shuffle rotate latent images by step places, wrapping around the last 2 to the start
|
1082 |
+
latents = torch.cat([latents[:, :, -step:, :, :], latents[:, :, :-step, :, :]], dim=2)
|
1083 |
|
1084 |
if output_type == "latent":
|
1085 |
return AnimateDiffPipelineOutput(frames=latents)
|