smoothieAI commited on
Commit
81b5b12
·
verified ·
1 Parent(s): 7c97e9b

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +6 -6
pipeline.py CHANGED
@@ -750,18 +750,18 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
750
 
751
  # compute the previous noisy sample x_t -> x_t-1
752
  current_context_latents = self.scheduler.step(noise_pred, t, current_context_latents, **extra_step_kwargs).prev_sample
753
-
754
- # call the callback, if provided
755
- if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
756
- progress_bar.update()
757
- if callback is not None and i % callback_steps == 0:
758
- callback(i, t, current_context_latents)
759
 
760
  #add the context current_context_latents back to the latent sum starting from the current context start
761
  latent_sum[:, :, current_context_start : current_context_start + context_size, :, :] += current_context_latents
762
  # add one to the counter for each timestep in the context
763
  latent_counter[current_context_start : current_context_start + context_size] += 1
764
 
 
 
 
 
 
 
765
  latent_counter = latent_counter.reshape(1, 1, num_frames, 1, 1)
766
  latents = latent_sum / latent_counter
767
 
 
750
 
751
  # compute the previous noisy sample x_t -> x_t-1
752
  current_context_latents = self.scheduler.step(noise_pred, t, current_context_latents, **extra_step_kwargs).prev_sample
 
 
 
 
 
 
753
 
754
  #add the context current_context_latents back to the latent sum starting from the current context start
755
  latent_sum[:, :, current_context_start : current_context_start + context_size, :, :] += current_context_latents
756
  # add one to the counter for each timestep in the context
757
  latent_counter[current_context_start : current_context_start + context_size] += 1
758
 
759
+ # call the callback, if provided
760
+ if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
761
+ progress_bar.update()
762
+ if callback is not None and i % callback_steps == 0:
763
+ callback(i, t, current_context_latents)
764
+
765
  latent_counter = latent_counter.reshape(1, 1, num_frames, 1, 1)
766
  latents = latent_sum / latent_counter
767