Spaces:
Running
on
Zero
Running
on
Zero
artificialguybr
commited on
Commit
•
06fd0d1
1
Parent(s):
fa52e75
Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,7 @@ def run_lora(prompt, weight):
|
|
29 |
print("Query function executed successfully.")
|
30 |
return Image.open(image_bytes)
|
31 |
|
|
|
32 |
print("Before Gradio Interface")
|
33 |
|
34 |
title = gr.HTML("<h1>LoRA the Explorer</h1>")
|
@@ -37,16 +38,17 @@ gallery = gr.Gallery(
|
|
37 |
[(item["image"], item["title"]) for item in loras],
|
38 |
label="LoRA Gallery",
|
39 |
allow_preview=False,
|
40 |
-
columns=3
|
|
|
41 |
)
|
42 |
|
43 |
-
prompt = gr.Textbox(label="Prompt", lines=1, max_lines=1, placeholder="Type a prompt after selecting a LoRA")
|
44 |
|
45 |
-
advanced_options = gr.Accordion("Advanced options", open=False)
|
46 |
|
47 |
-
weight = gr.Slider(0, 10, value=1, step=0.1, label="LoRA weight")
|
48 |
|
49 |
-
result = gr.Image(interactive=False, label="Generated Image")
|
50 |
|
51 |
gr.Interface(
|
52 |
fn=run_lora,
|
@@ -55,4 +57,4 @@ gr.Interface(
|
|
55 |
css="custom.css" # Make sure your custom CSS file is in the same directory
|
56 |
).launch()
|
57 |
|
58 |
-
print("After Gradio Interface")
|
|
|
29 |
print("Query function executed successfully.")
|
30 |
return Image.open(image_bytes)
|
31 |
|
32 |
+
# Gradio UI
|
33 |
print("Before Gradio Interface")
|
34 |
|
35 |
title = gr.HTML("<h1>LoRA the Explorer</h1>")
|
|
|
38 |
[(item["image"], item["title"]) for item in loras],
|
39 |
label="LoRA Gallery",
|
40 |
allow_preview=False,
|
41 |
+
columns=3,
|
42 |
+
name="gallery" # Add a name for the gallery component
|
43 |
)
|
44 |
|
45 |
+
prompt = gr.Textbox(label="Prompt", lines=1, max_lines=1, placeholder="Type a prompt after selecting a LoRA", name="prompt")
|
46 |
|
47 |
+
advanced_options = gr.Accordion("Advanced options", open=False, name="advanced_options")
|
48 |
|
49 |
+
weight = gr.Slider(0, 10, value=1, step=0.1, label="LoRA weight", name="weight")
|
50 |
|
51 |
+
result = gr.Image(interactive=False, label="Generated Image", name="result_image")
|
52 |
|
53 |
gr.Interface(
|
54 |
fn=run_lora,
|
|
|
57 |
css="custom.css" # Make sure your custom CSS file is in the same directory
|
58 |
).launch()
|
59 |
|
60 |
+
print("After Gradio Interface")
|