Update app.py
Browse files
app.py
CHANGED
@@ -210,46 +210,44 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
210 |
examples = examples,
|
211 |
inputs = [text_prompt],
|
212 |
)
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
|
218 |
# Bind the button to the query function with the added width and height inputs
|
219 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
<
|
248 |
-
</
|
249 |
-
|
250 |
-
|
251 |
-
"""
|
252 |
-
)
|
253 |
|
254 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
255 |
if __name__ == "__main__":
|
|
|
210 |
examples = examples,
|
211 |
inputs = [text_prompt],
|
212 |
)
|
213 |
+
with gr.Group():
|
214 |
+
with gr.Row():
|
215 |
+
clear_results = gr.Button(value="Clear Image 🗑️", variant="primary", elem_id="clear_button")
|
216 |
+
clear_results.click(lambda: (None), None, [image_output], queue=False, show_api=False)
|
217 |
|
218 |
# Bind the button to the query function with the added width and height inputs
|
219 |
text_button.click(query, inputs=[text_prompt, negative_prompt, steps, cfg, method, seed, strength, width, height], outputs=image_output)
|
220 |
+
with gr.TabItem("🔄 Flip Image", visible=True):
|
221 |
+
with gr.Column():
|
222 |
+
with gr.Row():
|
223 |
+
image_input = gr.Image(label="Upload Image", height=320, type="filepath")
|
224 |
+
image_output = gr.Image(format="png")
|
225 |
+
with gr.Row():
|
226 |
+
image_button = gr.Button("Run", variant='primary')
|
227 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
228 |
+
with gr.Row():
|
229 |
+
clear_results = gr.Button(value="Clear Image", variant="primary", elem_id="clear_button")
|
230 |
+
clear_results.click(lambda: (None, None), None, [image_input, image_output])
|
231 |
+
|
232 |
+
with gr.TabItem("ℹ️ Tips", visible=True):
|
233 |
+
with gr.Column():
|
234 |
+
with gr.Row():
|
235 |
+
with gr.Column():
|
236 |
+
gr.Markdown(
|
237 |
+
"""
|
238 |
+
<div style="max-width: 650px; margin: 2rem auto; padding: 1rem; border-radius: 10px; background-color: #f0f0f0;">
|
239 |
+
<h2 style="float: left; font-size: 1.5rem; margin-bottom: 1rem;">How to Use</h2>
|
240 |
+
<ol style="padding-left: 1.5rem;">
|
241 |
+
<li>Add an image to generate a prompt, this is optional.</li>
|
242 |
+
<li>If using an image to prompt, copy the prompt and paste into the prompt on tab 2</li>
|
243 |
+
<li>Enter a detailed description of the image you want to create.</li>
|
244 |
+
<li>Adjust advanced settings if desired (tap to expand).</li>
|
245 |
+
<li>Tap "Generate Image" and wait for your creation!</li>
|
246 |
+
</ol>
|
247 |
+
<p style="margin-top: 1rem; font-style: italic;">Tip: Be specific in your description for best results!</p>
|
248 |
+
</div>
|
249 |
+
"""
|
250 |
+
)
|
|
|
|
|
251 |
|
252 |
app.queue(default_concurrency_limit=200, max_size=200) # <-- Sets up a queue with default parameters
|
253 |
if __name__ == "__main__":
|