ComfyUI > Nodes > JPS Custom Nodes for ComfyUI > Mask Switch (JPS)

ComfyUI Node: Mask Switch (JPS)

Class Name

Mask Switch (JPS)

Category
JPS Nodes/Switches
Author
JPS (Account age: 370days)
Extension
JPS Custom Nodes for ComfyUI
Latest Updated
2024-05-22
Github Stars
0.04K

How to Install JPS Custom Nodes for ComfyUI

Install this extension via the ComfyUI Manager by searching for JPS Custom Nodes for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter JPS Custom Nodes for ComfyUI 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Mask Switch (JPS) Description

Streamline mask selection in AI art projects with dynamic switching between up to five inputs based on selection parameter.

Mask Switch (JPS):

The Mask Switch (JPS) node is designed to streamline the process of selecting and switching between multiple mask inputs in your AI art projects. This node allows you to dynamically choose from up to five different mask inputs based on a selection parameter, making it easier to manage and apply different masks without manually changing the input each time. This functionality is particularly useful in scenarios where you need to experiment with various masking options or automate the selection process based on specific conditions. By using the Mask Switch (JPS) node, you can enhance your workflow efficiency and maintain a more organized project structure.

Mask Switch (JPS) Input Parameters:

select

The select parameter is an integer that determines which mask input will be used as the output. It accepts values from 1 to 5, where each number corresponds to one of the optional mask inputs (mask_1 to mask_5). For example, if select is set to 1, the node will output mask_1. This parameter is required and does not have a default value.

mask_1

The mask_1 parameter is an optional input that accepts a mask. This mask will be selected as the output if the select parameter is set to 1. If not provided, the output will be None when select is 1.

mask_2

The mask_2 parameter is an optional input that accepts a mask. This mask will be selected as the output if the select parameter is set to 2. If not provided, the output will be None when select is 2.

mask_3

The mask_3 parameter is an optional input that accepts a mask. This mask will be selected as the output if the select parameter is set to 3. If not provided, the output will be None when select is 3.

mask_4

The mask_4 parameter is an optional input that accepts a mask. This mask will be selected as the output if the select parameter is set to 4. If not provided, the output will be None when select is 4.

mask_5

The mask_5 parameter is an optional input that accepts a mask. This mask will be selected as the output if the select parameter is set to 5. If not provided, the output will be None when select is 5.

Mask Switch (JPS) Output Parameters:

mask_out

The mask_out parameter is the output mask selected based on the value of the select parameter. It will be one of the masks provided in mask_1 to mask_5, or None if the corresponding mask input is not provided. This output is crucial for applying the selected mask to subsequent nodes in your workflow, enabling dynamic and flexible mask management.

Mask Switch (JPS) Usage Tips:

  • To effectively use the Mask Switch (JPS) node, ensure that you provide all potential mask inputs (mask_1 to mask_5) even if you plan to use only a few. This will allow you to switch between different masks seamlessly.
  • Use the select parameter dynamically by connecting it to other nodes or scripts that can change its value based on specific conditions or user inputs, thereby automating the mask selection process.

Mask Switch (JPS) Common Errors and Solutions:

"Invalid select value"

  • Explanation: The select parameter value is outside the valid range of 1 to 5. - Solution: Ensure that the select parameter is set to an integer between 1 and 5.

"NoneType object has no attribute"

  • Explanation: The selected mask input is None because it was not provided.
  • Solution: Verify that the mask input corresponding to the select parameter value is provided and not None.

Mask Switch (JPS) Related Nodes

Go back to the extension to check out more related nodes.
JPS Custom Nodes for ComfyUI
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.