File size: 956 Bytes
780f166
 
 
 
 
 
 
b1d845b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr

with gr.Blocks(fill_height=True) as demo:
    with gr.Sidebar():
        gr.Markdown("# Inference Provider")
        gr.Markdown("This Space showcases the Wan-AI/Wan2.1-T2V-1.3B model, served by the fal-ai API. Sign in with your Hugging Face account to use this API.")
        button = gr.LoginButton("Sign in")

    gr.Markdown("## 🎬 Generate Video from Text")
    with gr.Row():
        with gr.Column():
            text_input = gr.Textbox(label="Prompt", placeholder="Enter your prompt to generate video...")
            generate_button = gr.Button("Generate Video")
        with gr.Column():
            video_output = gr.Video(label="Generated Video")

    model = gr.load(
        "models/Wan-AI/Wan2.1-T2V-1.3B",
        inputs=text_input,
        outputs=video_output,
        accept_token=button,
        provider="fal-ai"
    )

    generate_button.click(fn=model, inputs=text_input, outputs=video_output)

demo.launch()