
Salient-subject background removal on an Image with BiRefNet. A soft matte is predicted and the sink resolves the arm: an RGBA cutout Image with the soft alpha, a (Segmentation, BoundingBox), a (Mask, DetectedClass), or a [Mask].
RGBA cutout from a file, served over HTTP for compositing.
Live matte from a camera stream pushed to the browser.
Image and keeps the raw soft alpha; the mask arms instead binarise the matte at threshold, which has no effect on the cutout arm.
inference_size and bilinearly resampled back to the source resolution, so edge sharpness scales with that size at proportional GPU cost; the model targets a single salient subject rather than every foreground object.
model artifact (a transformers snapshot directory holding config.json, the safetensors weights and the repo's own modeling code) with `local_files_only`; `trust_remote_code` runs the snapshot's modeling code, so no Hub fetch occurs. Bind a BiRefNet checkpoint to the model slot at deploy.
inference_size is extremely slow.
device, inference_size and threshold are captured once at startup; changing any of them requires a redeploy.
Automated release