multimodalart HF Staff commited on
Commit
1d3a31b
·
verified ·
1 Parent(s): f70ce40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -364,15 +364,12 @@ def generate_video(prompt, negative_prompt, height, width, num_frames, guidance_
364
  num_frames=num_frames,
365
  guidance_scale=float(guidance_scale),
366
  num_inference_steps=steps
367
- ).frames
368
-
369
- if not output_frames_list or not output_frames_list[0]:
370
- raise gr.Error("Model returned empty frames. Check parameters or try a different prompt.")
371
- output_frames = output_frames_list[0]
372
 
373
  with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmpfile:
374
  video_path = tmpfile.name
375
- export_to_video(output_frames, video_path, fps=fps)
 
376
  logger.info(f"Video successfully generated and saved to {video_path}")
377
  return video_path
378
 
 
364
  num_frames=num_frames,
365
  guidance_scale=float(guidance_scale),
366
  num_inference_steps=steps
367
+ ).frames[0]
 
 
 
 
368
 
369
  with tempfile.NamedTemporaryFile(suffix=".mp4", delete=False) as tmpfile:
370
  video_path = tmpfile.name
371
+
372
+ export_to_video(output_frames_list, video_path, fps=fps)
373
  logger.info(f"Video successfully generated and saved to {video_path}")
374
  return video_path
375