Create APP.py
Browse files
APP.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import autocast
|
3 |
+
from diffusers import StableDiffusionPipeline
|
4 |
+
|
5 |
+
pipe = StableDiffusionPipeline.from_pretrained(
|
6 |
+
'hakurei/waifu-diffusion',
|
7 |
+
torch_dtype=torch.float32
|
8 |
+
).to('cuda')
|
9 |
+
|
10 |
+
prompt = "1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt"
|
11 |
+
with autocast("cuda"):
|
12 |
+
image = pipe(prompt, guidance_scale=6)["sample"][0]
|
13 |
+
|
14 |
+
image.save("test.png")
|