ComfyUI > Nodes > ComfyUI Impact Pack > Switch (images, mask)

ComfyUI Node: Switch (images, mask)

Class Name

ImageMaskSwitch

Category
ImpactPack/Util
Author
Dr.Lt.Data (Account age: 458days)
Extension
ComfyUI Impact Pack
Latest Updated
2024-06-19
Github Stars
1.38K

How to Install ComfyUI Impact Pack

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

Switch (images, mask) Description

Switch between image and mask inputs based on selection parameter, streamlining conditional image manipulation for AI artists.

Switch (images, mask):

The ImageMaskSwitch node is designed to provide a flexible way to switch between multiple image and mask inputs based on a selection parameter. This node is particularly useful when you have several image-mask pairs and need to dynamically choose which pair to use in your workflow. By allowing you to select from up to four different image-mask pairs, this node helps streamline processes that require conditional image manipulation or analysis, making it a valuable tool for AI artists who work with complex image compositions and need to manage multiple layers or variations efficiently.

Switch (images, mask) Input Parameters:

select

The select parameter determines which image-mask pair to use. It is an integer value with a default of 1, a minimum of 1, and a maximum of 4. This parameter is crucial as it directs the node to output the corresponding image and mask based on the selected number. For example, if select is set to 2, the node will output images2_opt and mask2_opt.

images1

The images1 parameter is the primary image input and is required. This is the image that will be used when the select parameter is set to 1. It serves as the default image input and is essential for the node's operation.

mask1_opt

The mask1_opt parameter is an optional mask input associated with images1. If provided, this mask will be used when the select parameter is set to 1. This allows for additional image processing or analysis based on the mask.

images2_opt

The images2_opt parameter is an optional image input. This image will be used when the select parameter is set to 2. It provides flexibility to switch to a different image based on the selection.

mask2_opt

The mask2_opt parameter is an optional mask input associated with images2_opt. If provided, this mask will be used when the select parameter is set to 2, enabling conditional image processing.

images3_opt

The images3_opt parameter is an optional image input. This image will be used when the select parameter is set to 3. It allows for further flexibility in choosing different images.

mask3_opt

The mask3_opt parameter is an optional mask input associated with images3_opt. If provided, this mask will be used when the select parameter is set to 3, facilitating additional image manipulation options.

images4_opt

The images4_opt parameter is an optional image input. This image will be used when the select parameter is set to 4. It offers the maximum flexibility by allowing up to four different image inputs.

mask4_opt

The mask4_opt parameter is an optional mask input associated with images4_opt. If provided, this mask will be used when the select parameter is set to 4, enabling comprehensive image processing capabilities.

Switch (images, mask) Output Parameters:

IMAGE

The IMAGE output is the selected image based on the select parameter. This output is crucial as it provides the image that will be used in subsequent nodes or processes. The selected image can be one of the four optional images or the primary image.

MASK

The MASK output is the selected mask based on the select parameter. This output is important for workflows that require mask-based image processing or analysis. The selected mask can be one of the four optional masks or the primary mask.

Switch (images, mask) Usage Tips:

  • Ensure that the select parameter is set correctly to choose the desired image-mask pair. This will help avoid confusion and ensure the correct outputs are used in your workflow.
  • Utilize the optional mask inputs to enhance your image processing tasks. Masks can provide additional control and precision in image manipulation.
  • When working with multiple image-mask pairs, label your inputs clearly to avoid mistakes and streamline your workflow.

Switch (images, mask) Common Errors and Solutions:

"Invalid select value"

  • Explanation: The select parameter is set to a value outside the allowed range (1-4).
  • Solution: Ensure that the select parameter is set to an integer value between 1 and 4.

"Missing required image input"

  • Explanation: The primary image input images1 is not provided.
  • Solution: Make sure to provide the images1 input, as it is required for the node to function.

"Selected image or mask not provided"

  • Explanation: The select parameter points to an optional image or mask input that is not provided.
  • Solution: Ensure that the optional image and mask inputs corresponding to the select value are provided, or adjust the select parameter to point to available inputs.

Switch (images, mask) Related Nodes

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