speedartificialintelligence1122 commited on
Commit
57ac4f7
·
verified ·
1 Parent(s): c44f001

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from modelscope.pipelines import pipeline
3
+ from modelscope.utils.constant import Tasks
4
+
5
+ # Load the video generation pipeline
6
+ video_pipe = pipeline(Tasks.text_to_video_synthesis, model='damo/text-to-video-synthesis')
7
+
8
+ def generate_video(prompt):
9
+ result = video_pipe({'text': prompt})
10
+ return result['output_video']
11
+
12
+ gr.Interface(fn=generate_video,
13
+ inputs=gr.Textbox(label="Enter your scene (text prompt)"),
14
+ outputs=gr.Video(label="Generated Video"),
15
+ title="Speed Video Generator 🎥",
16
+ description="Turn your imagination into video. Powered by ModelScope T2V 🚀"
17
+ ).launch()