docs: document background_mode in DEPLOY.md / DEPLOY_ZH.md
Sync the deployment guides with the c56e58a HTTP change: add a
"Background mode (flat vs complex)" subsection and a complex-mode curl
example. Notes that complex reuses existing weights, ignores screen_color,
defaults the cross-check veto off, and returns X-BGFilter-Background-Mode;
points to README for the full field/header reference.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -178,6 +178,23 @@ and HTTP service). **You must provision this model** (Option A or B above):
|
||||
CPU, ~1 GB less VRAM; the redundant primary segmenter is then skipped at
|
||||
startup). Off by default so the veto stays an independent signal.
|
||||
|
||||
### Background mode (flat vs complex)
|
||||
|
||||
The `/remove-background` `background_mode` form field selects the pipeline:
|
||||
|
||||
- `flat` (**default**, also when omitted): the colour-keyed pipeline for a solid
|
||||
flat background — unchanged behaviour.
|
||||
- `complex`: non-flat / scene background. No colour key: segmentation alone drives
|
||||
the trimap and the colour-keyed stages (background auto-detect, hue split, chroma
|
||||
suppression, despill) are bypassed. `screen_color` is ignored; expect flat
|
||||
backgrounds to stay stronger on hair-level detail.
|
||||
|
||||
No extra weights: `complex` reuses the already-provisioned BiRefNet segmenter +
|
||||
ViTMatte. The cross-check veto still works in `complex` (via a hue-free gate) but
|
||||
**defaults off** there — pass `cross_check=on` to enable it. The response echoes the
|
||||
mode used in the `X-BGFilter-Background-Mode: flat|complex` header. Full field/header
|
||||
reference is in `README.md` → *HTTP service*.
|
||||
|
||||
### Downloading behind a firewall (CN networks)
|
||||
|
||||
If direct HuggingFace access is blocked, use the mirror **with the local proxy
|
||||
@@ -310,6 +327,10 @@ curl -s http://127.0.0.1:18083/healthz
|
||||
|
||||
curl -sS -F "file=@input.png" -F "screen_color=#CFEFFF" \
|
||||
http://127.0.0.1:18083/remove-background -o out.png
|
||||
|
||||
# non-flat / scene background (no colour key; cross-check defaults off here)
|
||||
curl -sS -F "file=@scene.jpg" -F "background_mode=complex" \
|
||||
http://127.0.0.1:18083/remove-background -o out.png
|
||||
```
|
||||
|
||||
## 10. Exposing the service
|
||||
|
||||
Reference in New Issue
Block a user