DigiP-AI commited on
Commit
7c937f4
·
verified ·
1 Parent(s): 9656d81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -37
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
- 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
-
221
-
222
- with gr.TabItem("🔄 Flip Image", visible=True):
223
- with gr.Column():
224
- with gr.Row():
225
- image_input = gr.Image(label="Upload Image", height=320, type="filepath")
226
- image_output = gr.Image(format="png")
227
- with gr.Row():
228
- image_button = gr.Button("Run", variant='primary')
229
- image_button.click(flip_image, inputs=image_input, outputs=image_output)
230
- with gr.Row():
231
- clear_results = gr.Button(value="Clear Image", variant="primary", elem_id="clear_button")
232
- clear_results.click(lambda: (None, None), None, [image_input, image_output])
233
-
234
- with gr.TabItem("ℹ️ Tips", visible=True):
235
- with gr.Column():
236
- with gr.Row():
237
- with gr.Column():
238
- gr.Markdown(
239
- """
240
- <div style="max-width: 650px; margin: 2rem auto; padding: 1rem; border-radius: 10px; background-color: #f0f0f0;">
241
- <h2 style="float: left; font-size: 1.5rem; margin-bottom: 1rem;">How to Use</h2>
242
- <ol style="padding-left: 1.5rem;">
243
- <li>Add an image to generate a prompt, this is optional.</li>
244
- <li>If using an image to prompt, copy the prompt and paste into the prompt on tab 2</li>
245
- <li>Enter a detailed description of the image you want to create.</li>
246
- <li>Adjust advanced settings if desired (tap to expand).</li>
247
- <li>Tap "Generate Image" and wait for your creation!</li>
248
- </ol>
249
- <p style="margin-top: 1rem; font-style: italic;">Tip: Be specific in your description for best results!</p>
250
- </div>
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__":