Spaces:
Build error
Build error
Download app.py from Danny123432/Text-To-Video-1.0: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/spaces/Danny123432/Text-To-Video-1.0/resolve/main/app.py
- Command line
-
hf download hf://spaces/Danny123432/Text-To-Video-1.0/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Danny123432/Text-To-Video-1.0/resolve/main/app.py
480 Bytes
| import gradio as gr | |
| from text2video_zero import Text2VideoPipeline | |
| # Load the Text2Video-Zero model | |
| pipe = Text2VideoPipeline.from_pretrained("Picsart-AI-Research/Text2Video-Zero") | |
| def generate_video(prompt): | |
| video = pipe(prompt, num_frames=16, height=256, width=256) | |
| video.save("output.mp4") | |
| return "output.mp4" | |
| demo = gr.Interface( | |
| fn=generate_video, | |
| inputs=gr.Textbox(label="Enter prompt"), | |
| outputs=gr.Video(label="Generated Video") | |
| ) | |
| demo.launch() | |