Configuration and sizing#

Settings (environment variables)#

VariableDefaultMeaning
WITHOUTBG_MAX_INFERENCE_SIDE1024Long side (px) the matte is estimated at; it is resized back to the original size. Raise up to 4096 for finer edges on large photos, at more CPU time and memory.
WITHOUTBG_ORT_THREADSall coresCaps ONNX Runtime threads. Set it when several containers or other services share a server.

Shell

docker run -d -p 8000:8000 -e WITHOUTBG_MAX_INFERENCE_SIDE=2048 -e WITHOUTBG_ORT_THREADS=4 "$IMAGE"

The container listens on port 8000 and runs as a non-root user. It needs no volumes and no outbound network.

Server sizing#

MinimumRecommended
CPU4 cores, x86_648+ cores
RAM8 GB16 GB (a container peaks at about 5.5 GB)
Disk5 GB free
GPUnot needed

Latency depends on the CPU, the image and WITHOUTBG_MAX_INFERENCE_SIDE. Measure on your own hardware with a sample of your images before sizing a fleet.

Scaling#

One container processes one image at a time and queues the rest. For more throughput, run more containers (each with WITHOUTBG_ORT_THREADS set to its share of the cores) or more servers behind a load balancer. Use GET /ready as the load balancer's health check.

Reverse proxy#

The service has no TLS or authentication of its own. In front of it, set TLS, your authentication, a request body limit (25 MB suits most photos) and a timeout of at least 120 s for large images.

This page as markdown: /pro-model-self-host/docs/configuration.md. Not a customer yet? Pro Model Self-Host.