File size: 1,017 Bytes
402882b
 
 
 
 
 
 
33adf25
402882b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "numpy",
#     "einops",
#     "torch",
#     "transformers",
#     "diffusers",
#     "datasets",
#     "accelerate",
#     "timm",
# ]
# ///

try:
    from diffusers import DiffusionPipeline
    
    pipe = DiffusionPipeline.from_pretrained("DFloat11/Qwen-Image-DF11")
    
    prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
    image = pipe(prompt).images[0]
    with open('DFloat11_Qwen-Image-DF11_0.txt', 'w') as f:
        f.write('Everything was good in DFloat11_Qwen-Image-DF11_0.txt')
except Exception as e:
    with open('DFloat11_Qwen-Image-DF11_0.txt', 'w') as f:
        import traceback
        traceback.print_exc(file=f)
finally:
    from huggingface_hub import upload_file
    upload_file(
        path_or_fileobj='DFloat11_Qwen-Image-DF11_0.txt',
        repo_id='model-metadata/custom_code_execution_files',
        path_in_repo='DFloat11_Qwen-Image-DF11_0.txt',
        repo_type='dataset',
    )