Image Segmentation
Transformers
PyTorch
ONNX
Safetensors
Transformers.js
SegformerForSemanticSegmentation
remove background
background
background-removal
Pytorch
vision
legal liability
custom_code
Instructions to use briaai/RMBG-1.4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use briaai/RMBG-1.4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="briaai/RMBG-1.4", trust_remote_code=True)# Load model directly from transformers import AutoModelForImageSegmentation model = AutoModelForImageSegmentation.from_pretrained("briaai/RMBG-1.4", trust_remote_code=True, dtype="auto") - Transformers.js
How to use briaai/RMBG-1.4 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-segmentation', 'briaai/RMBG-1.4'); - Notebooks
- Google Colab
- Kaggle
The model is now added to WebAI.js. Run it in your browser with no code required.
#55
by AxolsWebAI - opened
Hi there,
We've packaged this model inside our open-source library WebAI.js, so you can now integrate it into your project easily with just a few lines of code, letting you run it directly in the browser βno backend hosting required:
import { WebAI } from '@axols/webai-js';
const webai = await WebAI.create({
modelId: "rmbg-briaai-1.4"
});
await webai.init({
mode: "webai",
precision: "q4",
device: "webgpu"
});
Reset
Edit
const generation = await webai.generate({
userInput: {
image_blob_url: "blob:https://www.webai-js.com/3f06e94a-f0c4-436d-9671-dad0183bc0a2"
},
modelConfig: {},
generateConfig: {
confidence_threshold: 0.5
}
});
π¬ Try Gemma Embedding Instantly (No Code Required)
You can benchmark and test the model directly here:
https://www.webai-js.com/models/rmbg-briaai-1.4/playground
π Full API Reference
Detailed parameter explanations can be found here:
https://www.webai-js.com/models/rmbg-briaai-1.4/api-reference/v1/class-api/methods/webai-generate
π§‘ Fully Open Source
WebAI.js is completely open source and free to use.
Star or contribute on GitHub:
https://github.com/axolsai/webai-js
Thanks

