Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-Desert-Pixel-Nodes > DP 5 Image And Mask Switch

ComfyUI Node: DP 5 Image And Mask Switch

Class Name

DP 5 Image And Mask Switch

Category
DP/image
Author
DesertPixelAi (Account age: 840days)
Extension
ComfyUI-Desert-Pixel-Nodes
Latest Updated
2025-06-22
Github Stars
0.03K

How to Install ComfyUI-Desert-Pixel-Nodes

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

DP 5 Image And Mask Switch Description

Facilitates dynamic selection and manipulation of up to five image-mask pairs in workflows.

DP 5 Image And Mask Switch:

The DP 5 Image And Mask Switch node is designed to facilitate the dynamic selection and manipulation of image and mask pairs within a workflow. This node allows you to choose from up to five different image and mask combinations, providing flexibility in processing and output generation. Its primary function is to enable seamless switching between these pairs based on a selection parameter, which is particularly useful in scenarios where multiple image processing paths are available, and a specific one needs to be activated. Additionally, the node offers options to export images with mask alpha channels and to force RGB output, ensuring compatibility with various downstream processes. By providing these capabilities, the DP 5 Image And Mask Switch node enhances the versatility and control you have over image and mask handling in your projects.

DP 5 Image And Mask Switch Input Parameters:

select

The select parameter determines which image and mask pair to use from the available options. It accepts an integer value ranging from 1 to 5, corresponding to the five possible image and mask pairs. This parameter is crucial as it dictates the active pair that will be processed and output by the node. The default value is typically set to 1, but you can adjust it to switch between different pairs as needed.

export_with_mask_alpha

The export_with_mask_alpha parameter is a boolean flag that, when set to true, applies the selected mask as an alpha channel to the selected image. This option is beneficial when you need to export images with transparency information derived from the mask, allowing for more complex compositing and blending operations. The default value is false, meaning the mask is not applied as an alpha channel unless explicitly specified.

force_rgb_output

The force_rgb_output parameter is another boolean flag that ensures the output image is in RGB format, even if the input image has an alpha channel. This is particularly useful for maintaining compatibility with nodes or processes that require RGB images without alpha channels. By default, this parameter is set to false, allowing the original image format to be preserved unless RGB output is specifically required.

images1, images2_opt, images3_opt, images4_opt, images5_opt

These parameters represent the image inputs for the node, with images1 being mandatory and the others optional. Each parameter can accept an image tensor, and they collectively provide the different image options that can be selected via the select parameter. If an image input is not provided, the node will generate a default black image tensor to ensure continuity in processing.

mask1_opt, mask2_opt, mask3_opt, mask4_opt, mask5_opt

Similar to the image inputs, these parameters correspond to the mask inputs for the node. Each mask parameter is optional and can accept a mask tensor. These masks are paired with their respective images and can be selected using the select parameter. If a mask is not provided, the node will create a default empty mask tensor matching the dimensions of the selected image.

DP 5 Image And Mask Switch Output Parameters:

selected_image

The selected_image output parameter provides the image tensor that has been selected based on the select parameter. This output is crucial as it represents the image that will be used in subsequent processing steps. If the export_with_mask_alpha option is enabled, this image will include the mask as an alpha channel, adding transparency information.

selected_mask

The selected_mask output parameter delivers the mask tensor corresponding to the selected image. This output is important for workflows that require mask information for further processing, such as masking operations or compositing tasks. The mask is output as a separate tensor unless combined with the image as an alpha channel.

DP 5 Image And Mask Switch Usage Tips:

  • To quickly switch between different image processing paths, adjust the select parameter to the desired image and mask pair.
  • Enable export_with_mask_alpha when you need to include transparency information in your output images, which can be useful for compositing tasks.
  • Use force_rgb_output to ensure compatibility with nodes that do not support images with alpha channels, maintaining a consistent RGB format.

DP 5 Image And Mask Switch Common Errors and Solutions:

Invalid selection: <select>. Must be between 1 and 5.

  • Explanation: This error occurs when the select parameter is set to a value outside the valid range of 1 to 5. - Solution: Ensure that the select parameter is set to an integer value between 1 and 5, corresponding to the available image and mask pairs.

Image or mask input is None

  • Explanation: This warning indicates that one of the image or mask inputs is not provided, resulting in a default black image or empty mask being used.
  • Solution: Verify that all necessary image and mask inputs are correctly supplied to the node. If a specific input is not needed, ensure that the node's behavior with default values is acceptable for your workflow.

DP 5 Image And Mask Switch Related Nodes

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

DP 5 Image And Mask Switch