ComfyUI Node

EzFlex-TimeLine

Do the long-video arithmetic before you spend an hour generating

By blackbossokok·Created 2 months ago·Updated 8 days ago· 4
EzFlex-TimeLine
  • timeplan
  • video
    ◄config{}►

    Wan's native context is 81 frames - about five seconds at 16fps - and that hasn't moved. Push past it without doing anything clever and you get warps, looping motion and drift. So anything longer is generated in segments and stitched, which sounds like a workflow problem and is actually an arithmetic problem first: how many segments, how long each one, and how many frames the model has to be asked for so each segment lands on its temporal grid.

    EzFlex-TimeLine is that arithmetic, in a node. It generates nothing and stitches nothing. Feed it a total duration and a segment length and it hands the loop a frame count per segment, plus the overlap you need for the join, plus the segment total so the loop knows when to stop. The reason to use it rather than a spreadsheet is the grid: these models only accept frame counts of the form B + S·k, and the constants differ (Wan is 1+4k, LTX 1+8k, MiniMax H3 5+17k). Off-grid frame counts are one of the classic "why is my clip one frame short / why does the model complain" bugs, and hand-deriving 17k+5 for six segments is where people give up and just generate 81 frames forever.

    The inputs that matter

    Seven widget fields, and you'll touch four:

    • model - minimax_h3 (default), wan, or ltx. This selects the grid and the model's per-frame maximum.
    • total - the finished duration in seconds. Default 30.
    • segment - seconds per segment. Default 5, which is roughly one native Wan window and a sane place to start.
    • fps - default 24, but the model picks its own: Wan starts at 16, the other two at 24. Set it to what your video node is actually running, or your timing math is decorative.
    • overlap (default 22) and tolerance (0–5): the frames of the previous segment that get carried into this one, and slack on top. The overlap is snapped up to the model's grid, so you don't have to know what "22" means in grid terms - you say how much blending you want and it rounds to something legal.
    • align - align distributes the leftover frames across segments so the total lands where you asked; strict rounds each segment on its own, which respects your per-segment length exactly but can overshoot the model's maximum.

    Optional inputs: index (0-based, forced to a socket - wire EzFlex-LoopStart.index here, or an Easy-Use forLoop index) and video (the list of generated segments; the panel previews segment i with item i, with a big preview on top and the splice track underneath).

    Outputs are three integers: frames - the frame count for the segment at index, which includes the overlap, because that's what you ask the model for - overlap_frames, and segments, the total segment count. segments is the one you wire into EzFlex-LoopEnd's round counter when you don't know up front how many rounds you'll need; a 30-second clip in 5-second segments is six segments, so the counter is 6.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/blackbossokok/Comfyui-EzFlex-Presets
    # restart ComfyUI - or Manager, search "EzFlex"
    

    mutagen is the only extra dependency (pip install -r requirements.txt). No models ship with it and none are needed; TimeLine is pure planning.

    Troubleshooting

    • frames comes out 0. Your index is past the end of the plan. That's deliberate - it's the loop's "this segment doesn't exist, wrap up" signal - and it usually means the loop ran more rounds than there are segments (a mismatched round counter), or the index input is being fed by the wrong node. Feeding some other node's index output here is a real reported mistake, and it looks exactly like this.
    • The panel flags a segment as over the limit. genFrames exceeded the model's window (Wan 121, LTX 257, H3 362). Shorten segment, drop overlap, or use align instead of strict. Generating it anyway is how you get the warping everyone attributes to the model.
    • The video is five seconds too long, or the segments don't line up. Check fps first - a plan computed at 24 and rendered at 16 is off by a third - then check whether the overlap is actually being trimmed at the join. TimeLine tells you how much to overlap; the thing doing the stitching has to actually blend it.
    • Index unwired means segment one, every round. If your loop isn't changing index, you get the first segment's frame count forever. Wire the loop's index output here, and the round number becomes the segment number.
    CategoryEzFlex

    Inputs (3)

    NameTypeDefaultDescription
    configSTRING{}Timeline view state (merge view, zoom, ...).
    timeplanoptEZFLEX_TIMEPLANOptional plan from EzFlex-TimePlan. Without it the timeline uses a default empty plan.
    videoopt*Per-segment videos (list) for preview: item i = segment i.

    Outputs (0)

    No outputs