Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,5 @@
|
|
| 1 |
-
# import gradio as gr
|
| 2 |
-
|
| 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 |
-
|
| 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 |
|
| 17 |
-
iface = gr.Interface(fn=process_image, inputs=["text", "number", "number"],
|
| 18 |
-
outputs="image",
|
| 19 |
-
examples=[
|
| 20 |
-
["A pokemon with blue eyes.", 25, 7],
|
| 21 |
-
["A beautiful sunset.", 30, 5]
|
| 22 |
-
])
|
| 23 |
-
iface.launch()
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
gr.Interface.load("models/Akbartus/Lora360").launch(show_api=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|