ComfyUI > Nodes > Allor Plugin > ImageBatchPermute

ComfyUI Node: ImageBatchPermute

Class Name

ImageBatchPermute

Category
image/batch
Author
Nourepide (Account age: 2900days)
Extension
Allor Plugin
Latest Updated
2024-05-22
Github Stars
0.2K

How to Install Allor Plugin

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

ImageBatchPermute Description

Rearrange batch image order using specified permutation pattern for flexible manipulation and processing control.

ImageBatchPermute:

The ImageBatchPermute node is designed to rearrange the order of images within a batch based on a specified permutation pattern. This node is particularly useful when you need to reorder images for specific processing sequences or to achieve a desired arrangement. By providing a permutation string, you can control the exact order in which images appear, allowing for flexible and dynamic batch manipulation. This can be beneficial in various scenarios, such as preparing data for training machine learning models, creating specific visual effects, or organizing images for presentation. The node ensures that the permutation is applied correctly, even if the specified indices are out of range, by clamping them to valid values.

ImageBatchPermute Input Parameters:

images

This parameter represents the batch of images that you want to permute. It is expected to be a tensor containing multiple images, where each image is represented as a multi-dimensional array. The images are typically in the format of (batch_size, height, width, channels).

permute

This parameter is a string that specifies the desired order of the images in the batch. The string should contain a sequence of numbers separated by spaces or commas, indicating the new positions of the images. For example, "2 1 3" would swap the first and second images and leave the third image in place. The numbers in the string should be 1-based indices, but they will be converted to 0-based indices internally.

start_with_zero

This boolean parameter determines whether the indices in the permute string should be interpreted as 0-based or 1-based. If set to True, the indices are treated as 0-based, meaning they start from 0. If set to False, the indices are treated as 1-based, meaning they start from 1. This allows for flexibility in specifying the permutation pattern.

ImageBatchPermute Output Parameters:

IMAGE

The output is a tensor containing the permuted batch of images. The images are rearranged according to the specified permutation pattern, resulting in a new order that matches the provided indices. This output can be used for further processing or visualization, depending on your specific needs.

ImageBatchPermute Usage Tips:

  • Ensure that the permute string accurately reflects the desired order of images. Double-check the indices to avoid unintended rearrangements.
  • Use the start_with_zero parameter to match the indexing style you are most comfortable with, whether it is 0-based or 1-based.
  • If you encounter out-of-range indices in the permute string, the node will automatically clamp them to valid values, preventing errors and ensuring a smooth operation.

ImageBatchPermute Common Errors and Solutions:

ValueError: "Not existing priority."

  • Explanation: This error occurs if an invalid priority is specified in the ImageBatchFork node.
  • Solution: Ensure that the priority parameter is set to either "first" or "second".

IndexError: "list index out of range"

  • Explanation: This error occurs if the indices specified in the permute string are out of the valid range for the batch size.
  • Solution: Verify that the indices in the permute string are within the range of the batch size. The node will clamp out-of-range indices, but it is good practice to provide valid indices.

TypeError: "expected string or bytes-like object"

  • Explanation: This error occurs if the permute parameter is not provided as a string.
  • Solution: Ensure that the permute parameter is a string containing the desired permutation pattern.

ValueError: "invalid literal for int() with base 10"

  • Explanation: This error occurs if the permute string contains non-numeric characters.
  • Solution: Ensure that the permute string only contains numbers separated by spaces or commas.

ImageBatchPermute Related Nodes

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