Nodes/ComfyUI-MakkiTools/GetImageNthCount(已弃用-mki-获取第N张图像)
ComfyUI Node

GetImageNthCount(已弃用-mki-获取第N张图像)

Grab one frame out of a batch

By MakkiShizu·Created about a year ago·Updated 7 months ago· 9
GetImageNthCount(已弃用-mki-获取第N张图像)
  • image
  • IMAGE
Nth_count1

A video is just a batch of frames, and sometimes you want one of them. GetImageNthCount_makki (display name "GetImageNthCount(已弃用-mki-获取第N张图像)") pulls the Nth image out of an image batch - pass it a video's frames or a batch of variations and set the index, and it returns just that one image.

It's marked deprecated in the pack, which sets the tone for this article: the node works, it's trivially simple, and you still probably shouldn't build new workflows on it.

How it works

There's nothing under the hood but a slice: you give it a batch (an IMAGE tensor with several images stacked), set Nth_count to the index you want, and it returns image[N-1 : N] - note the 1-based counting and the fact that the output keeps the batch dimension, so you get a single-image batch rather than a bare image. That matters because most downstream nodes expect a batch, even a one-image one.

Inputs: image (required) and Nth_count (default 1, counting from 1). Output: IMAGE.

Why it's deprecated

Because in a graph tool, "get the Nth item from a batch" is one of those operations every utility pack ends up shipping, and the ecosystem's maintained versions are more comfortable. Packs like Impact Pack (SEGS/image list tools) and the WAS suite have image-list and batch-index nodes with better ergonomics - and unlike this one, they're actively maintained. The author of MakkiTools apparently agreed, and flagged the node rather than letting people build on it unknowingly.

Deprecated doesn't mean it errors out; it keeps running if it's in an existing workflow. But two real-world reasons to move off it:

  • 1-based indexing is where off-by-one bugs are born. "Frame 0" in most tooling is the first frame; here that's Nth_count = 1. Easy to trip over when you're scripting.
  • It's a dead end. If the author removes it in a cleanup release, your workflow breaks for the sake of a slice you could do with any maintained list/index node.

If you're building new

Reach for a maintained batch-selection node from a current pack instead. And regardless of which node you use, remember the batch dimension gotcha: extract a frame from a video batch and you still need to feed the result through whatever your pipeline expects - a "one frame" output that's technically a batch of one is usually fine, but if you pipe it somewhere expecting unbatched data, check the shape.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-MakkiTools
cd ComfyUI-MakkiTools
pip install -r requirements.txt

Restart ComfyUI. Short version: fine for a quick throwaway, deprecated for a reason, and the reason is that the same slice is available in tools that are still being updated.

CategoryMakkiTools

Inputs (2)

NameTypeDefaultDescription
imageIMAGEInput image batch 输入图像批次
Nth_countINT11–61The index of the image to extract (starting from 1) 要提取的图像索引(从1开始)

Outputs (1)

NameTypeDescription
IMAGEIMAGE