ComfyUI > Nodes > ComfyUI_XISER_Nodes > Mask Switch

ComfyUI Node: Mask Switch

Class Name

XIS_MaskSwitch

Category
XISER_Nodes/Logic
Author
grinlau18 (Account age: 944days)
Extension
ComfyUI_XISER_Nodes
Latest Updated
2026-03-20
Github Stars
0.03K

How to Install ComfyUI_XISER_Nodes

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

XIS_MaskSwitch controls mask data flow in workflows, enabling conditional processing via boolean logic.

Mask Switch:

The XIS_MaskSwitch node is designed to act as a logical switch for mask data within a node-based workflow. Its primary purpose is to control the flow of mask data based on a boolean condition, allowing you to enable or disable the passage of a mask through the node. This functionality is particularly useful in scenarios where conditional processing of mask data is required, such as selectively applying effects or transformations to certain parts of an image. By providing a simple on/off mechanism, the XIS_MaskSwitch node enhances the flexibility and control you have over your image processing tasks, making it easier to manage complex workflows with conditional logic.

Mask Switch Input Parameters:

enable

The enable parameter is a boolean input that determines whether the mask data should be passed through the node or not. When set to True, the node allows the mask input to be outputted, effectively enabling the mask's passage. Conversely, when set to False, the node outputs None, effectively disabling the mask's passage. This parameter is crucial for controlling the conditional flow of mask data in your workflow. The default value is True, meaning the mask is enabled by default.

mask_input

The mask_input parameter is an optional input that accepts the mask data you wish to control with the switch. This input can be any mask that you want to conditionally pass through the node based on the enable parameter. If the enable parameter is set to True, the mask provided here will be outputted; otherwise, the output will be None. This parameter allows you to integrate the node into workflows where mask data needs to be selectively processed.

Mask Switch Output Parameters:

mask_output

The mask_output parameter is the result of the node's execution, which is either the mask data provided in the mask_input parameter or None, depending on the state of the enable parameter. If enable is True, the output will be the same as the mask_input; if False, the output will be None. This output is essential for determining whether the mask data should continue through the workflow or be halted based on the conditional logic applied.

Mask Switch Usage Tips:

  • Use the enable parameter to dynamically control the flow of mask data in your workflow, allowing for conditional processing based on specific criteria or triggers.
  • Integrate the XIS_MaskSwitch node in complex workflows where certain operations should only be applied to specific parts of an image, enhancing the flexibility and efficiency of your processing pipeline.

Mask Switch Common Errors and Solutions:

Mask dimension mismatch

  • Explanation: This error occurs when the mask input does not have the expected dimensions, which can lead to processing issues.
  • Solution: Ensure that the mask input has the correct dimensions, typically a 2D array, before passing it to the node.

Missing mask input

  • Explanation: This error arises when the enable parameter is set to True, but no mask input is provided.
  • Solution: Provide a valid mask input when the enable parameter is set to True, or set enable to False if no mask is needed.

Mask Switch Related Nodes

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