Krebzonide
commited on
Commit
·
f4ff201
1
Parent(s):
85a63cc
create app.py
Browse filesJust testing the basics. Obviously not close to finished.
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import StableDiffusionPipeline
|
3 |
+
|
4 |
+
model_base = "runwayml/stable-diffusion-v1-5"
|
5 |
+
lora_model_path = "Krebzonide/3a0s-w68r-4qw1-0"
|
6 |
+
|
7 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_base, torch_dtype=torch.float16, use_safetensors=True)
|
8 |
+
pipe.unet.load_attn_procs(lora_model_path)
|
9 |
+
pipe.to("cuda")
|
10 |
+
|
11 |
+
image = pipe(
|
12 |
+
"A picture of gfemti in a black dress, outdoors",
|
13 |
+
num_inference_steps=25,
|
14 |
+
guidance_scale=7.5,
|
15 |
+
cross_attention_kwargs={"scale": 0.5},
|
16 |
+
).images[0]
|
17 |
+
image.save("test1.png")
|