Mie Image Select Frame ๐
Pick one image out of a batch by index
- images
- image
ComfyUI hands images around in batches - a video's frames, a set of variations, the outputs of a loop. Often you want just one of them: the first frame, the last frame, the seventh. MieImageSelectFrame does exactly that. Give it a batch and an index, get back the single image at that position.
It's part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, filed under ๐ Loop.
Why you'd reach for it
An IMAGE in ComfyUI is really a stack of images (a batch tensor), and plenty of nodes emit several at once. The moment you want to treat one of them specially - preview the last frame of a generated clip, grab the first frame to use as an I2V starting image, pull the middle frame as a thumbnail - you need a way to index into the stack. That's this node.
It lands in the Loop category because it's the natural companion to iterative processing: when you're stepping through a batch, "give me the current one" is a select-by-index operation. But it's just as handy standalone, anywhere a batch shows up and you only want a slice of one.
How it works
Two inputs, one output. It takes an images batch and an integer index, and returns the image at that index as a single-image output. The index range runs from -9999 to 9999, and the negative end is the useful tell: negative indices count from the end, Python-style, so -1 is the last frame, -2 the second-to-last. That's how you grab "the last frame" of a clip without knowing how many frames it has.
The inputs and outputs that matter
images(IMAGE, required) - the batch to pick from.index(INT, required, default 0, range -9999 to 9999) - which one.0is the first,-1is the last.image(IMAGE, output) - the single selected frame. Wire it into a preview, a save, an encoder, wherever.
Installing it
ComfyUI Manager โ search ComfyUI-MieNodes โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
then restart. No model download. Nodes appear under ๐ MieNodes.
Common issues & troubleshooting
Index out of range. If you ask for frame 50 of a 10-image batch, there's nothing there. Behavior on an overshoot depends on the implementation (it may clamp, wrap, or error) - either way, the fix is to know your batch size. Use -1 when you just want "the last one," which is safe regardless of count.
You got one image but wanted a range. This selects a single frame, not a slice. For assembling many frames into one viewable image, pair it with MieImageGrid.
The frames aren't in the order you expect. Batch order is set by whatever produced the images (sampler, loader, video decoder). If 0 isn't the frame you thought, the upstream ordering is the thing to check, not this node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | โ | |
| index | INT | 0-9999โ9999 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | โ |