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
No module named 'transformers_modules.RMBG-2'
i put models in ComfyUI/models/BiRefNet/RMBG-2.0, and this massage pop up,
anyone same issue? can fix it? thanks!
File "importlib_init_.py", line 126, in import_module
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1126, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1126, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'transformers_modules.RMBG-2'
@Jason9301 can you explain what are you trying to do?
hi, OriLib, i want to use this plugin "RMBG" to remove background,
when i run comfyui use this workflow, POP up bug message "No module named transformers_modules.RMBG-2"
@Jason9301 i tested it and it works. make sure your transformers module is updated.
it worked when i update Comfyui, but i must update it every time before i open comfyui, It's a bit troublesome, but it seems to be the only way for now, Thanks
@Jason9301 i tested it and it works. make sure your transformers module is updated.
it worked when i update Comfyui, but i must update it every time before i open comfyui, It's a bit troublesome, but it seems to be the only way for now, Thanks
Which version of Transformers do I need to upgrade to in order to use it? My global version is the latest, but it still doesn't work.
I have the same problem, comfyui and transformers have been updated to the latest version, but still prompt 'No module named' transformers_modules' RMBG-2'
I have the same problem, comfyui and transformers have been updated to the latest version, but still prompt 'No module named' transformers_modules' RMBG-2'
@me5kong I downloaded other components, copied them in, and it worked successfully: comfyUI\models\BiRefNet\RMBG-2.0.
