Nodes/ComfyUI-Easy-Media/Timeline Segment Count
ComfyUI Node

Timeline Segment Count

The one-number node your timeline loop has been missing

By yolain·Created 3 months ago·Updated about 17 hours ago· 158
Timeline Segment Count
  • timeline_info
  • COUNT

Some nodes do one thing and do it perfectly. Timeline Segment Count is that node: feed it TIMELINE_INFO from a Timeline Editor and it returns COUNT - the total number of segments on the timeline. That's the entire schema. One input, one output, zero settings.

Why a single number is worth a node

Because it's the loop bound. The pack's timeline workflows are built around processing each segment separately: pull segment N's prompt and media with Timeline Segment Output, generate, repeat. But a loop needs to know when to stop, and if you're hardcoding the segment count you'll re-edit the number every time you change the timeline. Wire COUNT into your loop condition and it follows the timeline automatically - add a shot in the editor, the loop runs one more time, no manual updates.

It's also a cheap sanity check: connect it to a display node and you instantly see whether your timeline has 3 segments or 30 before you start a long batch run.

How it behaves

Straightforwardly. The count is the number of segments the timeline defines - prompt segments on the prompt track, essentially the shots in your storyboard. It's read-only, so there's no way to misconfigure it beyond feeding it stale or empty TIMELINE_INFO. If you get zero when you expect five, the timeline data isn't coming through - usually a disconnected or un-updated Timeline Editor upstream, not a problem with this node.

Install

It ships in ComfyUI-Easy-Media:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Media.git

restart ComfyUI (ComfyUI Manager, "Easy-Media"). No models, no extra dependencies, FFmpeg not even relevant for this one.

The honest take

This is a tiny node, and it's fine that it exists. You could compute a segment count with a generic list-length node if the pack exposed the timeline as a list, but it doesn't - the timeline is a custom structured type, so this accessor is the clean way to get the number without parsing anything yourself. If you're building a timeline-driven loop, it's the difference between a workflow that survives edits and one that quietly generates the wrong number of clips. Pair it with Timeline Segment Output and the loop pattern clicks into place.

CategoryEasyUse/TimelineEditor

Inputs (1)

NameTypeDefaultDescription
timeline_infoTIMELINE_INFO

Outputs (1)

NameTypeDescription
COUNTINT