Text2Vid-AI / app.py
morbiwalaq's picture
Update app.py
1c04df8 verified
raw
history blame
628 Bytes
import gradio as gr
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
# Load ModelScope's Text-to-Video Model
video_model = pipeline(Tasks.text_to_video_synthesis, model='damo/text-to-video-synthesis')
def generate_video(prompt):
result = video_model({'text': prompt})
return result["output_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()