π Image Batch Pick
Pick one image out of a batch, no index math required
- images
- IMAGE
Let's be honest up front: ComfyUI core already has a node that grabs one image out of a batch - Image From Batch - so this node is not strictly necessary. What ImageBatchPick adds is convenience, not a missing capability: negative indexing, tolerance for list inputs, and the refusal to crash when you point at an index that doesn't exist. If you've ever set an index widget to 4 on a batch of 3 and watched the whole run die, you know why that's worth a custom node.
What it does
Two inputs:
images- theIMAGEbatch.index(INT, default0) - which image to pull out.
One output: a single IMAGE shaped [1, H, W, C], original size kept.
index = 0 is the first image, index = -1 is the last, and Python-style negative counting works throughout - -2 is second-to-last. Out-of-range indices don't throw; the node clamps to the nearest valid image, so index = 99 on a batch of 3 quietly returns image 3 rather than killing your queue. Handy, though worth knowing about so it doesn't hide a bug in a "works but wrong" state. An empty input returns a tiny 1x1 placeholder instead of crashing.
When you'd actually use it
- "Upscale the last one." A batch of 8 grid images, you like the last,
-1finds it without you counting. - "Grab frame N." A video or frame-sequence batch where you want one specific frame to route somewhere else - a detail pass, a separate save, a side-by-side compare.
- After an unpack. The sibling nodes in this pack hand you a list; this node picks a single item out cleanly and hands it to a node that wants a single batch-shaped tensor.
It also handles list inputs via INPUT_IS_LIST, so it works after SEGSPreview and friends without you flattening anything by hand.
The honest comparison
Core's Image From Batch is actually the more powerful node in one way: it takes an index and a length, so it can return a slice of several images. ImageBatchPick is strictly one image. But it wins on the ergonomics that annoy you daily - negative indexing (core wants you to do the math), no index-off-by-one, and forgiving behavior on bad input. If you're already deep in this pack, reach for Pick and don't feel guilty. If you're on a fresh graph and only need one image, core's node is fine and you don't need this install at all.
Install
Same as the rest of the family - nothing heavy:
cd ComfyUI/custom_nodes
git clone https://github.com/xuxiao305/ComfyUI-ImageBatchUtils
restart ComfyUI, done. Or search ComfyUI-ImageBatchUtils in ComfyUI Manager and let it install all six nodes at once. No models to download, no requirements.txt conflicts, MIT licensed. This is about as friction-free as custom nodes get - which is the pack's whole selling point.
Gotchas
That clamping is a double-edged sword. It saves you from crashes, but it also means "I asked for image 9 and got image 3" won't throw an error - it'll just silently give you the wrong image. If correctness matters, feed the batch through ImageBatchCount first and gate on the real size before you pick.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| index | INT | 0-9999β9999 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |