Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/diffusers/utils/export_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def export_to_video(
if output_video_path is None:
output_video_path = tempfile.NamedTemporaryFile(suffix=".mp4").name

if isinstance(video_frames[0], PIL.Image.Image):
if isinstance(video_frames[0], np.ndarray):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use the numpy_to_pil() method from processor?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to pass in the processor instance into export_to_video though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes. I am okay as is then.

video_frames = [(frame * 255).astype(np.uint8) for frame in video_frames]

elif isinstance(video_frames[0], PIL.Image.Image):
video_frames = [np.array(frame) for frame in video_frames]

fourcc = cv2.VideoWriter_fourcc(*"mp4v")
Expand Down