Time Segment List (TJ)
Chop a long video timeline into overlapped chunks without doing the math
- segment_list
- segment_count
Time Segment List (TJ) is a tiny calculator that turns "I have a 120-second clip and want to process it in 20-second chunks with a little overlap" into a ready-made list of segments - no mental arithmetic, no off-by-one errors. It's aimed at video workflows where you cut a long clip into sections and apply different prompts or processing per section: think LTX-2 or Wan extension passes, or frame-by-frame inspection of a long take.
How it works
You give it four numbers and it walks the timeline:
start_sec- where the first segment begins.duration_sec- how long each segment is.total_sec- the length of your clip.overlap_sec- how much of the previous segment's tail the next segment reuses.
The step between segment starts is duration_sec − overlap_sec. So with start 8, duration 20, overlap 3, you get: segment 1 = 8→28, segment 2 = 25→45, segment 3 = 42→62, and so on. Overlap exists so prompt-based segment workflows don't drop continuity at the seams.
Two settings shape the tail end. include_over_total ("true" default) lets a final segment run past total_sec rather than dropping it, so the whole clip is covered; set it to "false" and any segment whose end exceeds the total is cut. format_mode picks how the list is rendered: range_only (just "1. 8 - 28 sec" lines), with_formula (adds the inputs as a header), or csv (a proper index,start_sec,end_sec table you can paste into a spreadsheet or a CSV-parsing node).
Inputs and outputs that matter
The three required inputs (start_sec, duration_sec, total_sec) plus overlap_sec are all you'll touch. Outputs:
segment_list(STRING) - the formatted segment list, one per line.segment_count(INT) - how many segments were generated, handy for loop counts.
The error cases
The node is upfront about nonsense input. If duration_sec isn't greater than overlap_sec, the step becomes zero or negative and you get an ERROR: message in segment_list with segment_count of 0 rather than an infinite loop. If total_sec is smaller than start_sec, it returns "No segments". Both are text you can actually read in a debug node, which is more than most utility nodes give you.
Install
ComfyUI Manager → Install Custom Nodes → search TJ_NODE, or:
cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE
Restart ComfyUI. No models, no dependencies. It lives under ✨ TJ_Node/Utility (the brief lists it there; the pack's README file tree also mentions an Etc category - if you can't find it, check both).
Bottom line
This is a pure text generator - there's nothing magical about it, and if you never work in video you'll never need it. But for segment-based video work it removes a whole class of arithmetic mistakes, and the segment_count INT output plugs straight into a loop so your workflow runs exactly as many passes as there are segments.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| start_sec | INT | 00–999999 | — |
| duration_sec | INT | 201–999999 | — |
| total_sec | INT | 1201–999999 | — |
| overlap_secopt | INT | 30–999999 | — |
| include_over_totalopt | COMBO | true | 2 options: true, false |
| format_modeopt | COMBO | with_formula | 3 options: range_only, with_formula, csv |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| segment_list | STRING | — |
| segment_count | INT | — |