Commit
·
c8cbf2f
1
Parent(s):
4eb10ea
Update README.md
Browse files
README.md
CHANGED
|
@@ -40,17 +40,16 @@ Now, generate a video:
|
|
| 40 |
|
| 41 |
```python
|
| 42 |
import torch
|
| 43 |
-
from diffusers import
|
| 44 |
from diffusers.utils import export_to_video
|
| 45 |
|
| 46 |
-
pipe =
|
| 47 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
| 48 |
-
pipe
|
| 49 |
|
| 50 |
prompt = "Spiderman is surfing"
|
| 51 |
-
video_frames = pipe(prompt).frames
|
| 52 |
video_path = export_to_video(video_frames)
|
| 53 |
-
print(video_path)
|
| 54 |
```
|
| 55 |
|
| 56 |
Here are some results:
|
|
|
|
| 40 |
|
| 41 |
```python
|
| 42 |
import torch
|
| 43 |
+
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
| 44 |
from diffusers.utils import export_to_video
|
| 45 |
|
| 46 |
+
pipe = DiffusionPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16")
|
| 47 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
| 48 |
+
pipe.enable_cpu_model_offload()
|
| 49 |
|
| 50 |
prompt = "Spiderman is surfing"
|
| 51 |
+
video_frames = pipe(prompt, num_inference_steps=25).frames
|
| 52 |
video_path = export_to_video(video_frames)
|
|
|
|
| 53 |
```
|
| 54 |
|
| 55 |
Here are some results:
|