ComfyUI > Nodes > ComfyUI-RMBG > Mask Overlay (RMBG) 🖼️🎭

ComfyUI Node: Mask Overlay (RMBG) 🖼️🎭

Class Name

AILab_MaskOverlay

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 Overlay (RMBG) 🖼️🎭 Description

Integrates masks onto images for precise editing, ideal for background removal and compositing.

Mask Overlay (RMBG) 🖼️🎭:

The AILab_MaskOverlay node is designed to seamlessly integrate a mask onto an image, providing a powerful tool for AI artists who wish to manipulate and enhance their visual content. This node is particularly useful in workflows that involve background removal or image compositing, as it allows you to overlay a mask onto an image to highlight or isolate specific areas. By using this node, you can achieve precise control over which parts of an image are visible or altered, making it an essential component for tasks that require detailed image editing. The node leverages advanced image processing techniques to ensure that the overlay is applied smoothly and accurately, maintaining the integrity and quality of the original image.

Mask Overlay (RMBG) 🖼️🎭 Input Parameters:

mask

The mask parameter is a crucial input that defines the area of the image to be affected by the overlay. It functions as a stencil, where the mask's transparency levels determine the visibility of the underlying image. A fully opaque mask will completely cover the image area, while a transparent mask will leave the image unchanged. This parameter allows you to control the extent of the overlay effect, enabling precise adjustments to the image. The mask should be provided in a format compatible with the node's processing capabilities, typically as a binary or grayscale image where different shades represent varying levels of transparency.

image

The image parameter is the primary visual content onto which the mask will be applied. This input serves as the canvas for the overlay operation, and its quality and resolution will directly impact the final output. The image should be prepared in advance, ensuring that it aligns with the mask in terms of dimensions and orientation. By providing a high-quality image, you can ensure that the overlay process enhances rather than detracts from the visual appeal of the content.

Mask Overlay (RMBG) 🖼️🎭 Output Parameters:

result

The result parameter is the output of the overlay operation, delivering the final image with the mask applied. This output is crucial for evaluating the effectiveness of the overlay process, as it reflects the combined effect of the mask and the original image. The result will show the areas of the image that have been altered according to the mask's transparency levels, allowing you to assess the success of the operation and make any necessary adjustments. This output is typically in the same format as the input image, ensuring compatibility with subsequent processing steps or final presentation.

Mask Overlay (RMBG) 🖼️🎭 Usage Tips:

  • Ensure that the mask and image are of the same dimensions to avoid misalignment issues during the overlay process.
  • Use high-contrast masks to achieve clear and distinct overlay effects, especially when isolating specific areas of an image.
  • Experiment with different mask transparency levels to achieve subtle or dramatic effects, depending on the desired outcome.

Mask Overlay (RMBG) 🖼️🎭 Common Errors and Solutions:

Mask and Image Dimension Mismatch

  • Explanation: This error occurs when the dimensions of the mask and the image do not match, leading to an inability to properly overlay the mask.
  • Solution: Ensure that both the mask and the image have the same width and height before applying the overlay. You may need to resize one of the inputs to match the other.

Unsupported Image Format

  • Explanation: The node may not support the format of the input image, resulting in an error during processing.
  • Solution: Convert the image to a supported format, such as PNG or JPEG, before using it as an input for the node.

Invalid Mask Values

  • Explanation: If the mask contains invalid values, such as negative numbers or values exceeding the expected range, the overlay process may fail.
  • Solution: Ensure that the mask is properly formatted, typically as a binary or grayscale image with values ranging from 0 to 255.

Mask Overlay (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.

Mask Overlay (RMBG) 🖼️🎭