Commit
·
af0c644
1
Parent(s):
737e734
Update pipeline.py
Browse files- pipeline.py +9 -8
pipeline.py
CHANGED
@@ -778,15 +778,16 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
778 |
num_digits = output_path.count('#') # count the number of '#' characters
|
779 |
frame_format = output_path.replace('#' * num_digits, '{:0' + str(num_digits) + 'd}')
|
780 |
|
781 |
-
for
|
782 |
-
|
783 |
-
|
|
|
784 |
video = tensor2vid(video_tensor, self.image_processor, output_type=output_type)
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
return output_path
|
791 |
|
792 |
# Post-processing
|
|
|
778 |
num_digits = output_path.count('#') # count the number of '#' characters
|
779 |
frame_format = output_path.replace('#' * num_digits, '{:0' + str(num_digits) + 'd}')
|
780 |
|
781 |
+
for batch in range((num_frames + output_batch_size - 1) // output_batch_size):
|
782 |
+
start_id = batch * output_batch_size
|
783 |
+
end_id = min((batch + 1) * output_batch_size, num_frames)
|
784 |
+
video_tensor = self.decode_latents(latents[:, :, start_id:end_id, :, :])
|
785 |
video = tensor2vid(video_tensor, self.image_processor, output_type=output_type)
|
786 |
+
frame_list = video[0][0]
|
787 |
+
print("frame_list type", type(frame_list))
|
788 |
+
for f_id, frame in enumerate(frame_list):
|
789 |
+
frame_number = start_id + f_id
|
790 |
+
frame.save(frame_format.format(frame_number))
|
791 |
return output_path
|
792 |
|
793 |
# Post-processing
|