Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,19 +5,19 @@
|
|
| 5 |
import gradio as gr
|
| 6 |
from diffusers import StableDiffusionPipeline
|
| 7 |
|
| 8 |
-
def process_image(prompt, num_inference_steps, guidance_scale
|
| 9 |
model_path = "Akbartus/Lora360"
|
| 10 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
| 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
|
| 14 |
return image
|
| 15 |
|
| 16 |
-
iface = gr.Interface(fn=process_image, inputs=["text", "number", "number"
|
| 17 |
outputs="image",
|
| 18 |
examples=[
|
| 19 |
-
["A pokemon with blue eyes.", 25, 7.5
|
| 20 |
-
["A beautiful sunset.", 30, 5.0
|
| 21 |
])
|
| 22 |
iface.launch()
|
| 23 |
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
from diffusers import StableDiffusionPipeline
|
| 7 |
|
| 8 |
+
def process_image(prompt, num_inference_steps, guidance_scale):
|
| 9 |
model_path = "Akbartus/Lora360"
|
| 10 |
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
| 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 |
|
| 16 |
+
iface = gr.Interface(fn=process_image, inputs=["text", "number", "number"],
|
| 17 |
outputs="image",
|
| 18 |
examples=[
|
| 19 |
+
["A pokemon with blue eyes.", 25, 7.5],
|
| 20 |
+
["A beautiful sunset.", 30, 5.0]
|
| 21 |
])
|
| 22 |
iface.launch()
|
| 23 |
|