Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|