Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -57,31 +57,33 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
57 |
return None
|
58 |
|
59 |
css = """
|
60 |
-
#
|
61 |
-
margin: 0 auto;
|
62 |
max-width: 580px;
|
|
|
|
|
63 |
}
|
64 |
"""
|
65 |
|
66 |
-
with gr.Blocks(
|
67 |
-
with gr.
|
68 |
-
with gr.
|
69 |
-
with gr.
|
70 |
-
|
71 |
-
|
72 |
-
with gr.
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
|
85 |
-
|
86 |
|
87 |
app.launch(show_api=False, share=False)
|
|
|
57 |
return None
|
58 |
|
59 |
css = """
|
60 |
+
#app-container {
|
|
|
61 |
max-width: 580px;
|
62 |
+
margin-left: auto;
|
63 |
+
margin-right: auto;
|
64 |
}
|
65 |
"""
|
66 |
|
67 |
+
with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
|
68 |
+
with gr.Column(elem_id="app-container"):
|
69 |
+
with gr.Row():
|
70 |
+
with gr.Column(elem_id="prompt-container"):
|
71 |
+
with gr.Row():
|
72 |
+
text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=3, elem_id="prompt-text-input")
|
73 |
+
with gr.Row():
|
74 |
+
with gr.Accordion("Advanced Settings", open=False):
|
75 |
+
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry, text, fuzziness", lines=3, elem_id="negative-prompt-text-input")
|
76 |
+
steps = gr.Slider(label="Sampling steps", value=35, minimum=1, maximum=100, step=1)
|
77 |
+
cfg = gr.Slider(label="CFG Scale", value=7, minimum=1, maximum=20, step=1)
|
78 |
+
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ SDE Karras", "Euler", "Euler a", "Heun", "DDIM"])
|
79 |
+
strength = gr.Slider(label="Strength", value=0.7, minimum=0, maximum=1, step=0.001)
|
80 |
+
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1)
|
81 |
|
82 |
+
with gr.Row():
|
83 |
+
text_button = gr.Button("Run", variant='primary', elem_id="gen-button")
|
84 |
+
with gr.Row():
|
85 |
+
image_output = gr.Image(type="pil", label="Image Output", elem_id="gallery")
|
86 |
|
87 |
+
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength], outputs=image_output)
|
88 |
|
89 |
app.launch(show_api=False, share=False)
|