Extract Image
Grab one frame out of an image list without slicing a batch
- images
- image
ComfyUI has two different "many images in one wire" concepts, and confusing them is a rite of passage. A batch is a single tensor with a batch dimension - you can index it with math. A list is a Python list of tensors - a proper sequence of separate images, which is what compositor and list-producing nodes emit. If you've ever plugged a list into a node that expected a batch (or vice versa) and watched it explode or silently pick one image, you know the pain. UC_ExtractImage is the node that makes list-indexing explicit and painless: it pulls one image by index out of a native image list.
The socket is images, with the tooltip "Image list ordered by compositor layer order" - that ordering hint is the real clue to where this node lives. The pack's staged compositor returns layered results as lists, and when you want to work on one layer alone - upscale it, inpaint it, examine it - you extract it by index first. The index input (default 0) is a plain integer, and the output is a single image tensor with a batch size of one, which is exactly the shape downstream nodes want.
The mechanism is unglamorous and correct: it takes the list, bounds-checks your index, returns collection[index], and validates that what it found is a proper [1, height, width, channels] image. Two errors tell you when you've wired it wrong: an out-of-range index gives you "found N image(s)", and feeding it a batch tensor instead of a list raises "requires an image list" - which is honestly the most useful error in this pack, because it forces you to fix the data shape at the source instead of papering over it.
When you'd actually use it: any time a node gives you a list output and you want one member. The classic pairings are with the pack's UC_StagedIndividualComposites (which returns per-layer results) and with multi-frame compositors. It's also a nice teaching node - extracting one image from a list and comparing it to a batch-slice makes the batch-vs-list distinction concrete in about thirty seconds.
The caveat is the mirror image of the error above: this node does not slice batches. If your data is a [N, H, W, C] tensor from a batch-producing node, this isn't the tool - you want an index/batch node for that, or a list-to-batch conversion first. Wire the right data shape in and this node is boring in the best way.
Install is pack-standard: Manager search "ComfyUI-UtilsCollection" or git clone into custom_nodes. No models, no downloads. It's a three-socket utility that earns its keep the first time a compositor hands you a list and you need one layer.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Image list ordered by compositor layer order. | |
| index | INT | 00–9223372036854776000 | Index of the image to extract. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |