smoothieAI commited on
Commit
07bba55
·
verified ·
1 Parent(s): ccbc4b4

Update pipeline.py

Browse files
Files changed (1) hide show
  1. 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
- # Calculate the frame index
1025
- frame_index = (group_index * (context_size - overlap)) + (offset * timestep) + index
 
 
 
 
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