NukeBird Joabutt commited on
Commit
7057cc2
·
1 Parent(s): 8572739

New File (#1)

Browse files

- New File (6283abd65a87cfb58ebd8a7d753ed1cda35c452f)


Co-authored-by: Joab Lee Ming Ze <[email protected]>

Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from torch import autocast
3
+ from diffusers import StableDiffusionPipeline
4
+
5
+ model_id = "hakurei/waifu-diffusion"
6
+ device = "cuda"
7
+
8
+
9
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision='fp16')
10
+ pipe = pipe.to(device)
11
+
12
+ prompt = "touhou hakurei_reimu 1girl solo portrait"
13
+ with autocast("cuda"):
14
+ image = pipe(prompt, guidance_scale=7.5)["sample"][0]
15
+
16
+ image.save("reimu_hakurei.png")