Spaces:
Running
on
Zero
Running
on
Zero
faster upscale
Browse files
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:
|
| 285 |
-
height:
|
| 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.
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 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)
|