ComfyUI > Nodes > ComfyUI-YCNodes > Mask Composite (YC)

ComfyUI Node: Mask Composite (YC)

Class Name

YCMaskComposite

Category
YCNode/Mask
Author
yichengup (Account age: 473days)
Extension
ComfyUI-YCNodes
Latest Updated
2025-06-03
Github Stars
0.02K

How to Install ComfyUI-YCNodes

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

Blend two mask images with screen blending and weighted average for smooth transitions and visually appealing composite creations.

Mask Composite (YC):

The YCMaskComposite node is designed to blend two mask images using a sophisticated method that combines elements of the screen blending mode with a weighted average approach. This node is particularly useful for AI artists who want to create composite images that maintain brightness and detail without overexposing bright areas. By leveraging a blend factor that adjusts based on the brightness of the pixels, the node ensures a smooth transition between the screen effect and a weighted sum, providing a more natural and visually appealing result. This makes it an essential tool for creating complex mask compositions where control over the blending process is crucial.

Mask Composite (YC) Input Parameters:

destination

The destination parameter represents the base mask image onto which the source mask will be blended. It is crucial as it serves as the canvas for the composite operation. The blending process will modify this mask based on the source mask and other parameters. This parameter is of type MASK.

source

The source parameter is the mask image that will be blended onto the destination mask. It plays a significant role in determining the final appearance of the composite image. The source mask's details and brightness will influence the blending outcome. This parameter is of type MASK.

x

The x parameter specifies the horizontal offset for the source mask when blending it onto the destination mask. It allows you to control the positioning of the source mask, ensuring precise alignment. The value ranges from 0 to 8192, with a default of 0.

y

The y parameter determines the vertical offset for the source mask during the blending process. Like the x parameter, it provides control over the source mask's positioning, allowing for accurate placement. The value ranges from 0 to 8192, with a default of 0.

operation

The operation parameter defines the blending mode to be used. Options include multiply, add, subtract, and, or, xor, overlay, and natural_blend. Each mode offers a different method of combining the source and destination masks, affecting the final composite's appearance. The default operation is natural_blend.

opacity

The opacity parameter controls the transparency level of the source mask when blended with the destination mask. A value of 1.0 means full opacity, while 0.0 means full transparency. This parameter allows for fine-tuning the intensity of the source mask's influence on the composite. The value ranges from 0.0 to 1.0, with a default of 1.0.

blend_power

The blend_power parameter adjusts the intensity of the natural blend effect. A higher value makes the blend closer to a simple addition, while a lower value emphasizes the screen effect. This parameter is crucial for achieving the desired balance between the two blending methods. The value ranges from 0.0 to 1.0, with a default of 0.5.

Mask Composite (YC) Output Parameters:

mask

The mask output parameter is the resulting composite mask image after blending the source and destination masks according to the specified parameters. This output is crucial for further processing or as a final product in your creative workflow. It retains the details and brightness adjustments made during the blending process, providing a refined and visually appealing result.

Mask Composite (YC) Usage Tips:

  • Experiment with the blend_power parameter to achieve the perfect balance between the screen effect and weighted average, especially when working with images that have varying brightness levels.
  • Use the opacity parameter to subtly integrate the source mask into the destination, allowing for more nuanced and controlled blending results.

Mask Composite (YC) Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: This error occurs when the source and destination masks have incompatible dimensions.
  • Solution: Ensure that both masks have the same dimensions or adjust the x and y parameters to align them correctly.

"Unsupported operation type"

  • Explanation: This error is triggered when an invalid operation type is specified.
  • Solution: Verify that the operation parameter is set to one of the supported types: multiply, add, subtract, and, or, xor, overlay, or natural_blend.

"Opacity out of range"

  • Explanation: This error indicates that the opacity value is outside the acceptable range.
  • Solution: Adjust the opacity parameter to be within the range of 0.0 to 1.0.

Mask Composite (YC) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-YCNodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.