Spaces:
Runtime error
Runtime error
Commit
·
efcd5d5
1
Parent(s):
ff6aa3b
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,10 @@ import torch
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
model_base = "
|
| 6 |
lora_model_path = "Krebzonide/3a0s-w68r-4qw1-0"
|
| 7 |
|
| 8 |
-
pipe = StableDiffusionPipeline.
|
| 9 |
pipe.unet.load_attn_procs(lora_model_path) #working, commented to text base model------------------------------------
|
| 10 |
#pipe.unet.load_attn_procs(lora_model_path, use_auth_token=True) test accessing a private model----------------------
|
| 11 |
pipe.to("cuda")
|
|
@@ -43,7 +43,7 @@ css = """
|
|
| 43 |
"""
|
| 44 |
|
| 45 |
def generate(prompt, neg_prompt):
|
| 46 |
-
images = pipe(prompt,negative_prompt=neg_prompt,num_inference_steps=25,guidance_scale=6).images
|
| 47 |
return [(img, f"Image {i+1}") for i, img in enumerate(images)]
|
| 48 |
|
| 49 |
|
|
|
|
| 2 |
from diffusers import StableDiffusionPipeline
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
model_base = "runwayml/stable-diffusion-v1-5"
|
| 6 |
lora_model_path = "Krebzonide/3a0s-w68r-4qw1-0"
|
| 7 |
|
| 8 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_base, torch_dtype=torch.float16, use_safetensors=True)
|
| 9 |
pipe.unet.load_attn_procs(lora_model_path) #working, commented to text base model------------------------------------
|
| 10 |
#pipe.unet.load_attn_procs(lora_model_path, use_auth_token=True) test accessing a private model----------------------
|
| 11 |
pipe.to("cuda")
|
|
|
|
| 43 |
"""
|
| 44 |
|
| 45 |
def generate(prompt, neg_prompt):
|
| 46 |
+
images = pipe(prompt,negative_prompt=neg_prompt,num_inference_steps=25,guidance_scale=6, cross_attention_kwargs={"scale": 0.5}).images
|
| 47 |
return [(img, f"Image {i+1}") for i, img in enumerate(images)]
|
| 48 |
|
| 49 |
|