ComfyUI > Nodes > ComfyUI_XISER_Nodes > Reorder Image Mask Groups

ComfyUI Node: Reorder Image Mask Groups

Class Name

XIS_ReorderImageMaskGroups

Category
XISER_Nodes/Image_And_Mask
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

Reorder Image Mask Groups Description

Reorders image-mask groups for flexible arrangement, streamlining workflows for AI artists.

Reorder Image Mask Groups:

The XIS_ReorderImageMaskGroups node is designed to reorder groups of images and their corresponding masks, providing flexibility in how these elements are organized and processed. This node is particularly useful when you need to manipulate the sequence of image-mask pairs for various artistic or computational purposes. By allowing you to specify the order in which these groups appear, the node helps streamline workflows that require specific arrangements of visual data. This capability is essential for tasks that involve batch processing or when preparing data for further analysis or visualization. The node ensures that the reordering process is intuitive and efficient, making it a valuable tool for AI artists who need to manage complex image and mask datasets.

Reorder Image Mask Groups Input Parameters:

image_1, image_2, image_3, image_4

These parameters represent the input images that you want to reorder. Each parameter can accept an image tensor, and if not connected, it defaults to None. The images are initially placed in a list, and their order can be adjusted based on the insert_order parameter. This flexibility allows you to control the sequence of images, which is crucial for tasks that depend on specific image arrangements.

mask_1, mask_2, mask_3, mask_4

These parameters correspond to the masks associated with each input image. Similar to the image parameters, each mask can be provided as a tensor, and defaults to None if not connected. The masks are reordered alongside their respective images, ensuring that the image-mask pairs remain synchronized. This is important for maintaining the integrity of data when masks are used for segmentation or other image processing tasks.

insert_image

This parameter allows you to specify an additional image to be inserted into the reordered list. If insert_image is None, it is treated as an empty insertion, which can be useful for maintaining a specific number of image slots without adding new data. This parameter provides additional flexibility in managing image sequences.

insert_mask

Similar to insert_image, this parameter lets you insert an additional mask into the reordered list. It works in tandem with insert_image to ensure that any new image-mask pair is correctly aligned within the sequence. This is particularly useful when you need to introduce new data into an existing workflow without disrupting the overall structure.

insert_order

This parameter determines the position at which the insert_image and insert_mask are placed within the reordered list. An insert_order of 1 places the new pair at the beginning, while higher values insert them at the specified position, shifting existing pairs accordingly. This control over insertion points allows for precise customization of the image-mask sequence.

Reorder Image Mask Groups Output Parameters:

image_output_1, image_output_2, image_output_3, image_output_4, image_output_5

These outputs represent the reordered images after processing. Each output corresponds to a position in the reordered list, ensuring that you receive a consistent and predictable sequence of images. This is essential for workflows that require specific image arrangements for further processing or analysis.

mask_output_1, mask_output_2, mask_output_3, mask_output_4, mask_output_5

These outputs provide the reordered masks, aligned with their respective images. By maintaining the synchronization between images and masks, these outputs ensure that any subsequent processing steps can accurately utilize the mask data for tasks such as segmentation or feature extraction.

Reorder Image Mask Groups Usage Tips:

  • Use the insert_order parameter to strategically place new image-mask pairs within your sequence, optimizing the order for your specific workflow needs.
  • Ensure that all input images and masks are correctly aligned before reordering to maintain data integrity and avoid mismatches in subsequent processing steps.

Reorder Image Mask Groups Common Errors and Solutions:

"IndexError: list index out of range"

  • Explanation: This error occurs when the insert_order exceeds the number of available image-mask slots.
  • Solution: Ensure that the insert_order is within the valid range of 1 to 5, corresponding to the maximum number of output slots.

"TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'"

  • Explanation: This error happens when attempting to concatenate a None value with a list during the reordering process.
  • Solution: Verify that all input parameters are correctly initialized and that None values are handled appropriately, especially when using insert_image and insert_mask.

Reorder Image Mask Groups 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.