Nodes/ComfyUI-VideoHelperSuite/Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’
ComfyUI Node Runs on cloud

Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’

Get Image Count

By KosinkadinkΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 1,727
Get Image Count πŸŽ₯πŸ…₯πŸ…—πŸ…’
  • images
  • count

Get Image Count does one small thing: it takes a batch of images and tells you how many are in it, as a plain integer. In a video workflow, where an "image" input is really a stack of frames, this is how you turn "however many frames are flowing through here" into a number you can actually do math with.

It sounds trivial, and it is - but it's the kind of trivial that unblocks a whole pattern. The moment your frame count stops being a fixed thing you typed and starts being something the graph measures, you can build workflows that adapt to whatever clip you feed them.

Why you'd reach for it

The frame count of a batch is constantly needed downstream and annoying to hardcode. You loaded a video of unknown length, thinned it with select_every_nth, ran it through some processing, and now you want to feed the resulting frame count into something - a loop counter, a Video Combine loop calculation, a math node that derives duration, a label. Rather than guess or count by hand, you wire this node's output in and it's always right, for any input.

It pairs naturally with the split, duplicate, and select nodes in the same suite: those change how many frames you have, and this is how you read the result back out to verify or to drive the next step.

How it works

There's no configuration. It reads the length of the batch along the frame axis and emits it. That's the entire node.

Inputs and outputs

  • images (IMAGE) - the batch you want counted.
  • count (INT, output) - the number of images in that batch.

Wire the count output into anything expecting an integer.

Installing it

On comfy.icu, VideoHelperSuite is already in the image - the node's ready to use.

Locally: ComfyUI Manager β†’ search ComfyUI-VideoHelperSuite β†’ install β†’ restart. Or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite

then restart ComfyUI. This is Kosinkadink's suite, so if you do any video work it's likely already installed.

Common issues

Honestly, there's not much to go wrong here - it's a length read. The one conceptual thing worth internalizing: "image" in ComfyUI means a batch, and this counts the batch. A single still is a batch of one and returns 1. A 48-frame clip returns 48. If you're surprised by the number, the surprise is upstream - something changed your frame count (a load cap, a select-every-nth, a split) and this node is faithfully reporting reality.

If the node isn't in your menu at all, that's VideoHelperSuite failing to import rather than anything about this node - check the ComfyUI startup log (a missing ffmpeg or a NumPy version clash are the usual culprits) and reinstall through Manager.

CategoryVideo Helper Suite πŸŽ₯πŸ…₯πŸ…—πŸ…’/image

Inputs (1)

NameTypeDefaultDescription
imagesIMAGEβ€”

Outputs (1)

NameTypeDescription
countINTβ€”