Text2Vid-AI / app.py
morbiwalaq's picture
Create app.py
474e88e verified
raw
history blame
565 Bytes
import gradio as gr
from transformers import pipeline
# Load the text-to-video model (Example using ModelScope)
video_model = pipeline("text-to-video", model="damo-vilab/text-to-video-ms-1.7b")
def generate_video(prompt):
video = video_model(prompt)
return video["video"]
# Gradio UI
iface = gr.Interface(
fn=generate_video,
inputs=gr.Textbox(label="Enter text prompt"),
outputs=gr.Video(label="Generated Video"),
title="AI Text-to-Video Generator",
description="Type a prompt, and AI will create a video for you!",
)
iface.launch()