Update pipeline.py
Browse files- 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):
|