Commit
·
b86fb79
1
Parent(s):
30c860d
Update pipeline.py
Browse files- pipeline.py +3 -1
pipeline.py
CHANGED
@@ -773,7 +773,7 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
773 |
|
774 |
# save frames
|
775 |
if output_path is not None:
|
776 |
-
output_batch_size =
|
777 |
num_frames = latents.size(2) # latents' shape is [batch, channels, frames, height, width]
|
778 |
num_digits = output_path.count('#') # count the number of '#' characters
|
779 |
frame_format = output_path.replace('#' * num_digits, '{:0' + str(num_digits) + 'd}')
|
@@ -785,6 +785,8 @@ class AnimateDiffPipeline(DiffusionPipeline, TextualInversionLoaderMixin, IPAdap
|
|
785 |
video = tensor2vid(video_tensor, self.image_processor, output_type=output_type)
|
786 |
frame_list = video[0]
|
787 |
for f_id, frame in enumerate(frame_list):
|
|
|
|
|
788 |
frame_number = start_id + f_id
|
789 |
frame.save(frame_format.format(frame_number))
|
790 |
return output_path
|
|
|
773 |
|
774 |
# save frames
|
775 |
if output_path is not None:
|
776 |
+
output_batch_size = 2# prevents out of memory errors with large videos
|
777 |
num_frames = latents.size(2) # latents' shape is [batch, channels, frames, height, width]
|
778 |
num_digits = output_path.count('#') # count the number of '#' characters
|
779 |
frame_format = output_path.replace('#' * num_digits, '{:0' + str(num_digits) + 'd}')
|
|
|
785 |
video = tensor2vid(video_tensor, self.image_processor, output_type=output_type)
|
786 |
frame_list = video[0]
|
787 |
for f_id, frame in enumerate(frame_list):
|
788 |
+
# print frame and batch id
|
789 |
+
print(f"Frame: {f_id + start_id} Batch: {batch}")
|
790 |
frame_number = start_id + f_id
|
791 |
frame.save(frame_format.format(frame_number))
|
792 |
return output_path
|