Spaces:
Running on Zero
Running on Zero
debug: remove queue=False and add pre-dispatch print
Browse files
app.py
CHANGED
|
@@ -351,13 +351,19 @@ with gr.Blocks(delete_cache=(43200, 43200), theme=custom_theme) as demo:
|
|
| 351 |
outputs=[is_samimage, single_sam_image_example, single_image_example],
|
| 352 |
)
|
| 353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 354 |
image_prompt.upload(
|
| 355 |
-
|
| 356 |
-
img, rmbg, _enable_pre_resize_default
|
| 357 |
-
),
|
| 358 |
inputs=[image_prompt, rmbg_tag],
|
| 359 |
outputs=[image_prompt, raw_image_cache],
|
| 360 |
-
queue=False,
|
| 361 |
).success(
|
| 362 |
active_btn_by_content,
|
| 363 |
inputs=image_prompt,
|
|
|
|
| 351 |
outputs=[is_samimage, single_sam_image_example, single_image_example],
|
| 352 |
)
|
| 353 |
|
| 354 |
+
def _preprocess_image_dispatch(img, rmbg):
|
| 355 |
+
import sys, os
|
| 356 |
+
print(f"[ZGPU] upload handler ENTER pid={os.getpid()}", flush=True)
|
| 357 |
+
sys.stdout.flush()
|
| 358 |
+
out = preprocess_image_fn(img, rmbg, _enable_pre_resize_default)
|
| 359 |
+
print("[ZGPU] upload handler RETURN", flush=True)
|
| 360 |
+
sys.stdout.flush()
|
| 361 |
+
return out
|
| 362 |
+
|
| 363 |
image_prompt.upload(
|
| 364 |
+
_preprocess_image_dispatch,
|
|
|
|
|
|
|
| 365 |
inputs=[image_prompt, rmbg_tag],
|
| 366 |
outputs=[image_prompt, raw_image_cache],
|
|
|
|
| 367 |
).success(
|
| 368 |
active_btn_by_content,
|
| 369 |
inputs=image_prompt,
|