model2 commited on
Commit
09b97b3
·
1 Parent(s): f7747cb

faster upscale

Browse files
Files changed (1) hide show
  1. app.py +19 -27
app.py CHANGED
@@ -275,14 +275,9 @@ def advance_blur(input_image):
275
  if __name__ == "__main__":
276
  # Start your Gradio app
277
  css_code = """
278
- .gradio-container {
279
- max-width: 480px; /* keep UI narrow for mobile-friendliness */
280
- margin: 0 auto; /* center the content */
281
- }
282
-
283
  #fixed-image-size {
284
- width: 300px !important; /* fix the width of image */
285
- height: 300px !important; /* fix the height of image */
286
  object-fit: cover; /* makes the image fill area without stretching */
287
  }
288
  """
@@ -299,28 +294,25 @@ if __name__ == "__main__":
299
  """,
300
  )
301
 
302
- with gr.Column():
303
- input_image = gr.Image(
304
- type="filepath",
305
- label="Upload Your Image",
306
- elem_id="fixed-image-size",
307
- show_label=True,
308
- )
309
- submit_btn = gr.Button("Submit", variant="primary")
310
-
311
- output_image = gr.Image(
312
- label="Vance Blurred Image",
313
- elem_id="fixed-image-size",
314
- show_label=True,
315
- )
 
 
 
316
 
317
  # Trigger your blur function
318
  submit_btn.click(fn=advance_blur, inputs=[input_image], outputs=[output_image])
319
 
320
- # Option to "Start Over" (clear inputs/outputs)
321
- start_over_btn = gr.Button("Start Over", variant="secondary")
322
- start_over_btn.click(
323
- fn=lambda: (None, None), inputs=[], outputs=[input_image, output_image]
324
- )
325
-
326
  app.launch(share=True)
 
275
  if __name__ == "__main__":
276
  # Start your Gradio app
277
  css_code = """
 
 
 
 
 
278
  #fixed-image-size {
279
+ max-width: 500px !important; /* fix the width of image */
280
+ height: 500px !important; /* fix the height of image */
281
  object-fit: cover; /* makes the image fill area without stretching */
282
  }
283
  """
 
294
  """,
295
  )
296
 
297
+ with gr.Row():
298
+
299
+ with gr.Column():
300
+ input_image = gr.Image(
301
+ type="filepath",
302
+ label="Upload Your Image",
303
+ elem_id="fixed-image-size",
304
+ show_label=True,
305
+ )
306
+ submit_btn = gr.Button("Submit", variant="primary")
307
+
308
+ with gr.Column():
309
+ output_image = gr.Image(
310
+ label="Vance Blurred Image",
311
+ elem_id="fixed-image-size",
312
+ show_label=True,
313
+ )
314
 
315
  # Trigger your blur function
316
  submit_btn.click(fn=advance_blur, inputs=[input_image], outputs=[output_image])
317
 
 
 
 
 
 
 
318
  app.launch(share=True)