NukeBird commited on
Commit
51d92fb
1 Parent(s): 40d9d1c

Create app.py

Browse files
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")