High-Quality Background Removal & Subject Cutout
Every photo editor has a "remove background" button, and every one of them falls apart on the hard parts — flyaway strands of hair, the gaps between tree branches, lace, fur, mesh. BiRefNet is the automatic, AI-powered version of that button, but built to nail exactly those tricky edges at high resolution, producing clean transparent cutouts at professional quality. It's one of the most popular open-source tools for the job, developed by ZhengPeng7 and published in CAAI Artificial Intelligence Research (2024).
🏆 ~787,000 downloads/month — one of the most-used segmentation models on Hugging Face, with state-of-the-art results on DIS, HRSOD, and COD benchmarks
What it does
BiRefNet looks at a photo, figures out what the main subject is, and creates a precise outline around it so you can lift that subject off its background. Think of it as an automatic, AI-powered version of the "remove background" button you see in photo editing tools, but with far better quality. It excels at the edges most tools get wrong: individual strands of hair, the gaps between tree branches, lace, fur, mesh, and other fine details. It works at high resolution, which means the cutouts stay sharp and clean even on large images. BiRefNet is widely considered one of the best free, open tools available for this job.
Problem it solves
- Clean background removal – Produces transparent cutouts that look professionally edited, not roughly traced
- Tricky edges and fine details – Handles hair, fur, leaves, and other detailed outlines that simpler tools mangle
- High-resolution images – Works well on large, detailed photos without losing edge quality
- Automatic subject detection – Finds the main subject of a photo on its own — no clicking, drawing, or describing required
- Hidden or camouflaged subjects – Can still find and outline subjects that blend into their background (e.g., animals in foliage)
- Product photos – Generates clean, transparent product images suitable for e-commerce and marketing
- Prep work for other AI tools – The clean mask it produces can feed into other tools for editing, replacing backgrounds, relighting, or 3D work
Input/Output
- Input:
- Any standard photo (PNG, JPEG, etc.)
- Works best on images around 1024 × 1024 pixels or larger
- No instructions or clicks needed - it picks the main subject automatically
- Outputs:
- Image output - the mask
- A precise outline of the subject as an image (the subject area in color, everything else black)
- Can be applied directly to the original photo to produce a transparent-background cutout - ready to drop onto any new background
- Text output - mask metadata
- Total number of masks found
- For each detected subject: a label, the mask color, a confidence score (0–1, how sure the model is), and a bounding box in pixels (the rectangular area the subject occupies)
- Example:
subject|object_0, (0 159 255), 0.987, bbox[0.0 0.0 639.0 426.0]
- Model Variants
Variant | Best For |
General | Default all-round choice — best balance of quality and speed for most images (~0.2B params, 1024 × 1024) |
HR | High-resolution variant — best for large or detail-heavy images where edge sharpness at high resolution matters most (~0.2B params) |
Lite-2K | Lightweight 2K-resolution variant — much smaller and faster, great when you need higher throughput or are working on lower-spec hardware (44.4M params, 2K input) |
- Output transparent-background foreground cutout (RGBA):
- Removes color bleeding at edges (e.g. green fringe from grass backgrounds on hair), producing a clean RGBA cutout directly — no need for the Masker + Multiply chain
Accuracy & Speed
Output quality | Top-tier among the best open-source models for clean cutouts |
Benchmarks | State-of-the-art on DIS, HRSOD, and COD |
Image size | Designed for high-resolution images (1024 × 1024 by default; larger versions available) |
Popularity | One of the most-used segmentation models on Hugging Face (~787,000 downloads per month) |
Model Source
- Huggingface
- License: MIT
Compliance & Provenance
Provider | Open-source |
Provider type | Specialized |
License | MIT |
EU AI Act risk class | Minimal Risk |
Art. 50 transparency | Not applicable |
Region availability | Available globally |
Training data summary | Pending — provider has not yet published per Art. 53(d) |
For more on how we classify models and mark outputs, see our AI Policy.