A ComfyUI custom node designed for advanced image background removal and object, face, clothes, and fashion segmentation, utilizing multiple models including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, SDMatte, SAM, SAM2, SAM3 and GroundingDINO.
2,105
stars
423
commits
Python
primary language
Aug 21, 2026
updated
A sophisticated ComfyUI custom node engineered for advanced image background removal and precise segmentation of objects, faces, clothing, and fashion elements. This tool leverages a diverse array of models, including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, Lucida, SDMatte models, SAM, SAM2 and GroundingDINO, while also incorporating a new feature for real-time background replacement and enhanced edge detection for improved accuracy.
2026/07/21: Update ComfyUI-RMBG to v3.1.0 ( update.md )
Lucida model to BiRefNet node — BiRefNet fine-tune for transparent objects, camouflage, text/logos, glow/VFX, and illustrations)sensitivity parameter to BiRefNet node2026/01/01: Update ComfyUI-RMBG to v3.0.0 ( update.md )

2025/12/09: Update ComfyUI-RMBG to v2.9.6 ( update.md )
2025/11/25: Update ComfyUI-RMBG to v2.9.5 SAM3 Segmentaion bug fixed( update.md )
2025/11/24: Update ComfyUI-RMBG to v2.9.4 SAM3 Segmentaion ( update.md )
2025/10/05: Update ComfyUI-RMBG to v2.9.3 ( update.md )
2025/09/30: Update ComfyUI-RMBG to v2.9.2 ( update.md )
Add new BiRefNet_toonOut Model
Updated Imagestitch
2025/09/12: Update ComfyUI-RMBG to v2.9.1 ( update.md )
2025/08/18: Update ComfyUI-RMBG to v2.9.0 ( update.md )
SDMatte Matting node2025/08/11: Update ComfyUI-RMBG to v2.8.0 ( update.md )
SAM2Segment node for text-prompted segmentation with the latest Facebook Research SAM2 technology.2025/08/06: Update ComfyUI-RMBG to v2.7.1 ( update.md )
2025/07/15: Update ComfyUI-RMBG to v2.6.0 ( update.md )
Added Kontext Refence latent Mask node, Which uses a reference latent and mask for precise region conditioning.
2025/07/11: Update ComfyUI-RMBG to v2.5.2 ( update.md )
2025/07/07: Update ComfyUI-RMBG to v2.5.1 ( update.md )
2025/07/01: Update ComfyUI-RMBG to v2.5.0 ( update.md )
Added MaskOverlay, ObjectRemover, ImageMaskResize new nodes.
Added 2 BiRefNet models: BiRefNet_lite-matting and BiRefNet_dynamic
Added batch image support for Segment_v1 and Segment_V2 nodes
2025/06/01: Update ComfyUI-RMBG to v2.4.0 ( update.md )
CropObject, ImageCompare, ColorInput nodes and new Segment V2 (see update.md for details)2025/05/15: Update ComfyUI-RMBG to v2.3.2 ( update.md )
2025/05/02: Update ComfyUI-RMBG to v2.3.1 ( update.md )
2025/05/01: Update ComfyUI-RMBG to v2.3.0 ( update.md )
2025/04/05: Update ComfyUI-RMBG to v2.2.1 ( update.md )
2025/04/05: Update ComfyUI-RMBG to v2.2.0 ( update.md )
2025/03/21: Update ComfyUI-RMBG to v2.1.1 ( update.md )
2025/03/19: Update ComfyUI-RMBG to v2.1.0 ( update.md )
https://github.com/user-attachments/assets/7faa00d3-bbe2-42b8-95ed-2c830a1ff04f
2025/03/13: Update ComfyUI-RMBG to v2.0.0 ( update.md )
🧪AILab/🛠️UTIL/🖼️IMAGE.2025/02/24: Update ComfyUI-RMBG to v1.9.3 Clean up the code and fix the issue ( update.md )
2025/02/21: Update ComfyUI-RMBG to v1.9.2 with Fast Foreground Color Estimation ( update.md )
2025/02/20: Update ComfyUI-RMBG to v1.9.1 ( update.md )
2025/02/19: Update ComfyUI-RMBG to v1.9.0 with BiRefNet model improvements ( update.md )
2025/02/07: Update ComfyUI-RMBG to v1.8.0 with new BiRefNet-HR model ( update.md )
2025/02/04: Update ComfyUI-RMBG to v1.7.0 with new BEN2 model ( update.md )
2025/01/22: Update ComfyUI-RMBG to v1.6.0 with new Face Segment custom node ( update.md )
2025/01/05: Update ComfyUI-RMBG to v1.5.0 with new Fashion and accessories Segment custom node ( update.md )
2025/01/02: Update ComfyUI-RMBG to v1.4.0 with new Clothes Segment node ( update.md )
2024/12/29: Update ComfyUI-RMBG to v1.3.2 with background handling ( update.md )
2024/12/25: Update ComfyUI-RMBG to v1.3.1 with bug fixes ( update.md )
2024/12/23: Update ComfyUI-RMBG to v1.3.0 with new Segment node ( update.md )
2024/12/12: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.2 ( update.md )
2024/12/02: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.1 ( update.md )
2024/11/29: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.0 ( update.md )
2024/11/21: Update Comfyui-RMBG ComfyUI Custom Node to v1.1.0 ( update.md )
Background Removal (RMBG Node)
Object Segmentation (Segment Node)
SAM2 Segmentation
Comfyui-RMBG and installinstall requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
[!NOTE] Windows desktop app: if the app crashes after install, set
PYTHONUTF8=1before installing requirements, then retry.
[!NOTE] YOLO nodes require the optional
ultralyticspackage. Install it only if you need YOLO to avoid dependency conflicts:./ComfyUI/python_embeded/python -m pip install ultralytics --no-deps.
[!TIP] Note: If your environment cannot install dependencies with the system Python, you can use ComfyUI's embedded Python instead. Example (embedded Python):
./ComfyUI/python_embeded/python.exe -m pip install --no-user --no-cache-dir -r requirements.txt
cd ComfyUI/custom_nodes
git clone https://github.com/1038lab/ComfyUI-RMBG
install requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
Ensure pip install comfy-cli is installed.
Installing ComfyUI comfy install (if you don't have ComfyUI Installed)
install the ComfyUI-RMBG, use the following command:
comfy node install ComfyUI-RMBG
install requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
ComfyUI/models/RMBG/ when first time using the custom node./ComfyUI/models/RMBG/RMBG-2.0 folder./ComfyUI/models/RMBG/INSPYRENET folder./ComfyUI/models/RMBG/BEN folder./ComfyUI/models/RMBG/BEN2 folder./ComfyUI/models/RMBG/BiRefNet-HR folder./ComfyUI/models/SAM folder.sam2.1_hiera_tiny.safetensors, sam2.1_hiera_small.safetensors, sam2.1_hiera_base_plus.safetensors, sam2.1_hiera_large.safetensors) and place them in the /ComfyUI/models/sam2 folder./ComfyUI/models/grounding-dino folder./ComfyUI/models/RMBG/segformer_clothes folder./ComfyUI/models/RMBG/segformer_fashion folder./ComfyUI/models/RMBG/BiRefNet folder./ComfyUI/models/RMBG/SDMatte folder.| Optional Settings | :memo: Description | :bulb: Tips |
|---|---|---|
| Sensitivity | Adjusts the strength of mask detection. Higher values result in stricter detection. | Default value is 0.5. Adjust based on image complexity; more complex images may require higher sensitivity. |
| Processing Resolution | Controls the processing resolution of the input image, affecting detail and memory usage. | Choose a value between 256 and 2048, with a default of 1024. Higher resolutions provide better detail but increase memory consumption. |
| Mask Blur | Controls the amount of blur applied to the mask edges, reducing jaggedness. | Default value is 0. Try setting it between 1 and 5 for smoother edge effects. |
| Mask Offset | Allows for expanding or shrinking the mask boundary. Positive values expand the boundary, while negative values shrink it. | Default value is 0. Adjust based on the specific image, typically fine-tuning between -10 and 10. |
| Background | Choose output background color | Alpha (transparent background) Black, White, Green, Blue, Red |
| Invert Output | Flip mask and image output | Invert both image and mask output |
| Refine Foreground | Use Fast Foreground Color Estimation to optimize transparent background | Enable for better edge quality and transparency handling |
| Performance Optimization | Properly setting options can enhance performance when processing multiple images. | If memory allows, consider increasing process_res and mask_blur values for better results, but be mindful of memory usage. |
RMBG (Remove Background) node from the 🧪AILab/🧽RMBG categorysensitivity: Controls the background removal sensitivity (0.0-1.0)process_res: Processing resolution (512-2048, step 128)mask_blur: Blur amount for the mask (0-64)mask_offset: Adjust mask edges (-20 to 20)background: Choose output background colorinvert_output: Flip mask and image outputoptimize: Toggle model optimizationSegment (RMBG) node from the 🧪AILab/🧽RMBG categoryRMBG-2.0 is is developed by BRIA AI and uses the BiRefNet architecture which includes:
INSPYRENET is specialized in human portrait segmentation, offering:
BEN is robust on various image types, offering:
BEN2 is a more advanced version of BEN, offering:
BIREFNET is a powerful model for image segmentation, offering:
Lucida is a BiRefNet fine-tune by egeorcun (MIT License), optimized for cases where general-purpose background removers fall apart:
SAM is a powerful model for object detection and segmentation, offering:
SAM2 is the latest segmentation model family designed for efficient, high-quality text-prompted segmentation:
ComfyUI/models/sam2GroundingDINO is a model for text-prompted object detection and segmentation, offering:
models/RMBG/SDMatte/models/RMBG/SDMatte/SDMatte.safetensors (standard) or SDMatte_plus.safetensors (plus)models/RMBG/SDMatte/ (scheduler/, text_encoder/, tokenizer/, unet/, vae/)models/sam2:
%USERPROFILE%\.cache\huggingface\token (and %USERPROFILE%\.huggingface\token if present)HF_TOKEN/HUGGINGFACE_TOKEN env vars are setRMBG-2.0: https://huggingface.co/briaai/RMBG-2.0
INSPYRENET: https://github.com/plemeri/InSPyReNet
BiRefNet: https://huggingface.co/ZhengPeng7
GroundingDINO: https://github.com/IDEA-Research/GroundingDINO
Clothes Segment: https://huggingface.co/mattmdjaga/segformer_b2_clothes
Created by: AILab
If this custom node helps you or you like my work, please give me ⭐ on this repo! It's a great encouragement for my efforts!
GPL-3.0 License
Python
99.7%
A ComfyUI custom node designed for advanced image background removal and object, face, clothes, and fashion segmentation, utilizing multiple models including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, SDMatte, SAM, SAM2, SAM3 and GroundingDINO.
2,105
stars
423
commits
Python
primary language
Aug 21, 2026
updated
A sophisticated ComfyUI custom node engineered for advanced image background removal and precise segmentation of objects, faces, clothing, and fashion elements. This tool leverages a diverse array of models, including RMBG-2.0, INSPYRENET, BEN, BEN2, BiRefNet, Lucida, SDMatte models, SAM, SAM2 and GroundingDINO, while also incorporating a new feature for real-time background replacement and enhanced edge detection for improved accuracy.
2026/07/21: Update ComfyUI-RMBG to v3.1.0 ( update.md )
Lucida model to BiRefNet node — BiRefNet fine-tune for transparent objects, camouflage, text/logos, glow/VFX, and illustrations)sensitivity parameter to BiRefNet node2026/01/01: Update ComfyUI-RMBG to v3.0.0 ( update.md )

2025/12/09: Update ComfyUI-RMBG to v2.9.6 ( update.md )
2025/11/25: Update ComfyUI-RMBG to v2.9.5 SAM3 Segmentaion bug fixed( update.md )
2025/11/24: Update ComfyUI-RMBG to v2.9.4 SAM3 Segmentaion ( update.md )
2025/10/05: Update ComfyUI-RMBG to v2.9.3 ( update.md )
2025/09/30: Update ComfyUI-RMBG to v2.9.2 ( update.md )
Add new BiRefNet_toonOut Model
Updated Imagestitch
2025/09/12: Update ComfyUI-RMBG to v2.9.1 ( update.md )
2025/08/18: Update ComfyUI-RMBG to v2.9.0 ( update.md )
SDMatte Matting node2025/08/11: Update ComfyUI-RMBG to v2.8.0 ( update.md )
SAM2Segment node for text-prompted segmentation with the latest Facebook Research SAM2 technology.2025/08/06: Update ComfyUI-RMBG to v2.7.1 ( update.md )
2025/07/15: Update ComfyUI-RMBG to v2.6.0 ( update.md )
Added Kontext Refence latent Mask node, Which uses a reference latent and mask for precise region conditioning.
2025/07/11: Update ComfyUI-RMBG to v2.5.2 ( update.md )
2025/07/07: Update ComfyUI-RMBG to v2.5.1 ( update.md )
2025/07/01: Update ComfyUI-RMBG to v2.5.0 ( update.md )
Added MaskOverlay, ObjectRemover, ImageMaskResize new nodes.
Added 2 BiRefNet models: BiRefNet_lite-matting and BiRefNet_dynamic
Added batch image support for Segment_v1 and Segment_V2 nodes
2025/06/01: Update ComfyUI-RMBG to v2.4.0 ( update.md )
CropObject, ImageCompare, ColorInput nodes and new Segment V2 (see update.md for details)2025/05/15: Update ComfyUI-RMBG to v2.3.2 ( update.md )
2025/05/02: Update ComfyUI-RMBG to v2.3.1 ( update.md )
2025/05/01: Update ComfyUI-RMBG to v2.3.0 ( update.md )
2025/04/05: Update ComfyUI-RMBG to v2.2.1 ( update.md )
2025/04/05: Update ComfyUI-RMBG to v2.2.0 ( update.md )
2025/03/21: Update ComfyUI-RMBG to v2.1.1 ( update.md )
2025/03/19: Update ComfyUI-RMBG to v2.1.0 ( update.md )
https://github.com/user-attachments/assets/7faa00d3-bbe2-42b8-95ed-2c830a1ff04f
2025/03/13: Update ComfyUI-RMBG to v2.0.0 ( update.md )
🧪AILab/🛠️UTIL/🖼️IMAGE.2025/02/24: Update ComfyUI-RMBG to v1.9.3 Clean up the code and fix the issue ( update.md )
2025/02/21: Update ComfyUI-RMBG to v1.9.2 with Fast Foreground Color Estimation ( update.md )
2025/02/20: Update ComfyUI-RMBG to v1.9.1 ( update.md )
2025/02/19: Update ComfyUI-RMBG to v1.9.0 with BiRefNet model improvements ( update.md )
2025/02/07: Update ComfyUI-RMBG to v1.8.0 with new BiRefNet-HR model ( update.md )
2025/02/04: Update ComfyUI-RMBG to v1.7.0 with new BEN2 model ( update.md )
2025/01/22: Update ComfyUI-RMBG to v1.6.0 with new Face Segment custom node ( update.md )
2025/01/05: Update ComfyUI-RMBG to v1.5.0 with new Fashion and accessories Segment custom node ( update.md )
2025/01/02: Update ComfyUI-RMBG to v1.4.0 with new Clothes Segment node ( update.md )
2024/12/29: Update ComfyUI-RMBG to v1.3.2 with background handling ( update.md )
2024/12/25: Update ComfyUI-RMBG to v1.3.1 with bug fixes ( update.md )
2024/12/23: Update ComfyUI-RMBG to v1.3.0 with new Segment node ( update.md )
2024/12/12: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.2 ( update.md )
2024/12/02: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.1 ( update.md )
2024/11/29: Update Comfyui-RMBG ComfyUI Custom Node to v1.2.0 ( update.md )
2024/11/21: Update Comfyui-RMBG ComfyUI Custom Node to v1.1.0 ( update.md )
Background Removal (RMBG Node)
Object Segmentation (Segment Node)
SAM2 Segmentation
Comfyui-RMBG and installinstall requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
[!NOTE] Windows desktop app: if the app crashes after install, set
PYTHONUTF8=1before installing requirements, then retry.
[!NOTE] YOLO nodes require the optional
ultralyticspackage. Install it only if you need YOLO to avoid dependency conflicts:./ComfyUI/python_embeded/python -m pip install ultralytics --no-deps.
[!TIP] Note: If your environment cannot install dependencies with the system Python, you can use ComfyUI's embedded Python instead. Example (embedded Python):
./ComfyUI/python_embeded/python.exe -m pip install --no-user --no-cache-dir -r requirements.txt
cd ComfyUI/custom_nodes
git clone https://github.com/1038lab/ComfyUI-RMBG
install requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
Ensure pip install comfy-cli is installed.
Installing ComfyUI comfy install (if you don't have ComfyUI Installed)
install the ComfyUI-RMBG, use the following command:
comfy node install ComfyUI-RMBG
install requirment.txt in the ComfyUI-RMBG folder
./ComfyUI/python_embeded/python -m pip install -r requirements.txt
ComfyUI/models/RMBG/ when first time using the custom node./ComfyUI/models/RMBG/RMBG-2.0 folder./ComfyUI/models/RMBG/INSPYRENET folder./ComfyUI/models/RMBG/BEN folder./ComfyUI/models/RMBG/BEN2 folder./ComfyUI/models/RMBG/BiRefNet-HR folder./ComfyUI/models/SAM folder.sam2.1_hiera_tiny.safetensors, sam2.1_hiera_small.safetensors, sam2.1_hiera_base_plus.safetensors, sam2.1_hiera_large.safetensors) and place them in the /ComfyUI/models/sam2 folder./ComfyUI/models/grounding-dino folder./ComfyUI/models/RMBG/segformer_clothes folder./ComfyUI/models/RMBG/segformer_fashion folder./ComfyUI/models/RMBG/BiRefNet folder./ComfyUI/models/RMBG/SDMatte folder.| Optional Settings | :memo: Description | :bulb: Tips |
|---|---|---|
| Sensitivity | Adjusts the strength of mask detection. Higher values result in stricter detection. | Default value is 0.5. Adjust based on image complexity; more complex images may require higher sensitivity. |
| Processing Resolution | Controls the processing resolution of the input image, affecting detail and memory usage. | Choose a value between 256 and 2048, with a default of 1024. Higher resolutions provide better detail but increase memory consumption. |
| Mask Blur | Controls the amount of blur applied to the mask edges, reducing jaggedness. | Default value is 0. Try setting it between 1 and 5 for smoother edge effects. |
| Mask Offset | Allows for expanding or shrinking the mask boundary. Positive values expand the boundary, while negative values shrink it. | Default value is 0. Adjust based on the specific image, typically fine-tuning between -10 and 10. |
| Background | Choose output background color | Alpha (transparent background) Black, White, Green, Blue, Red |
| Invert Output | Flip mask and image output | Invert both image and mask output |
| Refine Foreground | Use Fast Foreground Color Estimation to optimize transparent background | Enable for better edge quality and transparency handling |
| Performance Optimization | Properly setting options can enhance performance when processing multiple images. | If memory allows, consider increasing process_res and mask_blur values for better results, but be mindful of memory usage. |
RMBG (Remove Background) node from the 🧪AILab/🧽RMBG categorysensitivity: Controls the background removal sensitivity (0.0-1.0)process_res: Processing resolution (512-2048, step 128)mask_blur: Blur amount for the mask (0-64)mask_offset: Adjust mask edges (-20 to 20)background: Choose output background colorinvert_output: Flip mask and image outputoptimize: Toggle model optimizationSegment (RMBG) node from the 🧪AILab/🧽RMBG categoryRMBG-2.0 is is developed by BRIA AI and uses the BiRefNet architecture which includes:
INSPYRENET is specialized in human portrait segmentation, offering:
BEN is robust on various image types, offering:
BEN2 is a more advanced version of BEN, offering:
BIREFNET is a powerful model for image segmentation, offering:
Lucida is a BiRefNet fine-tune by egeorcun (MIT License), optimized for cases where general-purpose background removers fall apart:
SAM is a powerful model for object detection and segmentation, offering:
SAM2 is the latest segmentation model family designed for efficient, high-quality text-prompted segmentation:
ComfyUI/models/sam2GroundingDINO is a model for text-prompted object detection and segmentation, offering:
models/RMBG/SDMatte/models/RMBG/SDMatte/SDMatte.safetensors (standard) or SDMatte_plus.safetensors (plus)models/RMBG/SDMatte/ (scheduler/, text_encoder/, tokenizer/, unet/, vae/)models/sam2:
%USERPROFILE%\.cache\huggingface\token (and %USERPROFILE%\.huggingface\token if present)HF_TOKEN/HUGGINGFACE_TOKEN env vars are setRMBG-2.0: https://huggingface.co/briaai/RMBG-2.0
INSPYRENET: https://github.com/plemeri/InSPyReNet
BiRefNet: https://huggingface.co/ZhengPeng7
GroundingDINO: https://github.com/IDEA-Research/GroundingDINO
Clothes Segment: https://huggingface.co/mattmdjaga/segformer_b2_clothes
Created by: AILab
If this custom node helps you or you like my work, please give me ⭐ on this repo! It's a great encouragement for my efforts!
GPL-3.0 License
Python
99.7%