Update pipeline.py
Browse files- pipeline.py +6 -2
pipeline.py
CHANGED
@@ -1021,8 +1021,12 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1021 |
context_group_indexes = []
|
1022 |
# Iterate over each index in the context group
|
1023 |
for index in range(context_size):
|
1024 |
-
#
|
1025 |
-
|
|
|
|
|
|
|
|
|
1026 |
# If frame index exceeds total frames, wrap around
|
1027 |
if frame_index >= total_frames:
|
1028 |
frame_index %= total_frames
|
|
|
1021 |
context_group_indexes = []
|
1022 |
# Iterate over each index in the context group
|
1023 |
for index in range(context_size):
|
1024 |
+
# if its the first timestep, spread the indexes out evenly over the full frame range, offset by the group index
|
1025 |
+
if timestep == 0:
|
1026 |
+
frame_index = (group_index * (context_size - overlap)) + index
|
1027 |
+
else:
|
1028 |
+
# Calculate the frame index
|
1029 |
+
frame_index = (group_index * (context_size - overlap)) + (offset * timestep) + index
|
1030 |
# If frame index exceeds total frames, wrap around
|
1031 |
if frame_index >= total_frames:
|
1032 |
frame_index %= total_frames
|