ComfyUI-ImageBatchUtils
Lightweight ComfyUI custom nodes for working with image and mask batches. No dependencies beyond ComfyUI itself.
Nodes (6)
Count your images in ComfyUI before they bite you
Pick one image out of a batch, no index math required
Python slicing you already know, minus the sharp edges
Fixed lanes for a fixed-size batch
The batch-unpack node this pack is really about
The mask version of the unpack node you already need
ComfyUI-ImageBatchUtils
Lightweight ComfyUI custom nodes for working with image and mask batches. No dependencies beyond ComfyUI itself.
Nodes
🧩 Image Batch Unpack (List)
ImageBatchUnpackDynamic
Unpack an image batch [B, H, W, C] into a list of individual images, each [1, H, W, C]. Works with any batch size.
This is the most commonly useful node — connect it after any node that outputs a batch and pipe the list into nodes that accept
LIST[IMAGE].
🧩 Image Batch Unpack (16-slot)
ImageBatchUnpack
Unpack an image batch into 16 fixed output slots. If the batch has fewer than 16 images, extra slots contain empty (zero) tensors. Useful when you need to route individual images to different nodes in the graph.
🔢 Image Batch Count
ImageBatchCount
Returns the batch size as an INT. Useful for conditional logic or debugging.
✂️ Image Batch Slice
ImageBatchSlice
Slice an image batch by start/end indices (like Python slicing). Supports negative indexing.
👆 Image Batch Pick
ImageBatchPick
Pick a single image from a batch by index. Supports negative indexing (e.g., -1 for the last image).
🧩 Mask Batch Unpack (List)
MaskBatchUnpackDynamic
Unpack a mask batch [B, H, W] into a list of individual masks, each [1, H, W].
Installation
Via ComfyUI Manager (recommended)
Search for ComfyUI-ImageBatchUtils in the Manager.
Manual
cd ComfyUI/custom_nodes
git clone https://github.com/YOUR_USERNAME/ComfyUI-ImageBatchUtils.git
No additional pip packages needed.
Use Case: SEGSPreview Duplicate Fix
A common workflow issue: SEGSPreview outputs a batch of cropped segment images, but some downstream nodes process each image in the batch independently, causing duplicates. Using ImageBatchUnpackDynamic you can split the batch and work with each segment individually.
License
MIT