smoothieAI commited on
Commit
99fe7a5
·
verified ·
1 Parent(s): c133361

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +7 -3
pipeline.py CHANGED
@@ -1036,8 +1036,6 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
1036
 
1037
  context_indexes = context_scheduler(context_size, overlap, step, num_frames, len(timesteps))
1038
 
1039
- print(f"Context indexes: {context_indexes}")
1040
-
1041
  # Denoising loop
1042
  num_warmup_steps = len(timesteps) - num_inference_steps * self.scheduler.order
1043
  with self.progress_bar(total=len(timesteps)) as progress_bar:
@@ -1079,13 +1077,19 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
1079
 
1080
  # set the step index to the current batch
1081
  self.scheduler._step_index = i
1082
-
 
 
 
1083
  # perform guidance
1084
  if do_classifier_free_guidance:
1085
  latent_counter = latent_counter.reshape(1, 1, num_frames, 1, 1)
1086
  noise_pred_uncond = noise_pred_uncond_sum / latent_counter
1087
  noise_pred_text = noise_pred_text_sum / latent_counter
1088
  noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
 
 
 
1089
 
1090
  # compute the previous noisy sample x_t -> x_t-1
1091
  latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
 
1036
 
1037
  context_indexes = context_scheduler(context_size, overlap, step, num_frames, len(timesteps))
1038
 
 
 
1039
  # Denoising loop
1040
  num_warmup_steps = len(timesteps) - num_inference_steps * self.scheduler.order
1041
  with self.progress_bar(total=len(timesteps)) as progress_bar:
 
1077
 
1078
  # set the step index to the current batch
1079
  self.scheduler._step_index = i
1080
+
1081
+ print("latent_counter", latent_counter)
1082
+ print("current_context_indexes", current_context_indexes)
1083
+
1084
  # perform guidance
1085
  if do_classifier_free_guidance:
1086
  latent_counter = latent_counter.reshape(1, 1, num_frames, 1, 1)
1087
  noise_pred_uncond = noise_pred_uncond_sum / latent_counter
1088
  noise_pred_text = noise_pred_text_sum / latent_counter
1089
  noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
1090
+
1091
+ # print min and max
1092
+ print("noise_pred: ", noise_pred.min(), noise_pred.max())
1093
 
1094
  # compute the previous noisy sample x_t -> x_t-1
1095
  latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample