Enhanced compatibility with Transformers
- Added support for higher versions of the transformers library (≥ 4.49.0)
- Resolved conflicts with other models requiring higher version transformers
- Improved error handling and more user-friendly error messages
- If you encounter issues, you can still revert to the recommended version:
pip install transformers==4.48.3
Transformers Version Compatibility
The integration of internationalization (i18n
) support significantly enhances ComfyUI-RMBG, enabling users worldwide to utilize background removal features in their preferred languages. This update fosters a more tailored and efficient workflow within ComfyUI-RMBG. The user interface has been improved to facilitate dynamic language switching according to user preferences. All newly introduced features are designed to be fully translatable, thereby improving accessibility for users who do not speak English.
Language | Custom Nodes i18n UI |
---|---|
English | ![]() |
中文 | ![]() |
日本語 | ![]() |
Русский | ![]() |
한국어 | ![]() |
Français | ![]() |
- Added Load Image, Preview Image, Preview Mask, and a node that previews both the image and the mask simultaneously. This is the first phase of our toolset, with more useful tools coming in future updates.
- Reorganized the code structure for better maintainability, making it easier to navigate and update.
- Renamed certain node classes to prevent conflicts with other repositories.
- Improved category organization with a new structure: 🧪AILab/🛠️UTIL/🖼️IMAGE, making tools easier to find and use.
- Integrated predefined workflows into the ComfyUI Browse Template section, allowing users to quickly load and understand each custom node’s functionality.
- Optimized utility functions for image and mask conversion
- Improved error handling and code robustness
- Updated and changed some variable names for consistency
- Enhanced compatibility with the latest ComfyUI versions
- Clean up the code and fix the transformers version issue
transformers>=4.35.0,<=4.48.3
- Added Fast Foreground Color Estimation feature
- New
refine_foreground
option for optimizing transparent backgrounds - Improved edge quality and detail preservation
- Better handling of semi-transparent regions
- New
- Added OpenCV dependency for advanced image processing
- Enhanced foreground refinement algorithm
- Optimized memory usage for large images
- Improved edge detection accuracy
- Changed repository for model management to the new repository
- Reorganized models files structure for better maintainability
Add and group all BiRefNet models collections into BiRefNet node.
- Added
BiRefNet
general purpose model (balanced performance) - Added
BiRefNet_512x512
model (optimized for 512x512 resolution) - Added
BiRefNet-portrait
model (optimized for portrait/human matting) - Added
BiRefNet-matting
model (general purpose matting) - Added
BiRefNet-HR model
(high resolution up to 2560x2560) - Added
BiRefNet-HR-matting
model (high resolution matting) - Added
BiRefNet_lite
model (lightweight version for faster processing) - Added
BiRefNet_lite-2K
model (lightweight version for 2K resolution)
- Added FP16 (half-precision) support for better performance
- Optimized for high-resolution image processing
- Enhanced memory efficiency
- Maintained compatibility with existing workflows
- Simplified model loading through Transformers pipeline
** (To ensure compatibility with the old V1.8.0 workflow, we have replaced this image with the new BiRefNet Node) (2025/03/01)
- Added support for BiRefNet High Resolution model
- Trained with 2048x2048 resolution images
- Superior performance metrics (maxFm: 0.925, MAE: 0.026)
- Better edge detection and detail preservation
- FP16 optimization for faster processing
- MIT License for commercial use
** (To ensure compatibility with the old V1.8.0 workflow, we have replaced this image with the new BiRefNet Node) (2025/03/01)
- Added FP16 (half-precision) support for better performance
- Optimized for high-resolution image processing
- Enhanced memory efficiency
- Maintained compatibility with existing workflows
- Simplified model loading through Transformers pipeline
- BiRefNet-HR vs other models:
- Higher resolution support (up to 2048x2048)
- Better edge detection accuracy
- Improved detail preservation
- Optimized for high-resolution images
- More efficient memory usage with FP16 support
- Added support for BEN2 (Background Elimination Network 2)
- Improved performance over original BEN model
- Better edge detection and detail preservation
- Enhanced batch processing capabilities (up to 3 images per batch)
- Optimized memory usage and processing speed
- Updated model repository paths for BEN and BEN2
- Switched to 1038lab repositories for better maintenance and updates
- Maintained full compatibility with existing workflows
- Implemented efficient batch processing for BEN2
- Optimized memory management for large batches
- Enhanced error handling and model loading
- Improved model switching and resource cleanup
- BEN2 vs BEN:
- Better edge detection
- Improved handling of complex backgrounds
- More efficient batch processing
- Enhanced detail preservation
- Faster processing speed
- Added a new custom node for face parsing and segmentation
- Support for 19 facial feature categories (Skin, Nose, Eyes, Eyebrows, etc.)
- Precise facial feature extraction and segmentation
- Multiple feature selection for combined segmentation
- Same parameter controls as other RMBG nodes
- Automatic model downloading and resource management
- Perfect for portrait editing and facial feature manipulation
- Added a new custom node for fashion and accessories segmentation.
- Capable of identifying and segmenting various fashion items such as dresses, shoes, and accessories.
- Utilizes advanced machine learning techniques for accurate segmentation.
- Supports real-time processing for enhanced user experience.
- Ideal for fashion-related applications, including virtual try-ons and outfit recommendations.
- Support for gray background color.
- Added intelligent clothes segmentation functionality
- Support for 18 different clothing categories (Hat, Hair, Face, Sunglasses, Upper-clothes, etc.)
- Multiple item selection for combined segmentation
- Same parameter controls as other RMBG nodes (process_res, mask_blur, mask_offset, background options)
- Automatic model downloading and resource management
- Enhanced background handling to support RGBA output when "Alpha" is selected.
- Ensured RGB output for all other background color selections.
- Fixed an issue with mask processing when the model returns a list of masks.
- Improved handling of image formats to prevent processing errors.
- Text-Prompted Intelligent Object Segmentation
- Use natural language prompts (e.g., "a cat", "red car") to identify and segment target objects
- Support for multiple object detection and segmentation
- Perfect for precise object extraction and recognition tasks
- SAM (Segment Anything Model)
- sam_vit_h: 2.56GB - Highest accuracy
- sam_vit_l: 1.25GB - Balanced performance
- sam_vit_b: 375MB - Lightweight option
- GroundingDINO
- SwinT: 694MB - Fast and efficient
- SwinB: 938MB - Higher precision
- Intuitive Parameter Controls
- Threshold: Adjust detection precision
- Mask Blur: Smooth edges
- Mask Offset: Expand or shrink selection
- Background Options: Alpha/Black/White/Green/Blue/Red
- Automatic Model Management
- Auto-download models on first use
- Smart GPU memory handling
-
Tag-Style Prompts
- Single object: "cat"
- Multiple objects: "cat, dog, person"
- With attributes: "red car, blue shirt"
- Format: Use commas to separate multiple objects (e.g., "a, b, c")
-
Natural Language Prompts
- Simple sentence: "a person wearing a red jacket"
- Complex scene: "a woman in a blue dress standing next to a car"
- With location: "a cat sitting on the sofa"
- Format: Write a natural descriptive sentence
-
Tips for Better Results
- For Tag Style:
- Separate objects with commas: "chair, table, lamp"
- Add attributes before objects: "wooden chair, glass table"
- Keep it simple and clear
- For Natural Language:
- Use complete sentences
- Include details like color, position, action
- Be as descriptive as needed
- Parameter Adjustments:
- Threshold: 0.25-0.35 for broad detection, 0.45-0.55 for precision
- Use mask blur for smoother edges
- Adjust mask offset to fine-tune selection
- For Tag Style:
- Changed INSPYRENET model format from .pth to .safetensors for:
- Better security
- Faster loading speed (2-3x faster)
- Improved memory efficiency
- Better cross-platform compatibility
- Simplified node display name for better UI integration
- ANPG (animated PNG), AWEBP (animated WebP) and GIF supported.
APNG.AWEBP.mp4
- Fixed video processing issue
- Enhanced batch processing in RMBG-2.0 model
- Added support for proper batch image handling
- Improved memory efficiency by optimizing image size handling
- Added original size preservation for maintaining aspect ratios
- Implemented proper batch tensor processing
- Improved error handling and code robustness
- Performance gains:
- Single image processing: ~5-10% improvement
- Batch processing: up to 30-50% improvement (depending on batch size and GPU)
- Combined three background removal models into one unified node
- Added support for RMBG-2.0, INSPYRENET, and BEN models
- Implemented lazy loading for models (only downloads when first used)
-
RMBG-2.0 (Homepage)
- Latest version of RMBG model
- Excellent performance on complex backgrounds
- High accuracy in preserving fine details
- Best for general purpose background removal
-
INSPYRENET (Homepage)
- Specialized in human portrait segmentation
- Fast processing speed
- Good edge detection capability
- Ideal for portrait photos and human subjects
-
BEN (Background Elimination Network) (Homepage)
- Robust performance on various image types
- Good balance between speed and accuracy
- Effective on both simple and complex scenes
- Suitable for batch processing
- Unified interface for all three models
- Common parameters for all models:
- Sensitivity adjustment
- Processing resolution control
- Mask blur and offset options
- Multiple background color options
- Invert output option
- Model optimization toggle
- Optimized memory usage with model clearing
- Enhanced error handling and user feedback
- Added detailed tooltips for all parameters
- Improved mask post-processing
- Updated all package dependencies to latest stable versions
- Added support for transparent-background package
- Optimized dependency management
- Added background color options
- Alpha (transparent background)
- Black, White, Green, Blue, Red
- Improved mask processing
- Better detail preservation
- Enhanced edge quality
- More accurate segmentation
- Added video batch processing
- Support for video file background removal
- Maintains original video framerate and resolution
- Multiple output format support (with Alpha channel)
- Efficient batch processing for video frames
-Unsaved-Workflow---ComfyUI.mp4
- Added model cache management
- Cache status checking
- Model memory cleanup
- Better error handling
- Renamed 'invert_mask' to 'invert_output' for clarity
- Added sensitivity adjustment for mask strength
- Updated tooltips for better clarity
- Optimized image processing pipeline
- Added proper model cache verification
- Improved memory management
- Better error handling and recovery
- Enhanced batch processing performance for videos
- Added timm>=0.6.12,<1.0.0 for model support
- Updated requirements.txt with version constraints
- Fixed mask detail preservation issues
- Improved mask edge quality
- Fixed memory leaks in model handling
- The 'Alpha' background option provides transparent background
- Sensitivity parameter now controls mask strength
- Model cache is checked before each operation
- Memory is automatically cleaned when switching models
- Video processing supports various formats and maintains quality