Update app.py
Browse files
app.py
CHANGED
|
@@ -74,7 +74,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 74 |
|
| 75 |
with gr.Row(equal_height=True):
|
| 76 |
with gr.Column():
|
| 77 |
-
# Removed 'tool' parameter and added mobile-friendly settings
|
| 78 |
input_image = gr.Image(
|
| 79 |
label="Upload Image",
|
| 80 |
type="pil",
|
|
@@ -110,19 +109,19 @@ with gr.Blocks(css=css) as demo:
|
|
| 110 |
fn=process_and_update,
|
| 111 |
inputs=[input_image],
|
| 112 |
outputs=[output_image, status_msg],
|
| 113 |
-
api_name="remove_background"
|
| 114 |
)
|
| 115 |
|
| 116 |
clear_btn.click(
|
| 117 |
fn=lambda: (None, None, ""),
|
| 118 |
outputs=[input_image, output_image, status_msg],
|
| 119 |
-
api_name="clear"
|
| 120 |
)
|
| 121 |
|
|
|
|
|
|
|
|
|
|
| 122 |
# Launch the app
|
| 123 |
demo.launch(
|
| 124 |
share=True,
|
| 125 |
-
enable_queue=True,
|
| 126 |
show_error=True,
|
| 127 |
server_port=7860,
|
| 128 |
server_name="0.0.0.0"
|
|
|
|
| 74 |
|
| 75 |
with gr.Row(equal_height=True):
|
| 76 |
with gr.Column():
|
|
|
|
| 77 |
input_image = gr.Image(
|
| 78 |
label="Upload Image",
|
| 79 |
type="pil",
|
|
|
|
| 109 |
fn=process_and_update,
|
| 110 |
inputs=[input_image],
|
| 111 |
outputs=[output_image, status_msg],
|
|
|
|
| 112 |
)
|
| 113 |
|
| 114 |
clear_btn.click(
|
| 115 |
fn=lambda: (None, None, ""),
|
| 116 |
outputs=[input_image, output_image, status_msg],
|
|
|
|
| 117 |
)
|
| 118 |
|
| 119 |
+
# Enable queue before launching
|
| 120 |
+
demo.queue(concurrency_count=1)
|
| 121 |
+
|
| 122 |
# Launch the app
|
| 123 |
demo.launch(
|
| 124 |
share=True,
|
|
|
|
| 125 |
show_error=True,
|
| 126 |
server_port=7860,
|
| 127 |
server_name="0.0.0.0"
|