Upload ByteDance_Video-As-Prompt-Wan2.1-14B_0.txt with huggingface_hub
Browse files
ByteDance_Video-As-Prompt-Wan2.1-14B_0.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
import torch
|
| 3 |
+
from diffusers import DiffusionPipeline
|
| 4 |
+
from diffusers.utils import load_image, export_to_video
|
| 5 |
+
|
| 6 |
+
pipe = DiffusionPipeline.from_pretrained("ByteDance/Video-As-Prompt-Wan2.1-14B", torch_dtype=torch.float16)
|
| 7 |
+
pipe.to("cuda")
|
| 8 |
+
|
| 9 |
+
prompt = "A man with short gray hair plays a red electric guitar."
|
| 10 |
+
image = load_image(
|
| 11 |
+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
output = pipe(image=image, prompt=prompt).frames[0]
|
| 15 |
+
export_to_video(output, "output.mp4")
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
ERROR:
|
| 19 |
+
Traceback (most recent call last):
|
| 20 |
+
File "/tmp/ByteDance_Video-As-Prompt-Wan2.1-14B_0pWoZdw.py", line 15, in <module>
|
| 21 |
+
from diffusers import DiffusionPipeline
|
| 22 |
+
ModuleNotFoundError: No module named 'diffusers'
|