smoothieAI commited on
Commit
1443f04
·
verified ·
1 Parent(s): 20037c2

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +3 -1
pipeline.py CHANGED
@@ -977,7 +977,9 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
977
 
978
  # select the relevent context from the latents
979
  current_context_latents = latents[:, :, current_context_start : current_context_start + context_size, :, :]
980
- # if context_start + context_size > num_frames:
 
 
981
 
982
 
983
  # for context_group in range(num_context_groups):
 
977
 
978
  # select the relevent context from the latents
979
  current_context_latents = latents[:, :, current_context_start : current_context_start + context_size, :, :]
980
+ # if context_start + context_size > num_frames: append the remaining frames from the start of the latents
981
+ if current_context_start + context_size > num_frames:
982
+ current_context_latents = torch.cat([current_context_latents, latents[:, :, :max(current_context_start + context_size - num_frames, 0), :, :]], dim=2)
983
 
984
 
985
  # for context_group in range(num_context_groups):