Views
No views yet
1import torch
2from diffusers import StableDiffusionXLPipeline
3import os
4import secrets
5
6pipe = StableDiffusionXLPipeline.from_pretrained(
7 "msArray/animagine-xl-4.0-8bit",
8 torch_dtype=torch.float16,
9 use_safetensors=True,
10 device_map="cuda"
11)
12
13prompt = "1girl, toki \(blue archive\), blue archive, safe, masterpiece, high score, great score, absurdres"
14negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing finger, extra digits, fewer digits, cropped, worst quality, low quality, low score, bad score, average score, signature, watermark, username, blurry"
15
16image = pipe(
17 prompt,
18 negative_prompt=negative_prompt,
19 width=832,
20 height=1216,
21 guidance_scale=5,
22 num_inference_steps=28
23).images[0]
24
25if not os.path.exists("./output"):
26 os.makedirs("./output")
27
28image.save(f"./output/{secrets.token_hex(10)}.png")