Skip to content

Commit fc36e14

Browse files
DN6Jimmy
authored and
Jimmy
committed
Update export to video to support new tensor_to_vid function in video pipelines (huggingface#6715)
update
1 parent 0d25962 commit fc36e14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/diffusers/utils/export_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ def export_to_video(
125125
if output_video_path is None:
126126
output_video_path = tempfile.NamedTemporaryFile(suffix=".mp4").name
127127

128-
if isinstance(video_frames[0], PIL.Image.Image):
128+
if isinstance(video_frames[0], np.ndarray):
129+
video_frames = [(frame * 255).astype(np.uint8) for frame in video_frames]
130+
131+
elif isinstance(video_frames[0], PIL.Image.Image):
129132
video_frames = [np.array(frame) for frame in video_frames]
130133

131134
fourcc = cv2.VideoWriter_fourcc(*"mp4v")

0 commit comments

Comments
 (0)