Wan Image Batch Frame Select
Grab one frame out of a video batch without the index math
- images
- image
- selected_index
- batch_count
- report
Sometimes you just need a single frame out of an image batch - the last frame of a generated clip to chain into the next segment, the first frame to anchor an I2V, or one frame from the middle to check how the motion's holding up. IAMCCS_WanImageBatchFrameSelect ("Wan Image Batch Frame Select") is the no-math way to get it.
It takes an IMAGE batch, picks one frame according to a mode, and returns that single image plus the index it chose and the total batch size. That last part is the quiet hero: batch_count and selected_index as outputs mean you can wire them into logic downstream without a separate batch-size node.
The four modes
last(default) - the final frame. This is the one you want for carryingprev_samplesforward or grabbing the end of a shot.first- the opening frame. Your I2V anchor.index- the frame atframe_index(clamped to the batch if you overshoot).from_end_index- the frameframe_indexslots back from the end. Handy when you want "the 3rd-to-last frame" without computing the count yourself.
For everything else there's report, a plain string telling you which mode ran and what index it landed on.
When you'd actually use it
This is a plumbing node, and it shines in the exact spot you'd guess: at the tail of a video chain. Decode a chunk, select its last frame, and feed that frame into the next chunk's conditioning or end-frame encoder. In IAMCCS's long-video loops you'll often see it right after a VAE decode, replacing the "take last image of batch" pattern that otherwise needs a small custom script or a Crop-style hack.
It's also genuinely useful for debugging - grab first or index from a decoded batch and route it to a preview node to inspect a specific frame without dumping the whole clip.
Install
Part of IAMCCS-nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git
or install via ComfyUI Manager by searching "IAMCCS", then restart. No models, no dependencies, nothing heavy - the pack's compatibility floor (ComfyUI ≥ 0.3.0, Python ≥ 3.12, Torch ≥ 2.8) is all you need to care about.
One caveat
It raises an error on an empty batch, which is correct but worth knowing: if the node upstream produced zero frames, this is where your workflow fails loudly instead of silently. That's a feature. And remember frame_index is 0-based in index mode - the third frame is 2, not 3, which is the one off-by-one everyone hits on day one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| mode | COMBO | last | 4 options: last, first, index, from_end_index |
| frame_index | INT | 00–100000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| selected_index | INT | — |
| batch_count | INT | — |
| report | STRING | — |