File size: 603 Bytes
a6f4cc3
 
998bdae
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st

# x = st.slider('Select a value')
# st.write(x, 'squared is', x * x)
import torch
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
from diffusers.utils import export_to_video

pipe = DiffusionPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16")
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe.enable_model_cpu_offload()

prompt = "Pop international experimental music"
video_frames = pipe(prompt, num_inference_steps=25).frames
video_path = export_to_video(video_frames)