KJNodes/imagegenerated

Reverse Image Batch(ReverseImageBatch)

This node technically receives a tensor (batch) containing multiple images and uses PyTorch's torch。

Reverse Image Batch

images
IMAGE
KJNodes

The Reverse Image Batch node technically receives a tensor (batch) containing multiple images and uses PyTorch's `torch

The Reverse Image Batch node is a tool for image batch processing. Its core function is to reverse the order of the input image batch, making the first image the last and the last image the first.

Node Function

This node technically receives a tensor (batch) containing multiple images and uses PyTorch's torch.flip function to perform a reversal operation along the batch dimension (dimension 0). It supports the standard IMAGE data type in ComfyUI. The processing does not alter the content, dimensions, or format of the images themselves; it only changes their order within the batch.

Node Parameter Description - Reverse Image Batch

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
imagesIMAGEYes--Input parameter images: Input an image batch. The node will reverse the order of all images in this batch.

Output

Parameter NameData TypeDescription
IMAGEIMAGEOutput parameter IMAGE: Outputs the image batch with its order reversed.

Usage Scenarios

This node is very useful in workflows that require specific image sequences. For example, when creating a looping animation, you can input a forward sequence of images into this node to obtain a reverse sequence, thereby creating a smooth back-and-forth animation effect without needing to regenerate the images. It can also be used to adjust the input order of images for a latent space encoder to meet specific model requirements for input sequences.

The Reverse Image Batch node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…