🚀 BRIA Background Removal v2.0 Model Card
BRIA Background Removal v2.0 is a state - of - the - art image segmentation model that effectively separates foreground from background, suitable for various commercial and non - commercial use cases.
🚀 Quick Start
RMBG v2.0 is our new state - of - the - art background removal model that significantly improves upon RMBG v1.4. It's designed to effectively separate the foreground from the background across a wide range of categories and image types. Trained on a carefully selected dataset including general stock images, e - commerce, gaming, and advertising content, it's suitable for commercial use cases in large - scale enterprise content creation.
The model's accuracy, efficiency, and versatility currently rival leading source - available models. It's ideal for scenarios where content safety, legally licensed datasets, and bias mitigation are crucial.
Developed by BRIA AI, RMBG v2.0 is available as a source - available model for non - commercial use.
Get Access
Bria RMBG2.0 can be accessed in multiple ways, whether as source - code and weights, ComfyUI nodes, or API endpoints.
- Purchase: For a commercial license, simply click Here.
- API Endpoint: [Bria.ai](https://platform.bria.ai/console/api/image - editing), [fal.ai](https://fal.ai/models/fal - ai/bria/background/remove)
- ComfyUI: [Use it in workflows](https://github.com/Bria - AI/ComfyUI - BRIA - API)
For more information, please visit our website.
Join our Discord community for more information, tutorials, tools, and to connect with other users!
[CLICK HERE FOR A DEMO](https://huggingface.co/spaces/briaai/BRIA - RMBG - 2.0)

✨ Features
- High - performance: Significantly improves upon the previous version, with accuracy, efficiency, and versatility that rival leading models.
- Versatile: Trained on a diverse dataset, suitable for various commercial and non - commercial use cases.
- Legal compliance: Uses legally licensed datasets, ideal for scenarios where legal compliance is important.
📦 Installation
The text does not provide specific installation steps, so this section is skipped.
💻 Usage Examples
Basic Usage
from PIL import Image
import matplotlib.pyplot as plt
import torch
from torchvision import transforms
from transformers import AutoModelForImageSegmentation
model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True)
torch.set_float32_matmul_precision(['high', 'highest'][0])
model.to('cuda')
model.eval()
image_size = (1024, 1024)
transform_image = transforms.Compose([
transforms.Resize(image_size),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
image = Image.open(input_image_path)
input_images = transform_image(image).unsqueeze(0).to('cuda')
with torch.no_grad():
preds = model(input_images)[-1].sigmoid().cpu()
pred = preds[0].squeeze()
pred_pil = transforms.ToPILImage()(pred)
mask = pred_pil.resize(image.size)
image.putalpha(mask)
image.save("no_bg_image.png")
📚 Documentation
Model Details
Model Description
Property |
Details |
Developed by |
BRIA AI |
Model Type |
Background Removal |
License |
[Creative Commons Attribution–Non - Commercial (CC BY - NC 4.0)](https://creativecommons.org/licenses/by - nc/4.0/deed.en). The model is released under a CC BY - NC 4.0 license for non - commercial use. Commercial use is subject to a commercial agreement with BRIA. Available [here](https://share - eu1.hsforms.com/2sj9FVZTGSFmFRibDLhr_ZAf4e04?utm_campaign=RMBG%202.0&utm_source=Hugging%20face&utm_medium=hyperlink&utm_content=RMBG%20Hugging%20Face%20purchase%20form) |
Model Description |
BRIA RMBG - 2.0 is a dichotomous image segmentation model trained exclusively on a professional - grade dataset. |
BRIA |
Resources for more information: BRIA AI |
Training data
The Bria - RMBG model was trained with over 15,000 high - quality, high - resolution, manually labeled (pixel - wise accuracy), fully licensed images. The benchmark included balanced gender, balanced ethnicity, and people with different types of disabilities.
Distribution of images
Category |
Distribution |
Objects only |
45.11% |
People with objects/animals |
25.24% |
People only |
17.35% |
people/objects/animals with text |
8.52% |
Text only |
2.52% |
Animals only |
1.89% |
Category |
Distribution |
Photorealistic |
87.70% |
Non - Photorealistic |
12.30% |
Category |
Distribution |
Non Solid Background |
52.05% |
Solid Background |
47.95% |
Category |
Distribution |
Single main foreground object |
51.42% |
Multiple objects in the foreground |
48.58% |
Qualitative Evaluation
Open source models comparison

Architecture
RMBG - 2.0 is developed on the BiRefNet architecture enhanced with our proprietary dataset and training scheme. This training data significantly improves the model’s accuracy and effectiveness for the background - removal task.
If you use this model in your research, please cite:
@article{BiRefNet,
title={Bilateral Reference for High - Resolution Dichotomous Image Segmentation},
author={Zheng, Peng and Gao, Dehong and Fan, Deng - Ping and Liu, Li and Laaksonen, Jorma and Ouyang, Wanli and Sebe, Nicu},
journal={CAAI Artificial Intelligence Research},
year={2024}
}
Requirements
torch
torchvision
pillow
kornia
transformers
🔧 Technical Details
RMBG - 2.0 is based on the BiRefNet architecture. The use of a carefully selected and diverse training dataset, along with a proprietary training scheme, enhances the model's performance in background - removal tasks. The model is trained to handle various image types and categories, ensuring high accuracy and efficiency.
📄 License
The model is released under the [Creative Commons Attribution–Non - Commercial (CC BY - NC 4.0)](https://creativecommons.org/licenses/by - nc/4.0/deed.en) license for non - commercial use. For commercial use, a commercial agreement with BRIA is required. You can purchase a commercial license here.