Files
enginex-mr_series-text2video/iic.py

17 lines
563 B
Python
Raw Normal View History

2025-09-02 16:54:16 +08:00
import os
2025-09-03 10:51:05 +08:00
import torch
2025-09-08 12:10:18 +08:00
device = "cuda" if torch.cuda.is_available() else "npu"
2025-09-05 12:03:13 +08:00
import patch
2025-09-02 16:54:16 +08:00
from modelscope.pipelines import pipeline
from modelscope.outputs import OutputKeys
model_path = "/mnt/contest_ceph/zhanghao/models/iic/text-to-video-synthesis"
2025-09-05 12:03:13 +08:00
p = pipeline('text-to-video-synthesis', model_path, device=device)
2025-09-02 16:54:16 +08:00
test_text = {
2025-09-05 12:03:13 +08:00
'text': 'A panda eating a burger and french fries on a rock.',
2025-09-02 16:54:16 +08:00
}
2025-09-05 12:03:13 +08:00
output_video_path = p(test_text, device=device, output_video='./output.mp4')[OutputKeys.OUTPUT_VIDEO]
2025-09-02 16:54:16 +08:00
print('output_video_path:', output_video_path)