Instructions to use briaai/RMBG-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use briaai/RMBG-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="briaai/RMBG-2.0", trust_remote_code=True)# Load model directly from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-2.0", trust_remote_code=True, dtype="auto") - Transformers.js
How to use briaai/RMBG-2.0 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'briaai/RMBG-2.0'); - Inference
- Notebooks
- Google Colab
- Kaggle
RMBG-2.0 new API Sandbox!!
Hey everyone π
We just launched the ** RMBG-2.0 API Sandbox ** β a new way to test our background removal API directly in your browser, no setup required.
What just launched
The sandbox is a live, interactive playground for the RMBG-2.0 API. You can:
- Upload any image and see background removal results instantly
- Get the exact API call β copy the request and drop it into your codebase
- No signup required to try it β just open the link and upload
** β Open the Sandbox **
Why we built this
RMBG has been downloaded over 5 million times across 1.4 and 2.0. We kept hearing the same thing from developers shipping to production: "The model is great, but I need a managed endpoint β I don't want to provision GPUs and manage inference infrastructure."
The sandbox is the front door to that. Test the quality, grab the API call, get a token, and you're in production.
Nothing changes for open-source users
The HuggingFace weights, the code, the Spaces demo β all still here, still free for non-commercial use. This is an addition, not a replacement.
** β Try the new sandbox **