Upload ByteDance_Video-As-Prompt-Wan2.1-14B_1.py with huggingface_hub
Browse files
ByteDance_Video-As-Prompt-Wan2.1-14B_1.py
CHANGED
|
@@ -11,20 +11,7 @@
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
-
|
| 15 |
-
from diffusers import DiffusionPipeline
|
| 16 |
-
from diffusers.utils import load_image, export_to_video
|
| 17 |
-
|
| 18 |
-
pipe = DiffusionPipeline.from_pretrained("ByteDance/Video-As-Prompt-Wan2.1-14B", torch_dtype=torch.float16)
|
| 19 |
-
pipe.to("cuda")
|
| 20 |
-
|
| 21 |
-
prompt = "A man with short gray hair plays a red electric guitar."
|
| 22 |
-
image = load_image(
|
| 23 |
-
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
output = pipe(image=image, prompt=prompt).frames[0]
|
| 27 |
-
export_to_video(output, "output.mp4")
|
| 28 |
with open('ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt', 'w', encoding='utf-8') as f:
|
| 29 |
f.write('Everything was good in ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt')
|
| 30 |
except Exception as e:
|
|
@@ -39,20 +26,7 @@ except Exception as e:
|
|
| 39 |
with open('ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt', 'a', encoding='utf-8') as f:
|
| 40 |
import traceback
|
| 41 |
f.write('''```CODE:
|
| 42 |
-
|
| 43 |
-
from diffusers import DiffusionPipeline
|
| 44 |
-
from diffusers.utils import load_image, export_to_video
|
| 45 |
-
|
| 46 |
-
pipe = DiffusionPipeline.from_pretrained("ByteDance/Video-As-Prompt-Wan2.1-14B", torch_dtype=torch.float16)
|
| 47 |
-
pipe.to("cuda")
|
| 48 |
-
|
| 49 |
-
prompt = "A man with short gray hair plays a red electric guitar."
|
| 50 |
-
image = load_image(
|
| 51 |
-
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
|
| 52 |
-
)
|
| 53 |
-
|
| 54 |
-
output = pipe(image=image, prompt=prompt).frames[0]
|
| 55 |
-
export_to_video(output, "output.mp4")
|
| 56 |
```
|
| 57 |
|
| 58 |
ERROR:
|
|
|
|
| 11 |
# ///
|
| 12 |
|
| 13 |
try:
|
| 14 |
+
pip install -U diffusers transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
with open('ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt', 'w', encoding='utf-8') as f:
|
| 16 |
f.write('Everything was good in ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt')
|
| 17 |
except Exception as e:
|
|
|
|
| 26 |
with open('ByteDance_Video-As-Prompt-Wan2.1-14B_1.txt', 'a', encoding='utf-8') as f:
|
| 27 |
import traceback
|
| 28 |
f.write('''```CODE:
|
| 29 |
+
pip install -U diffusers transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
ERROR:
|