prithivMLmods commited on
Commit
1124bc4
·
verified ·
1 Parent(s): bf77777

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -18
app.py CHANGED
@@ -166,7 +166,7 @@ def preview_image_and_mask(image, width, height, overlap_percentage, resize_opti
166
 
167
  return preview
168
 
169
- @spaces.GPU(duration=20)
170
  def infer(image, width, height, overlap_percentage, num_inference_steps, resize_option, custom_resize_percentage, prompt_input, alignment, overlap_left, overlap_right, overlap_top, overlap_bottom):
171
  background, mask = prepare_image_and_mask(image, width, height, overlap_percentage, resize_option, custom_resize_percentage, alignment, overlap_left, overlap_right, overlap_top, overlap_bottom)
172
 
@@ -245,24 +245,10 @@ def update_history(new_image, history):
245
 
246
  css = """
247
  .gradio-container {
248
- max-width: 1200px !important;
249
- margin: auto !important;
250
- }
251
- /* Add some spacing */
252
- .gr-form > * {
253
- margin-bottom: 10px;
254
- }
255
- .gr-button {
256
- min-width: 100px; /* Ensure buttons have a minimum width */
257
- }
258
- /* Style the history gallery */
259
- #history_gallery .gr-gallery {
260
- min-height: 150px; /* Give gallery some minimum height */
261
- }
262
- #history_gallery .gr-gallery > .gr-image {
263
- border: 1px solid #ddd; /* Add subtle border to gallery images */
264
- border-radius: 4px;
265
  }
 
 
266
  """
267
 
268
  title = """<h1 align="center">Diffusers Image Outpaint Lightning</h1>
@@ -362,8 +348,10 @@ with gr.Blocks(css=css) as demo:
362
 
363
  with gr.Column():
364
  result = gr.Image(label="Generated Image", format="png")
 
365
 
366
  history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
 
367
 
368
  def use_output_as_input(output_image):
369
  """Sets the generated output as the new input image."""
 
166
 
167
  return preview
168
 
169
+ @spaces.GPU(duration=24)
170
  def infer(image, width, height, overlap_percentage, num_inference_steps, resize_option, custom_resize_percentage, prompt_input, alignment, overlap_left, overlap_right, overlap_top, overlap_bottom):
171
  background, mask = prepare_image_and_mask(image, width, height, overlap_percentage, resize_option, custom_resize_percentage, alignment, overlap_left, overlap_right, overlap_top, overlap_bottom)
172
 
 
245
 
246
  css = """
247
  .gradio-container {
248
+ width: 1200px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  }
250
+ h1 { text-align: center; }
251
+ footer { visibility: hidden; }
252
  """
253
 
254
  title = """<h1 align="center">Diffusers Image Outpaint Lightning</h1>
 
348
 
349
  with gr.Column():
350
  result = gr.Image(label="Generated Image", format="png")
351
+ use_as_input_button = gr.Button("Use as Input Image", visible=False, interactive=False)
352
 
353
  history_gallery = gr.Gallery(label="History", columns=6, object_fit="contain", interactive=False)
354
+ preview_image = gr.Image(label="Preview")
355
 
356
  def use_output_as_input(output_image):
357
  """Sets the generated output as the new input image."""