HongcanGuo commited on
Commit
128ef8f
·
verified ·
1 Parent(s): cb70d57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -20
app.py CHANGED
@@ -312,35 +312,33 @@ def safe_generate_video(image):
312
  # 定义 Gradio 接口
313
  with gr.Blocks() as demo:
314
  gr.Markdown("Upload an image and provide a description to generate a video.")
 
315
  with gr.Tab("Basic Version"):
316
  with gr.Row():
317
  image_input = gr.Image(type="pil")
318
  description_input = gr.Textbox(label="Description", placeholder="Enter description here", lines=2)
319
  with gr.Row():
320
- video_output = gr.Video(label="Generated Video")
321
- error_output = gr.Textbox(label="Error Messages", placeholder="No errors", lines=5)
322
- gr.Interface(
323
- fn=generate_video_basic,
324
- inputs=[image_input, description_input],
325
- outputs=[video_output, error_output],
326
- title="Basic Version Video Generation",
327
- description="Upload an image and some descriptions to generate a video in the basic version. Any errors will be displayed below.",
328
- theme="soft"
329
  )
 
330
  with gr.Tab("Pro Version"):
331
  with gr.Row():
332
- image_input = gr.Image(type="pil")
333
- description_input = gr.Textbox(label="Description", placeholder="Enter description here", lines=2)
334
  with gr.Row():
335
- video_output = gr.Video(label="Generated Video")
336
- error_output = gr.Textbox(label="Error Messages", placeholder="No errors", lines=5)
337
- gr.Interface(
338
- fn=generate_video_pro,
339
- inputs=[image_input, description_input],
340
- outputs=[video_output, error_output],
341
- title="Pro Version Video Generation",
342
- description="Upload an image and some descriptions to generate a video in the pro version. Any errors will be displayed below.",
343
- theme="soft"
344
  )
345
 
346
  demo.launch()
 
312
  # 定义 Gradio 接口
313
  with gr.Blocks() as demo:
314
  gr.Markdown("Upload an image and provide a description to generate a video.")
315
+
316
  with gr.Tab("Basic Version"):
317
  with gr.Row():
318
  image_input = gr.Image(type="pil")
319
  description_input = gr.Textbox(label="Description", placeholder="Enter description here", lines=2)
320
  with gr.Row():
321
+ submit_button = gr.Button("Generate Basic Video")
322
+ video_output = gr.Video(label="Generated Video")
323
+ error_output = gr.Textbox(label="Error Messages", placeholder="No errors", lines=5)
324
+ submit_button.click(
325
+ generate_video_basic,
326
+ inputs=[image_input,description_input],
327
+ outputs=[video_output, error_output]
 
 
328
  )
329
+
330
  with gr.Tab("Pro Version"):
331
  with gr.Row():
332
+ image_input_pro = gr.Image(type="pil")
333
+ description_input_pro = gr.Textbox(label="Description", placeholder="Enter description here", lines=2)
334
  with gr.Row():
335
+ submit_button_pro = gr.Button("Generate Pro Video")
336
+ video_output_pro = gr.Video(label="Generated Video")
337
+ error_output_pro = gr.Textbox(label="Error Messages", placeholder="No errors", lines=5)
338
+ submit_button_pro.click(
339
+ generate_video_pro,
340
+ inputs=[image_input_pro, description_input_pro],
341
+ outputs=[video_output_pro, error_output_pro]
 
 
342
  )
343
 
344
  demo.launch()