Text2Video-Zero / app_text_to_video.py
lev1's picture
T2V, Video Pix2Pix and Pose-Guided Gen
714bf26
raw
history blame
1.32 kB
import gradio as gr
from model import Model
examples = [
"an astronaut waving the arm on the moon",
"a sloth surfing on a wakeboard",
"an astronaut walking on a street",
"a cute cat walking on grass",
"a horse is galloping on a street",
"an astronaut is skiing down the hill",
"a gorilla walking alone down the street"
"a gorilla dancing on times square",
"A panda dancing dancing like crazy on Times Square",
]
def create_demo(model: Model):
with gr.Blocks() as demo:
with gr.Row():
gr.Markdown('## Text2Video-Zero: Video Generation')
with gr.Row():
with gr.Column():
prompt = gr.Textbox(label='Prompt')
run_button = gr.Button(label='Run')
with gr.Column():
result = gr.Video(label="Generated Video")
inputs = [
prompt,
]
gr.Examples(examples=examples,
inputs=inputs,
outputs=result,
cache_examples=False,
#cache_examples=os.getenv('SYSTEM') == 'spaces')
run_on_click=False,
)
run_button.click(fn=model.process_text2video,
inputs=inputs,
outputs=result,)
return demo