r3gm commited on
Commit
54f2e32
·
verified ·
1 Parent(s): 732e39d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -249,8 +249,9 @@ def generate_video(
249
 
250
  Returns:
251
  tuple: A tuple containing:
252
- - video_path (str): Path to the generated video file (.mp4)
253
- - current_seed (int): The seed used for generation (useful when randomize_seed=True)
 
254
 
255
  Raises:
256
  gr.Error: If input_image is None (no image uploaded).
@@ -290,7 +291,7 @@ def generate_video(
290
 
291
  export_to_video(output_frames_list, video_path, fps=FIXED_FPS, quality=quality)
292
 
293
- return video_path, current_seed
294
 
295
 
296
  with gr.Blocks() as demo:
@@ -316,6 +317,7 @@ with gr.Blocks() as demo:
316
  generate_button = gr.Button("Generate Video", variant="primary")
317
  with gr.Column():
318
  video_output = gr.Video(label="Generated Video", autoplay=True, interactive=False)
 
319
 
320
  ui_inputs = [
321
  input_image_component, last_image_component, prompt_input, steps_slider,
@@ -323,7 +325,7 @@ with gr.Blocks() as demo:
323
  guidance_scale_input, guidance_scale_2_input, seed_input, randomize_seed_checkbox,
324
  quality_slider
325
  ]
326
- generate_button.click(fn=generate_video, inputs=ui_inputs, outputs=[video_output, seed_input])
327
 
328
 
329
  if __name__ == "__main__":
 
249
 
250
  Returns:
251
  tuple: A tuple containing:
252
+ - video_path (str): Path for the video component.
253
+ - video_path (str): Path for the file download component. Attempt to avoid reconversion in video component.
254
+ - current_seed (int): The seed used for generation.
255
 
256
  Raises:
257
  gr.Error: If input_image is None (no image uploaded).
 
291
 
292
  export_to_video(output_frames_list, video_path, fps=FIXED_FPS, quality=quality)
293
 
294
+ return video_path, video_path, current_seed
295
 
296
 
297
  with gr.Blocks() as demo:
 
317
  generate_button = gr.Button("Generate Video", variant="primary")
318
  with gr.Column():
319
  video_output = gr.Video(label="Generated Video", autoplay=True, interactive=False)
320
+ file_output = gr.File(label="Download Video")
321
 
322
  ui_inputs = [
323
  input_image_component, last_image_component, prompt_input, steps_slider,
 
325
  guidance_scale_input, guidance_scale_2_input, seed_input, randomize_seed_checkbox,
326
  quality_slider
327
  ]
328
+ generate_button.click(fn=generate_video, inputs=ui_inputs, outputs=[video_output, file_output, seed_input])
329
 
330
 
331
  if __name__ == "__main__":