Nodes/ComfyUI-JakeUpgrade/LTXV2 Frame Count JK๐Ÿ‰
ComfyUI Node

LTXV2 Frame Count JK๐Ÿ‰

The frame-count police for LTX Video โ€” round up or it won't run

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 147
LTXV2 Frame Count JK๐Ÿ‰
    • ltxv2_frame_count
    โ—„frame_count241โ–บ

    Every video model has a pet peeve about frame counts, and LTX Video's is harsh: the frame count must be a multiple of 8 plus 1 - 97, 161, 241, 513... - or the model flat-out rejects it. No rounding, no forgiveness. That's the entire reason LTXV2 Frame Count JK exists: you tell it the frames you want, and it tells you the closest valid number.

    The one input

    • frame_count - how many frames you're hoping for. Default 241, which is a solid ~8-second clip at 30fps, and also exactly the kind of number that's already on the grid.

    What it does

    It rounds up to the nearest value matching N * 8 + 1 and hands you the result on ltxv2_frame_count (INT). Want 200 frames? You get 209. Want 240? 241. The math is ceil((n - 1) / 8) * 8 + 1, so it never rounds you down below your target - undershooting a duration is worse than overshooting, since the model doesn't accept anything off-grid anyway.

    This matches the LTX-2 and LTX-2.3 spec precisely: the community and Lightricks both document frame counts divisible by 8 plus 1 as a hard constraint. The KB's LTX guide is explicit that off-grid values fail rather than round, which is exactly the failure this node prevents.

    Why you'd reach for it

    The obvious use is standing in front of a KSampler: instead of typing 241 and hoping, drop this node in front and feed it the result of your own "duration ร— fps" math. Want exactly 6 seconds at 30fps = 180 frames? The node gives you 185 - the nearest valid value above your target - and the sampler runs. That's the whole job: never let an off-grid number reach the model.

    It's also a batch-timesaver: when Jake's LTXV2 Cuts workflows compute per-segment frame counts from scene-cut timings, this node (and its sibling logic) guarantees every segment lands on a valid count, so a 12-cut edit doesn't fail on cut #9. Added to the pack in v2.6.6, it pairs with the Wan Frame Count node in the same video module - Wan wants multiples of 4 plus 1, LTX wants multiples of 8 plus 1.

    Install

    The usual:

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

    Then restart. No models here. One gotcha to internalize: this node makes the number valid, not good. A huge jump like 200 โ†’ 209 is the node doing its job - if you wanted a specific duration, set the frame count so that the rounded result lands where you want, or compute it from seconds ร— fps and let the node fix the residue.

    Category๐Ÿ‰ JK/๐Ÿฆ‰ Video

    Inputs (1)

    NameTypeDefaultDescription
    frame_countINT2411โ€“16385Input frame count to calculate LTXV2-compatible frame count

    Outputs (1)

    NameTypeDescription
    ltxv2_frame_countINTโ€”