import gradio as gr import torch import os from model import Model, ModelType from app_canny import create_demo as create_demo_canny from app_pose import create_demo as create_demo_pose from app_text_to_video import create_demo as create_demo_text_to_video from app_pix2pix_video import create_demo as create_demo_pix2pix_video from app_canny_db import create_demo as create_demo_canny_db model = Model(device='cuda', dtype=torch.float16) with gr.Blocks(css='style.css') as demo: gr.HTML( """

Text2Video-Zero

Levon Khachatryan1*, Andranik Movsisyan1*, Vahram Tadevosyan1*, Roberto Henschel1*, Zhangyang Wang1,2, Shant Navasardyan1 and Humphrey Shi1,3,4

1Picsart AI Resarch (PAIR), 2UT Austin, 3U of Oregon, 4UIUC

[arXiv] [GitHub]

We built Text2Video-Zero, a first zero-shot text-to-video synthesis diffusion framework, that enables low cost yet high-quality and consistent video generation with only pre-trained text-to-image diffusion models without any training on videos or optimization! Text2Video-Zero also naturally supports cool extension works of pre-trained text-to-image models such as Instruct Pix2Pix, ControlNet and DreamBooth, and based on which we present Video Instruct Pix2Pix, Pose Conditional, Edge Conditional and, Edge Conditional and DreamBooth Specialized applications. We hope our Text2Video-Zero will further democratize AI and empower the creativity of everyone by unleashing the zero-shot video generation and editing capacity of the amazing text-to-image models and encourage future research!

""") gr.HTML("""

For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.
Duplicate Space

""") with gr.Tab('Zero-Shot Text2Video'): create_demo_text_to_video(model) with gr.Tab('Video Instruct Pix2Pix'): create_demo_pix2pix_video(model) with gr.Tab('Pose Conditional'): create_demo_pose(model) with gr.Tab('Edge Conditional'): create_demo_canny(model) with gr.Tab('Edge Conditional and Dreambooth Specialized'): create_demo_canny_db(model) gr.HTML( """

Version: v1.0

Caution: We would like the raise the awareness of users of this demo of its potential issues and concerns. Like previous large foundation models, Text2Video-Zero could be problematic in some cases, partially we use pretrained Stable Diffusion, therefore Text2Video-Zero can Inherit Its Imperfections. So far, we keep all features available for research testing both to show the great potential of the Text2Video-Zero framework and to collect important feedback to improve the model in the future. We welcome researchers and users to report issues with the HuggingFace community discussion feature or email the authors.

Biases and content acknowledgement: Beware that Text2Video-Zero may output content that reinforces or exacerbates societal biases, as well as realistic faces, pornography, and violence. Text2Video-Zero in this demo is meant only for research purposes.

""") demo.queue(max_size=20) demo.launch(auth=(os.getenv("SECRET_USER"), os.getenv("SECRET_PASS"))) # demo.queue(api_open=False).launch(file_directories=['temporal'], share=True)