ariG23498 HF Staff commited on
Commit
8d3fe98
·
verified ·
1 Parent(s): 2068cd1

Upload lightx2v_Wan2.2-Distill-Loras_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. lightx2v_Wan2.2-Distill-Loras_1.py +2 -28
lightx2v_Wan2.2-Distill-Loras_1.py CHANGED
@@ -11,20 +11,7 @@
11
  # ///
12
 
13
  try:
14
- import torch
15
- from diffusers import DiffusionPipeline
16
- from diffusers.utils import load_image, export_to_video
17
-
18
- pipe = DiffusionPipeline.from_pretrained("lightx2v/Wan2.2-Distill-Loras", 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('lightx2v_Wan2.2-Distill-Loras_1.txt', 'w', encoding='utf-8') as f:
29
  f.write('Everything was good in lightx2v_Wan2.2-Distill-Loras_1.txt')
30
  except Exception as e:
@@ -39,20 +26,7 @@ except Exception as e:
39
  with open('lightx2v_Wan2.2-Distill-Loras_1.txt', 'a', encoding='utf-8') as f:
40
  import traceback
41
  f.write('''```CODE:
42
- import torch
43
- from diffusers import DiffusionPipeline
44
- from diffusers.utils import load_image, export_to_video
45
-
46
- pipe = DiffusionPipeline.from_pretrained("lightx2v/Wan2.2-Distill-Loras", 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('lightx2v_Wan2.2-Distill-Loras_1.txt', 'w', encoding='utf-8') as f:
16
  f.write('Everything was good in lightx2v_Wan2.2-Distill-Loras_1.txt')
17
  except Exception as e:
 
26
  with open('lightx2v_Wan2.2-Distill-Loras_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: