Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
321 |
-
|
322 |
-
gr.
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
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 |
-
|
333 |
-
|
334 |
with gr.Row():
|
335 |
-
|
336 |
-
|
337 |
-
gr.
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
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()
|