Update pipeline.py
Browse files- pipeline.py +9 -6
pipeline.py
CHANGED
@@ -1020,14 +1020,17 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
1020 |
# Initialize a list to store context indexes for this group
|
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 <= 1:
|
1026 |
-
|
1027 |
-
|
1028 |
-
else:
|
1029 |
-
|
1030 |
-
|
1031 |
# If frame index exceeds total frames, wrap around
|
1032 |
if frame_index >= total_frames:
|
1033 |
frame_index %= total_frames
|
|
|
1020 |
# Initialize a list to store context indexes for this group
|
1021 |
context_group_indexes = []
|
1022 |
# Iterate over each index in the context group
|
1023 |
+
local_context_size = context_size
|
1024 |
+
if timestep <= 1:
|
1025 |
+
local_context_size = context_size * 2
|
1026 |
for index in range(context_size):
|
1027 |
# if its the first timestep, spread the indexes out evenly over the full frame range, offset by the group index
|
1028 |
+
# if timestep <= 1:
|
1029 |
+
# step_size = (total_frames // context_size)+2
|
1030 |
+
# frame_index = ((index * step_size)+group_index)+timestep
|
1031 |
+
# else:
|
1032 |
+
# # Calculate the frame index
|
1033 |
+
frame_index = (group_index * (local_context_size - overlap)) + (offset * timestep) + index
|
1034 |
# If frame index exceeds total frames, wrap around
|
1035 |
if frame_index >= total_frames:
|
1036 |
frame_index %= total_frames
|