Sabbirr12 commited on
Commit
18f31e3
·
verified ·
1 Parent(s): b0468c8

Create video_pipeline.py

Browse files
Files changed (1) hide show
  1. video_pipeline.py +8 -0
video_pipeline.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from modelscope.pipelines import pipeline
2
+ from modelscope.utils.constant import Tasks
3
+
4
+ video_pipe = pipeline(Tasks.text_to_video_synthesis, model='damo/text-to-video-synthesis', device='cuda')
5
+
6
+ def generate_video(prompt, image_path):
7
+ result = video_pipe({'text': prompt, 'input_image': image_path})
8
+ return result['video_path']