Wan2.2 / app.py
roman-talker's picture
Update app.py
a06ceef verified
raw
history blame
868 Bytes
import gradio as gr
import time
import shutil
def generate_video(prompt, duration):
duration = max(1, min(duration, 8))
time.sleep(1)
placeholder_video = "placeholder.mp4"
output_path = "output.mp4"
shutil.copyfile(placeholder_video, output_path)
return output_path
with gr.Blocks() as demo:
gr.Markdown("## Wan 2.2 Video Generator (Local Test Placeholder)")
prompt_input = gr.Textbox(label="Prompt", placeholder="Describe your scene")
duration_input = gr.Slider(label="Duration (sec)", minimum=1, maximum=8, step=1, value=6)
submit_btn = gr.Button("Generate Video")
output_video = gr.Video(label="Generated Video")
submit_btn.click(lambda prompt, duration: generate_video(prompt, duration),
inputs=[prompt_input, duration_input],
outputs=output_video)
demo.launch()