Visit ComfyUI Online for ready-to-use ComfyUI environment
Rearrange batch image order using specified permutation pattern for flexible manipulation and processing control.
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.
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).
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.
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.
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.
permute
string accurately reflects the desired order of images. Double-check the indices to avoid unintended rearrangements.start_with_zero
parameter to match the indexing style you are most comfortable with, whether it is 0-based or 1-based.permute
string, the node will automatically clamp them to valid values, preventing errors and ensuring a smooth operation.ImageBatchFork
node.permute
string are out of the valid range for the batch size.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.permute
parameter is not provided as a string.permute
parameter is a string containing the desired permutation pattern.permute
string contains non-numeric characters.permute
string only contains numbers separated by spaces or commas.© Copyright 2024 RunComfy. All Rights Reserved.