ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
ImageConcatFromBatch
ImageConcatFromBatch Node Documentation
Overview
The ImageConcatFromBatch node in the ComfyUI KJNodes collection is designed to handle batches of images by concatenating them into a grid format. This node is particularly useful for visualizing multiple images together in a structured layout, making it easier to compare or present multiple samples at once.
Functionality
This node concatenates images from a batch into a grid with a specified number of columns. The number of rows is calculated based on the batch size and the number of columns, ensuring a compact grid layout. It optionally resizes images to match the grid's target dimensions while preserving the aspect ratio.
Inputs
-
Images (
images)- Type:
IMAGE - Description: A batch of images to be concatenated into a grid.
- Type:
-
Number of Columns (
num_columns)- Type:
INT - Default: 3
- Range: 1 to 255
- Description: The number of columns in the resulting image grid.
- Type:
-
Match Image Size (
match_image_size)- Type:
BOOLEAN - Default: False
- Description: If enabled, the node will resize images to match the size of the first image in the batch, maintaining the aspect ratio.
- Type:
-
Max Resolution (
max_resolution)- Type:
INT - Default: 4096
- Description: The maximum resolution for the grid image. This ensures the output image doesn't exceed a specified resolution.
- Type:
Outputs
- Concatenated Image Grid (
IMAGE)- Type:
IMAGE - Description: A single image composed of the input image batch arranged in a grid format according to the specified number of columns and rows.
- Type:
Usage in ComfyUI Workflows
The ImageConcatFromBatch node is particularly useful when you need to present multiple images side by side. Here are some practical applications:
- Comparison Tasks: View different variations or transforms of images simultaneously to evaluate differences and similarities.
- Batch Visualization: Useful in AI or image processing workflows where results from a batch need to be viewed together.
- Gallery Creation: Quickly arrange multiple related images into a single image for presentations, documentation, or further processing.
Special Features and Considerations
-
Image Resizing: When
match_image_sizeis enabled, the node ensures that all images in the batch are resized proportionally, based on the dimensions of the first image, to fit the grid layout. -
Resolution Control: By setting the maximum resolution, the node prevents the output image from exceeding a certain size, which can be crucial for ensuring compatibility with other nodes or for preparing images for specific display mediums.
-
Automatic Grid Calculation: The node calculates the required number of rows for the grid automatically, based on the batch size and the specified number of columns, optimizing the visual presentation.
In conclusion, the ImageConcatFromBatch node simplifies the process of organizing and visualizing multiple images from a batch, making it an essential tool for workflows that involve handling and presenting image datasets.