Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
x = st.slider('Select a value')
|
4 |
-
st.write(x, 'squared is', x * x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# x = st.slider('Select a value')
|
4 |
+
# st.write(x, 'squared is', x * x)
|
5 |
+
import torch
|
6 |
+
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
7 |
+
from diffusers.utils import export_to_video
|
8 |
+
|
9 |
+
pipe = DiffusionPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16")
|
10 |
+
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
11 |
+
pipe.enable_model_cpu_offload()
|
12 |
+
|
13 |
+
prompt = "Pop international experimental music"
|
14 |
+
video_frames = pipe(prompt, num_inference_steps=25).frames
|
15 |
+
video_path = export_to_video(video_frames)
|