ComfyUI > Nodes > ComfyUI-RMBG > Mask Enhancer (RMBG) 🎭

ComfyUI Node: Mask Enhancer (RMBG) 🎭

Class Name

AILab_MaskEnhancer

Category
🧪AILab/🖼️IMAGE
Author
1038lab (Account age: 1116days)
Extension
ComfyUI-RMBG
Latest Updated
2026-02-03
Github Stars
1.89K

How to Install ComfyUI-RMBG

Install this extension via the ComfyUI Manager by searching for ComfyUI-RMBG
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-RMBG in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Mask Enhancer (RMBG) 🎭 Description

Enhances image masks for precision in tasks like background removal and object isolation.

Mask Enhancer (RMBG) 🎭:

The AILab_MaskEnhancer is a powerful node designed to refine and enhance image masks, making them more precise and suitable for various image processing tasks. This node is particularly useful in scenarios where the initial mask may not be perfect, and further refinement is needed to achieve better results. By applying a series of transformations and adjustments, the AILab_MaskEnhancer can improve the clarity and accuracy of masks, which is crucial for tasks like background removal, object isolation, and image compositing. The node offers several options to fine-tune the mask, such as smoothing edges, filling holes, and adjusting the mask's sensitivity. These capabilities make it an essential tool for AI artists looking to enhance their image processing workflows within the ComfyUI environment.

Mask Enhancer (RMBG) 🎭 Input Parameters:

sensitivity

The sensitivity parameter adjusts the mask's sensitivity to changes in the image. A higher sensitivity value makes the mask more responsive to subtle variations, which can be useful for capturing fine details. Conversely, a lower sensitivity value may result in a more generalized mask. The parameter typically ranges from 0 to 1, with a default value that balances detail and generalization.

smooth

The smooth parameter controls the level of smoothing applied to the mask's edges. Smoothing helps to reduce jagged edges and create a more natural transition between masked and unmasked areas. The parameter accepts values from 0 upwards, where higher values result in more pronounced smoothing effects.

fill_holes

The fill_holes parameter is a boolean option that, when enabled, fills small holes within the mask. This is particularly useful for ensuring that the mask is solid and continuous, which can prevent unwanted artifacts in the final image. The default setting is typically False.

mask_blur

The mask_blur parameter determines the amount of Gaussian blur applied to the mask. Blurring can help to soften the mask's edges and create a more seamless blend with the surrounding image. The parameter accepts values from 0 upwards, with higher values increasing the blur effect.

mask_offset

The mask_offset parameter allows you to expand or contract the mask's boundaries. Positive values expand the mask, while negative values contract it. This can be useful for fine-tuning the mask's coverage area to better match the desired object or region.

invert_output

The invert_output parameter is a boolean option that, when enabled, inverts the mask's values. This can be useful for reversing the masked and unmasked areas, depending on the specific requirements of your project. The default setting is typically False.

Mask Enhancer (RMBG) 🎭 Output Parameters:

MASK

The MASK output parameter provides the enhanced mask as a result of the node's processing. This refined mask is more accurate and suitable for further image processing tasks, such as compositing or background removal. The output mask retains the improvements made by the node, such as smoothed edges, filled holes, and adjusted sensitivity, ensuring a high-quality result for your projects.

Mask Enhancer (RMBG) 🎭 Usage Tips:

  • Experiment with the sensitivity parameter to capture the right level of detail for your specific image. Higher sensitivity can help in capturing intricate details, while lower sensitivity may be better for broader areas.
  • Use the smooth parameter to eliminate jagged edges in your mask, especially when working with high-contrast images or those with complex textures.
  • Enable fill_holes when you notice small gaps within the mask that could affect the final output, ensuring a more cohesive mask.
  • Adjust the mask_blur to create a softer transition between the masked and unmasked areas, which can be particularly useful in blending tasks.

Mask Enhancer (RMBG) 🎭 Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: This error occurs when the input mask does not have the expected dimensions or shape required by the node.
  • Solution: Ensure that the input mask is correctly formatted and matches the expected dimensions. You may need to preprocess the mask to align with the node's requirements.

"Mask processing failed"

  • Explanation: This error indicates a failure during the mask enhancement process, possibly due to incompatible parameter settings.
  • Solution: Review the input parameters and adjust them to ensure compatibility. Check for any extreme values that might be causing the process to fail and adjust them accordingly.

Mask Enhancer (RMBG) 🎭 Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-RMBG
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.