BiRefNet-matting
Will it run on your hardware?
Pick your GPU memory - see which quantizations fit, and the cheapest card for the rest
Need an exact figure for your context length? Use the VRAM calculator.
Run it locally
Copy-paste - running in under a minute
vllm serve ZhengPeng7/BiRefNet-mattingNew to this? Start with Ollama · serve to many users with vLLM.
Deep dive
Notes, sources, and the full write-up
BiRefNet-matting is an open-weight image segmentation model published by ZhengPeng7 on Hugging Face in October 2024, with 220M parameters under the mit license.
Among the 25 image segmentation models in this directory it ranks 20th by monthly Hugging Face downloads, and 3 of the others are larger.
HardwareLink to this section
Unquantized FP16 weights take about 1 GB; 8-bit brings that to ~1 GB and 4-bit (Q4_K_M) to ~1 GB, before activations and any context or image buffers. At this size it runs on almost any recent GPU, on Apple Silicon, and usable on a modern CPU. Check exact numbers for your card with the VRAM calculator.
Similar image segmentation modelsLink to this section
- BiRefNet - 220M, 994,296 downloads/month
- BiRefNet-portrait - 220M, 93,214 downloads/month
- BiRefNet_HR - 220M, 45,093 downloads/month
- BiRefNet_HR-matting - 220M, 43,923 downloads/month
- BiRefNet_dynamic - 220M, 31,656 downloads/month
PopularityLink to this section
BiRefNet-matting was downloaded 38,269 times on Hugging Face in the last month (610,038 all-time) and has 32 likes.
Run it locallyLink to this section
Weights and usage instructions are on the ZhengPeng7/BiRefNet-matting model card; it loads with birefnet.
Local runtimes that fit this model:
- comfyui - node-based workflows, the usual way to run diffusion models locally
- invokeai - a canvas UI for image generation and editing
PaperLink to this section
From the community
What users are saying
“很高兴看到你的认可. 这个BiRefNet-matting之前确实没添加, 刚转换上传好了. 所有的ONNX应该都可以在[GitHub Release](https://github.com/ZhengPeng7/BiRefNet/releases)和[Google Drive](https://drive.google.com/drive/u/0/folders/1kZM55bwsRdSbdnsXpkmH6QPyza-9-N)里找到.”
“It's trained in 1024x1024, which is the default setting if not specified :) But it can be executed with any resolution in times of 32.”
Frequently asked
Quick answers to common questions
How much VRAM does BiRefNet-matting need?
BiRefNet-matting with 220M parameters needs approximately 1 GB at Q4_K_M quantization. Use our VRAM calculator for an exact estimate.
Is BiRefNet-matting better than other ZhengPeng7 models?
BiRefNet-matting has 220M parameters - a strong choice for image-segmentation.
What license is BiRefNet-matting under?
BiRefNet-matting is released under the mit license, making it suitable for most commercial and personal projects.
What hardware runs BiRefNet-matting well?
With 220M parameters, BiRefNet-matting is small enough for most consumer GPUs, Apple Silicon Macs, and many CPUs. Check our hardware directory for specific recommendations.
What is the best quantization for BiRefNet-matting?
Q4_K_M is the recommended sweet spot - ~98% of FP16 quality at ~27% of the size. Q5_K_M (~1 GB) is an option if you have spare VRAM. Use our VRAM calculator to compare.
What models compete with BiRefNet-matting?
BiRefNet-matting competes with other models in its class. Browse our model directory for comparisons, benchmarks, and community reviews to find the best fit.
Nearby options
Similar models and compatible hardware by spec