Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,13 +3,14 @@
|
|
| 3 |
# gr.Interface.load("models/Akbartus/Lora360").launch(show_api=True)
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
-
from diffusers import StableDiffusionPipeline
|
| 7 |
|
| 8 |
def process_image(prompt, num_inference_steps, guidance_scale):
|
| 9 |
-
|
| 10 |
-
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", use_safetensors=True)
|
| 11 |
-
pipe.unet.load_attn_procs(model_path)
|
| 12 |
pipe.to("cpu")
|
|
|
|
|
|
|
| 13 |
image = pipe(prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale).images[0]
|
| 14 |
return image
|
| 15 |
|
|
|
|
| 3 |
# gr.Interface.load("models/Akbartus/Lora360").launch(show_api=True)
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
+
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
|
| 7 |
|
| 8 |
def process_image(prompt, num_inference_steps, guidance_scale):
|
| 9 |
+
|
| 10 |
+
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", safety_checker=None, use_safetensors=True)
|
|
|
|
| 11 |
pipe.to("cpu")
|
| 12 |
+
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True)
|
| 13 |
+
pipe.load_lora_weights("Akbartus/Lora360", weight_name="360Diffusion_v1.safetensors")
|
| 14 |
image = pipe(prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale).images[0]
|
| 15 |
return image
|
| 16 |
|