Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import time
|
| 3 |
import shutil
|
| 4 |
|
| 5 |
-
def
|
| 6 |
"""
|
| 7 |
Simulates video generation for testing UI and API.
|
| 8 |
Clamps duration between 1 and 8 seconds.
|
|
@@ -26,11 +26,6 @@ def generate_video(prompt, duration):
|
|
| 26 |
with gr.Blocks() as demo:
|
| 27 |
gr.Markdown("""
|
| 28 |
## Wan 2.2 Video Generator (Local Test Placeholder)
|
| 29 |
-
|
| 30 |
-
- Prompt: describe your scene
|
| 31 |
-
- Duration: 1–8 sec
|
| 32 |
-
- Click "Generate Video" to see output
|
| 33 |
-
- API endpoint available at `/run/predict/`
|
| 34 |
""")
|
| 35 |
|
| 36 |
prompt_input = gr.Textbox(label="Prompt", placeholder="Describe your scene")
|
|
@@ -38,6 +33,6 @@ with gr.Blocks() as demo:
|
|
| 38 |
submit_btn = gr.Button("Generate Video")
|
| 39 |
output_video = gr.Video(label="Generated Video")
|
| 40 |
|
| 41 |
-
submit_btn.click(
|
| 42 |
|
| 43 |
demo.launch()
|
|
|
|
| 2 |
import time
|
| 3 |
import shutil
|
| 4 |
|
| 5 |
+
def f(prompt, duration):
|
| 6 |
"""
|
| 7 |
Simulates video generation for testing UI and API.
|
| 8 |
Clamps duration between 1 and 8 seconds.
|
|
|
|
| 26 |
with gr.Blocks() as demo:
|
| 27 |
gr.Markdown("""
|
| 28 |
## Wan 2.2 Video Generator (Local Test Placeholder)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
""")
|
| 30 |
|
| 31 |
prompt_input = gr.Textbox(label="Prompt", placeholder="Describe your scene")
|
|
|
|
| 33 |
submit_btn = gr.Button("Generate Video")
|
| 34 |
output_video = gr.Video(label="Generated Video")
|
| 35 |
|
| 36 |
+
submit_btn.click(f, inputs=[prompt_input, duration_input], outputs=output_video)
|
| 37 |
|
| 38 |
demo.launch()
|