Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
761d42b
1
Parent(s):
c4a1a86
Update app.py
Browse files
app.py
CHANGED
@@ -58,22 +58,21 @@ def generate_images(
|
|
58 |
# Create the Gradio blocks
|
59 |
with gr.Blocks(css="style.css", theme='derekzen/stardust') as demo:
|
60 |
with gr.Row(equal_height=False):
|
61 |
-
with gr.Column():
|
62 |
-
with gr.Group():
|
63 |
-
model_dropdown = gr.Dropdown(choices=list(models.keys()), value=model_list[0] if model_list else None, label="Model")
|
64 |
-
prompt = gr.Textbox(label="Prompt")
|
65 |
-
generate_btn = gr.Button("Generate Image")
|
66 |
-
with gr.Accordion("Advanced", open=False):
|
67 |
-
negative_prompt = gr.Textbox(label="Negative Prompt", value="lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]")
|
68 |
-
num_inference_steps = gr.Slider(minimum=10, maximum=50, step=1, value=25, label="Number of Inference Steps")
|
69 |
-
guidance_scale = gr.Slider(minimum=1, maximum=20, step=0.5, value=7.5, label="Guidance Scale")
|
70 |
-
height = gr.Slider(minimum=1024, maximum=2048, step=256, value=1024, label="Height")
|
71 |
-
width = gr.Slider(minimum=1024, maximum=2048, step=256, value=1024, label="Width")
|
72 |
-
num_images = gr.Slider(minimum=1, maximum=4, step=1, value=4, label="Number of Images")
|
73 |
-
with gr.Column():
|
74 |
-
output_gallery = gr.Gallery(label="Generated Images", height=480, scale=1)
|
75 |
|
76 |
generate_btn.click(generate_images, inputs=[model_dropdown, prompt, negative_prompt, num_inference_steps, guidance_scale, height, width, num_images], outputs=output_gallery)
|
77 |
|
78 |
-
demo.launch()
|
79 |
-
|
|
|
58 |
# Create the Gradio blocks
|
59 |
with gr.Blocks(css="style.css", theme='derekzen/stardust') as demo:
|
60 |
with gr.Row(equal_height=False):
|
61 |
+
with gr.Column(elem_id="input_column"):
|
62 |
+
with gr.Group(elem_id="input_group"):
|
63 |
+
model_dropdown = gr.Dropdown(choices=list(models.keys()), value=model_list[0] if model_list else None, label="Model", elem_id="model_dropdown")
|
64 |
+
prompt = gr.Textbox(label="Prompt", elem_id="prompt_textbox")
|
65 |
+
generate_btn = gr.Button("Generate Image", elem_id="generate_button")
|
66 |
+
with gr.Accordion("Advanced", open=False, elem_id="advanced_accordion"):
|
67 |
+
negative_prompt = gr.Textbox(label="Negative Prompt", value="lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]", elem_id="negative_prompt_textbox")
|
68 |
+
num_inference_steps = gr.Slider(minimum=10, maximum=50, step=1, value=25, label="Number of Inference Steps", elem_id="num_inference_steps_slider")
|
69 |
+
guidance_scale = gr.Slider(minimum=1, maximum=20, step=0.5, value=7.5, label="Guidance Scale", elem_id="guidance_scale_slider")
|
70 |
+
height = gr.Slider(minimum=1024, maximum=2048, step=256, value=1024, label="Height", elem_id="height_slider")
|
71 |
+
width = gr.Slider(minimum=1024, maximum=2048, step=256, value=1024, label="Width", elem_id="width_slider")
|
72 |
+
num_images = gr.Slider(minimum=1, maximum=4, step=1, value=4, label="Number of Images", elem_id="num_images_slider")
|
73 |
+
with gr.Column(elem_id="output_column"):
|
74 |
+
output_gallery = gr.Gallery(label="Generated Images", height=480, scale=1, elem_id="output_gallery")
|
75 |
|
76 |
generate_btn.click(generate_images, inputs=[model_dropdown, prompt, negative_prompt, num_inference_steps, guidance_scale, height, width, num_images], outputs=output_gallery)
|
77 |
|
78 |
+
demo.launch()
|
|