Readme
BiRefNet — complete background removal on Replicate
The full BiRefNet model zoo behind one endpoint: all 10 official variants plus ToonOut for anime/stylized art. Returns a transparent cutout or a raw matte. MIT-licensed — free for commercial use.
Highlights
- 11 models, one input — switch with
variant; one warm container serves them all. - Anime / illustration —
variant=toonouthandles hair wisps, line art, and translucency that general removers smear. - Animated GIF & WebP — multi-frame inputs are matted frame-by-frame and returned as an animated WebP with full transparency (frame timing + loop preserved).
- Real controls —
cutout(RGBA) or rawmask; grow / shrink / blur the matte; refine foreground colours; pick inference resolution. - MIT / commercial-OK — unlike BRIA-based removers, the output is free to use commercially.
Variants
variant |
Best for | Native res |
|---|---|---|
general |
general-purpose (default) | 1024 |
general-hr |
high-resolution photos | 2048 |
portrait |
human portraits | 1024 |
matting |
trimap-free soft matting | 1024 |
matting-hr |
high-res soft matting | 2048 |
dynamic |
robust across resolutions | 1024 |
dynamic-matting |
dynamic-res soft matting | 1024 |
lite |
Swin-Tiny — faster / cheaper | 1024 |
lite-2k |
Swin-Tiny at 2K | 2048 |
lite-matting |
Swin-Tiny soft matting | 1024 |
toonout |
anime / stylized art | 1024 |
Inputs
- image — any image; animated GIF/WebP supported (→ animated WebP output).
- variant — which model (table above). Default
general. - resolution — square inference size;
0= the variant’s native resolution. - output_format —
cutout(RGBA) ormask(raw alpha matte). - mask_blur / mask_offset — soften / grow / shrink the matte.
- refine_fg — FB blur-fusion to strip background bleed on soft edges.
Credits
Unofficial community packaging — not affiliated with the model authors; we earn nothing (compute fees go to Replicate).
- BiRefNet — Peng Zheng et al. · MIT · https://github.com/ZhengPeng7/BiRefNet
- ToonOut — Matteo Muratori & Joël Seytre · MIT · https://arxiv.org/abs/2509.06839
Source: https://github.com/sprited-ai/birefnet · Anime-only endpoint: https://replicate.com/sprited/birefnet-toonout