Update app.py
Browse files
app.py
CHANGED
@@ -191,9 +191,6 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
191 |
strength = gr.Slider(label="PromptStrength", value=100, minimum=0, maximum=100, step=1)
|
192 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
|
193 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ 2S a Karras", "DPM2 a Karras", "DPM2 Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "LMS Karras", "PLMS", "UniPC", "UniPC BH2"])
|
194 |
-
with gr.Row():
|
195 |
-
with gr.Accordion("🫘Seed", open=False):
|
196 |
-
seed_output = gr.Textbox(label="Seed Used", elem_id="seed-output")
|
197 |
|
198 |
# Add a button to trigger the image generation
|
199 |
with gr.Row():
|
@@ -218,7 +215,37 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
218 |
|
219 |
# Bind the button to the query function with the added width and height inputs
|
220 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
224 |
if __name__ == "__main__":
|
|
|
191 |
strength = gr.Slider(label="PromptStrength", value=100, minimum=0, maximum=100, step=1)
|
192 |
seed = gr.Slider(label="Seed", value=-1, minimum=-1, maximum=1000000000, step=1) # Setting the seed to -1 will make it random
|
193 |
method = gr.Radio(label="Sampling method", value="DPM++ 2M Karras", choices=["DPM++ 2M Karras", "DPM++ 2S a Karras", "DPM2 a Karras", "DPM2 Karras", "DPM++ SDE Karras", "DEIS", "LMS", "DPM Adaptive", "DPM++ 2M", "DPM2 Ancestral", "DPM++ S", "DPM++ SDE", "DDPM", "DPM Fast", "dpmpp_2s_ancestral", "Euler", "Euler CFG PP", "Euler a", "Euler Ancestral", "Euler+beta", "Heun", "Heun PP2", "DDIM", "LMS Karras", "PLMS", "UniPC", "UniPC BH2"])
|
|
|
|
|
|
|
194 |
|
195 |
# Add a button to trigger the image generation
|
196 |
with gr.Row():
|
|
|
215 |
|
216 |
# Bind the button to the query function with the added width and height inputs
|
217 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
218 |
+
|
219 |
+
|
220 |
+
with gr.Tab("🔄 Flip Image"):
|
221 |
+
with gr.Row():
|
222 |
+
image_input = gr.Image(label="Upload Image", height=320, type="filepath")
|
223 |
+
image_output = gr.Image(format="png")
|
224 |
+
with gr.Row():
|
225 |
+
image_button = gr.Button("Run", variant='primary')
|
226 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
227 |
+
with gr.Row():
|
228 |
+
clear_results = gr.Button(value="Clear Image", variant="primary", elem_id="clear_button")
|
229 |
+
clear_results.click(lambda: (None, None), None, [image_input, image_output])
|
230 |
+
|
231 |
+
with gr.Tab("ℹ️ Tips"):
|
232 |
+
with gr.Row():
|
233 |
+
with gr.Column():
|
234 |
+
gr.Markdown(
|
235 |
+
"""
|
236 |
+
<div style="max-width: 650px; margin: 2rem auto; padding: 1rem; border-radius: 10px; background-color: #f0f0f0;">
|
237 |
+
<h2 style="float: left; font-size: 1.5rem; margin-bottom: 1rem;">How to Use</h2>
|
238 |
+
<ol style="padding-left: 1.5rem;">
|
239 |
+
<li>Add an image to generate a prompt, this is optional.</li>
|
240 |
+
<li>If using an image to prompt, copy the prompt and paste into the prompt on tab 2</li>
|
241 |
+
<li>Enter a detailed description of the image you want to create.</li>
|
242 |
+
<li>Adjust advanced settings if desired (tap to expand).</li>
|
243 |
+
<li>Tap "Generate Image" and wait for your creation!</li>
|
244 |
+
</ol>
|
245 |
+
<p style="margin-top: 1rem; font-style: italic;">Tip: Be specific in your description for best results!</p>
|
246 |
+
</div>
|
247 |
+
"""
|
248 |
+
)
|
249 |
|
250 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
251 |
if __name__ == "__main__":
|