ariG23498 HF Staff commited on
Commit
b9c7b2e
·
verified ·
1 Parent(s): e6f06d3

Upload Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.py with huggingface_hub

Browse files
Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "transformers",
5
+ # "torch",
6
+ # ]
7
+ # ///
8
+
9
+ try:
10
+ from diffusers import DiffusionPipeline
11
+
12
+ pipe = DiffusionPipeline.from_pretrained("Wan-AI/Wan2.2-TI2V-5B-Diffusers")
13
+
14
+ prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
15
+ image = pipe(prompt).images[0]
16
+ with open('Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.txt', 'w') as f:
17
+ f.write('Everything was good in Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.txt')
18
+ except Exception as e:
19
+ with open('Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.txt', 'w') as f:
20
+ import traceback
21
+ traceback.print_exc(file=f)
22
+ finally:
23
+ from huggingface_hub import upload_file
24
+ upload_file(
25
+ path_or_fileobj='Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.txt',
26
+ repo_id='model-metadata/custom_code_execution_files',
27
+ path_in_repo='Wan-AI_Wan2.2-TI2V-5B-Diffusers_0.txt',
28
+ repo_type='dataset',
29
+ )