ComfyUI > Nodes > kaytool > 𝙆 Image Mask Composer

ComfyUI Node: 𝙆 Image Mask Composer

Class Name

Image_Mask_Composer

Category
KayTool/Image
Author
kk8bit (Account age: 1010days)
Extension
kaytool
Latest Updated
2026-04-06
Github Stars
0.34K

How to Install kaytool

Install this extension via the ComfyUI Manager by searching for kaytool
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter kaytool 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

𝙆 Image Mask Composer Description

Blends images with masks and background color for seamless composite image creation.

𝙆 Image Mask Composer:

The Image_Mask_Composer node is designed to seamlessly blend an image with a mask, allowing you to create composite images with a specified background color. This node is particularly useful for tasks where you need to overlay an image onto a background while applying a mask to control the visibility of certain areas. By using this node, you can achieve a smooth integration of images with different backgrounds, enhancing the visual appeal and coherence of your compositions. The node's primary function is to take an input image and a mask, and then combine them with a chosen background color, resulting in a new image where the mask dictates which parts of the original image are visible and which are replaced by the background color. This capability is essential for creating complex image compositions in a straightforward and efficient manner.

𝙆 Image Mask Composer Input Parameters:

image

The image parameter is the primary image that you want to blend with a mask. It serves as the base layer in the composition process. The image should be provided in a compatible format, typically as a tensor, and it represents the visual content that will be selectively displayed based on the mask. This parameter does not have specific minimum or maximum values, but it should match the dimensions of the mask for optimal results.

mask

The mask parameter is a crucial component that determines the visibility of the image. It is a binary or grayscale image where each pixel value indicates the transparency level of the corresponding pixel in the input image. A value of 1 (or white) means the pixel is fully visible, while a value of 0 (or black) means the pixel is fully transparent. The mask should ideally have the same dimensions as the input image to ensure proper alignment and blending.

background_color

The background_color parameter allows you to specify the color that will fill the areas of the image where the mask is not applied. You can choose from a predefined set of colors: black, white, gray, red, green, or blue. The default color is black. This parameter is essential for setting the visual context of the composite image, as it defines the backdrop against which the masked image is displayed.

𝙆 Image Mask Composer Output Parameters:

IMAGE

The output of the Image_Mask_Composer node is a composite image, represented as IMAGE. This output is the result of blending the input image with the mask and the specified background color. The composite image retains the visible parts of the input image as dictated by the mask, while the non-visible parts are replaced by the background color. This output is crucial for further processing or final display, as it provides a visually coherent image that integrates the input elements according to the specified parameters.

𝙆 Image Mask Composer Usage Tips:

  • Ensure that the dimensions of the image and mask match to avoid misalignment issues in the composite image.
  • Experiment with different background_color options to see how they affect the overall mood and tone of your composite image.
  • Use high-contrast masks to achieve clear and distinct separations between the image and the background.

𝙆 Image Mask Composer Common Errors and Solutions:

Mismatched Dimensions

  • Explanation: The dimensions of the image and mask do not match, leading to an error during processing.
  • Solution: Ensure that both the image and mask have the same width and height before inputting them into the node.

Invalid Background Color

  • Explanation: An unsupported color is specified for the background_color parameter.
  • Solution: Choose a background color from the available options: black, white, gray, red, green, or blue.

Incorrect Mask Format

  • Explanation: The mask is not in a binary or grayscale format, causing unexpected results.
  • Solution: Convert the mask to a binary or grayscale format where pixel values are either 0 or 1 (or equivalent grayscale values).

𝙆 Image Mask Composer Related Nodes

Go back to the extension to check out more related nodes.
kaytool
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.