ComfyUI-ImageBatchUtils-archive Introduction
ComfyUI-ImageBatchUtils is a preserved historical snapshot of a small collection of ComfyUI nodes for working with batches of images and masks. This documentation describes the accessible archive, not an actively maintained original repository. The original repository is unavailable.
A batch is a group of images passed through a workflow together. That is convenient for generating several results at once, but it can be awkward when you want to select one result, send different results down different paths, or process each crop separately. These nodes let you count, split, select, and route those images. A companion node splits mask batches in the same way.
For example, if SEGSPreview gives you several cropped segments, you can unpack them into individual items before sending them to a downstream node. This can help you inspect or process each segment separately when treating the group as one batch leads to unwanted duplicate processing.
How ComfyUI-ImageBatchUtils Works
Think of a batch as a stack of pictures. Unpack takes the pictures off the stack one at a time; Pick takes one picture at a chosen position; Slice takes a consecutive portion; and Count tells you how many pictures are in the stack.
Some ComfyUI nodes provide one batch, while others provide a list that may contain several batches. The image utility nodes can handle either form: they turn the input into individual images in order. The mask unpack node does the same for masks.
Each extracted image or mask keeps its original width and height. The nodes do not resize smaller items or pad them to match larger ones. This is especially useful when your input contains crops of different sizes.
There are two ways to unpack images:
- List output: One output carries a list of individual images. Use it when the next node or workflow path can work with list items and you do not know in advance how many images there will be.
- Fixed outputs: Four separate output connectors let you wire individual images to different paths. Use them when you want direct control over the first four images.
These are workflow utility nodes, not image-generation or enhancement models. They change how existing images and masks are organized, not what those images look like.
ComfyUI-ImageBatchUtils Features
All six nodes appear under the image/batch or mask/batch categories in the archived source.
| Node | What it does | Example use |
|---|---|---|
Image Batch Unpack (List) (ImageBatchUnpackDynamic) | Turns all input images into a list of individual images, with no fixed number of output slots. | Process every crop from a segmentation workflow separately. |
Image Batch Unpack (4-slot) (ImageBatchUnpack) | Sends the first four images to four separate outputs. | Route four variations to different preview or processing paths. |
Image Batch Count (ImageBatchCount) | Returns the total number of images as an integer. | Check how many crops or generated variations reached a point in your workflow. |
Image Batch Slice (ImageBatchSlice) | Returns a list containing a selected range of images. | Keep images two through four from a larger group. |
Image Batch Pick (ImageBatchPick) | Returns one image at a selected position. | Take only the last generated variation. |
Mask Batch Unpack (List) (MaskBatchUnpackDynamic) | Turns a batch or list of masks into a list of individual masks. | Work with separate masks for different regions. |
Choosing Images by Position
Pick uses an index setting. Counting starts at 0, so 0 selects the first image and 1 selects the second. Negative numbers count backward: -1 selects the last image. If the index is outside the available range, the node selects the nearest available image instead. If there are no images, it outputs a tiny blank placeholder rather than a selected image.
Slice uses start and end settings. start is included; end is not. For a five-image batch, start: 1 and end: 4 return the second, third, and fourth images. Negative positions count from the end, so start: -2 and end: 5 return the last two images in that five-image example. A range with no images returns an empty list.
Understanding Empty Fixed Slots
The 4-slot node always provides four output connectors, even when fewer than four images arrive. Unused connectors contain tiny 1 × 1 blank placeholders, not full-size images. If your workflow expects a meaningful image on every connected output, check the batch count first.
The archived README describes this node as having 16 slots, but the preserved node source defines four. This README follows the source.
Troubleshooting ComfyUI-ImageBatchUtils
A fixed output shows a tiny blank image
- Add Image Batch Count before the 4-slot unpack node to see how many images arrived.
- Check which output you connected. If only two images arrived, outputs three and four are placeholders.
- Use Image Batch Unpack (List) when the number of images varies and you do not need four separately wired outputs.
Pick returns a different image than expected
- Remember that the first image has index
0, not1. - Use
-1when you mean the last image. - Check the batch count. An index beyond either end selects the nearest available image rather than producing an error.
Slice returns fewer images than expected
- Check that
endis exclusive. To include the image at index3, setendto at least4. - Check the number of incoming images with Image Batch Count.
- If using negative positions, count backward from the end of that incoming group. A range that resolves to no images produces an empty list.
Crops have different dimensions
This can be expected. Unpacking preserves each item's original size; it does not make all crops the same dimensions. If a later node requires matching image sizes, that requirement must be handled elsewhere in your workflow.
Frequently Asked Questions
Does the extension create or improve images?
No. It organizes images and masks already produced by other nodes.
Should I use the list or 4-slot image unpack node?
Use the list node for an unknown or changing number of images. Use the 4-slot node when you specifically need to connect up to four images to separate workflow paths.
Can the image nodes receive a list instead of a single batch?
Yes. The preserved source handles lists of image batches as well as a single image batch, extracting their images in order.
Will unpacking resize my images or masks?
No. Each extracted item retains its original spatial dimensions.
Why do I see information saying there are 16 fixed outputs?
That appears in the archived README, but the preserved source defines four. The source is the basis for the behavior described here.
Learn More about ComfyUI-ImageBatchUtils
The preserved source snapshot is the reference for the nodes described here. It is particularly useful if you need to check an output type or confirm how an edge case behaves. Because this is a historical archive rather than the actively maintained original repository, descriptions in older copies of its README may not match the preserved code.
