ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Mask_Add_Switch🔄蒙版合并开关

ComfyUI Node: 🍒Mask_Add_Switch🔄蒙版合并开关

Class Name

Mask_Add_Switch

Category
🍒 Kim-Nodes/🔲Mask_Tools | 蒙板工具
Author
Kim (Account age: 2536days)
Extension
ComfyUI_KimNodes
Latest Updated
2025-09-22
Github Stars
0.05K

How to Install ComfyUI_KimNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_KimNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_KimNodes 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_Add_Switch🔄蒙版合并开关 Description

The Mask_Add_Switch node merges two masks with a user-defined switch for flexible output.

🍒Mask_Add_Switch🔄蒙版合并开关:

The Mask_Add_Switch node is designed to merge two masks, offering flexibility in how the masks are combined based on a user-defined switch. This node is particularly useful for AI artists who need to integrate different mask formats into a cohesive output. It supports two primary modes: a "white background" mode and a "black background" mode. In the white background mode, the node merges the black areas of the masks, while in the black background mode, it merges the white areas. This functionality allows for versatile mask manipulation, enabling users to tailor the output to their specific artistic needs. By providing a simple switch to toggle between these modes, the node simplifies the process of mask combination, making it accessible even to those with limited technical expertise.

🍒Mask_Add_Switch🔄蒙版合并开关 Input Parameters:

masks_a

This parameter represents the first mask input, which is expected to be a mask with a white background and black areas representing the mask itself. The function of this parameter is to provide one of the two masks that will be merged. It is crucial for defining the initial mask structure that will be combined with the second mask.

masks_b

Similar to masks_a, this parameter is the second mask input, also expected to be a mask with a white background and black areas. It serves as the counterpart to masks_a, and together, these two masks are merged based on the selected mode. The combination of these masks allows for complex mask structures to be created.

invert_switch

This boolean parameter determines the mode of mask merging. When set to True, the node operates in "white background" mode, merging the black areas of the masks. When set to False, it switches to "black background" mode, merging the white areas instead. The default value is False, meaning the node will initially operate in black background mode. This switch provides users with the flexibility to choose the desired output format based on their artistic requirements.

🍒Mask_Add_Switch🔄蒙版合并开关 Output Parameters:

MASKS

The output parameter MASKS is the result of merging the two input masks according to the selected mode. It is a mask that reflects the combined areas of masks_a and masks_b, processed through the logic defined by the invert_switch. This output is crucial for further processing or direct use in artistic projects, as it provides a unified mask that can be applied to various creative tasks.

🍒Mask_Add_Switch🔄蒙版合并开关 Usage Tips:

  • To achieve a seamless blend of two masks, ensure that both masks_a and masks_b are properly formatted as 2D tensors with consistent dimensions.
  • Experiment with the invert_switch to see how different modes affect the final output, especially when working with complex mask patterns.

🍒Mask_Add_Switch🔄蒙版合并开关 Common Errors and Solutions:

Input mask dimensions mismatch

  • Explanation: This error occurs when the input masks masks_a and masks_b do not have matching dimensions, which is necessary for the merging process.
  • Solution: Ensure that both masks are resized or cropped to the same dimensions before inputting them into the node.

Invalid mask format

  • Explanation: The node expects masks to be in a specific format (2D tensors). If the input masks are not in this format, an error may occur.
  • Solution: Verify that the masks are correctly formatted as 2D tensors and convert them if necessary before using the node.

🍒Mask_Add_Switch🔄蒙版合并开关 Related Nodes

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