ValueError: too many values to unpack (expected 3)
#31
by
assa8945
- opened
Hi by running the demo codes, we get the following error:
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
from diffusers.utils import export_to_video
pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()
pipe.unet.enable_forward_chunking(chunk_size=1, dim=1) # disable if enough memory as this slows down significantly
prompt = "Darth Vader is surfing on waves"
video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=36).frames
video_path = export_to_video(video_frames)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 13
11 prompt = "Darth Vader is surfing on waves"
12 video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=36).frames
---> 13 video_path = export_to_video(video_frames)
17 videos = (video_frames.clamp(0, 1) * 255).to(dtype=torch.uint8) # convert to uint8
18 imageio.mimwrite('./latte_output.mp4', videos[0].permute(0, 2, 3, 1), fps=8, quality=5) # highest quality is 10, lowest is 0
File ~/miniconda3/envs/latte/lib/python3.12/site-packages/diffusers/utils/export_utils.py:132, in export_to_video(video_frames, output_video_path, fps)
129 video_frames = [np.array(frame) for frame in video_frames]
131 fourcc = cv2.VideoWriter_fourcc(*"mp4v")
--> 132 h, w, c = video_frames[0].shape
133 video_writer = cv2.VideoWriter(output_video_path, fourcc, fps=fps, frameSize=(w, h))
134 for i in range(len(video_frames)):
ValueError: too many values to unpack (expected 3)