Nodes/ComfyUI/LTXV Duration Predictor
ComfyUI Node Runs on cloud

LTXV Duration Predictor

Stop guessing frame counts — let the model time your shot

By Comfy-Org·Created 4 years ago·Updated about 5 hours ago· 128,055
LTXV Duration Predictor
  • model
  • positive
  • duration_head
  • num_frames
  • seconds
frame_rate24.00
min_seconds1.0
max_seconds20.0

Every LTX user has sat there with length set to 97 frames again, wondering if the shot actually wants to be 97 frames. The LTXV Duration Predictor removes the guess: it reads your prompt's text embeddings and predicts the natural duration of the shot in seconds - no sampling, no VAE, no waiting through a generation to find out your clip is either a still life or chopped off mid-motion. It's the "how long should this be" knob, answered by the model itself.

This is a very new node - it landed in ComfyUI core in mid-August 2026 alongside LTX 2.5 support - and it's a surprisingly elegant bit of plumbing. It's built for the current-generation LTX model (Lightricks' 2.4/2.5 era, not the 0.9.x 2B or the 13B), so it also hints at how Lightricks now treats duration as a property of the prompt rather than a number you pick.

How it works

The trick is that the head runs on the caption connector output - the same processed text embeddings the diffusion model consumes - not on the video. In the source, the node calls the model's preprocess_text_embeds exactly the way sampling does, splits the result into video tokens and audio tokens, and feeds both into a tiny network: two projection layers, one cross-attention pooler with a single learnable query, and a small MLP that outputs a number in log space (the exp of a scalar). One forward pass, no denoising steps, done.

That head is genuinely small - a few hundred thousand parameters - so this costs nothing on top of already having the model loaded. What you get back is a raw duration in seconds, which the node then converts using your frame_rate and clamps to [min_seconds, max_seconds] before snapping it to the VAE's causal 8k + 1 frame grid (97, 121, 145…). Snapping floors down, and if that undershoots your minimum it bumps up to the next grid point. The num_frames output is always a valid LTX frame count, which is the whole point.

The inputs that matter

  • positive (CONDITIONING) - the prompt. This is the entire basis of the prediction; the head never sees your image, your motion, or your audio. Long, detailed LTX-style prompts give it more to work with.
  • duration_head (MODEL_PATCH) - loaded with ModelPatchLoader, which reads from ComfyUI/models/model_patches/. The file is ltx-2.5-duration-head-bf16.safetensors from the Lightricks/LTX-2.5 HuggingFace repo. Plug something else in and the node throws a ValueError - it checks the patch is actually a DurationHead.
  • frame_rate (default 24), min_seconds (1), max_seconds (20) - the guardrails. Note the default ceiling is 20 seconds, which caps the frame count hard even if the model "wants" more.
  • model - your loaded LTX model; it's what owns the caption connector.

Outputs

Two: num_frames (INT), the clamped, grid-snapped frame count you wire into EmptyLTXVLatentVideo's length input (or any LTX latent creator), and seconds (FLOAT) - the raw, unclamped prediction. That second output is the honest one: if seconds says 34 but num_frames gives you 20 seconds' worth, the model wanted a longer shot than your max_seconds allowed. Watch it when you're tuning the limits.

Getting it

It ships with ComfyUI core - no install. You only need the head checkpoint itself, and it lives in models/model_patches/ (a folder that ModelPatchLoader, still marked experimental, watches). Because this is week-old tech, expect the workflow examples to evolve quickly; check Lightricks' official 2.5 workflows if ComfyUI's example gallery hasn't caught up.

Gotchas

Two real ones. First, the prediction is prompt-only - it can't know your subject is a race car or a sleeping cat, so the duration it picks reflects your text, not your content. Treat it as a smart starting point, not a contract. Second, the version naming is a mess (a recurring Lightricks habit): the node docs call it the "2.4 duration head" while the checkpoint and PR are tagged 2.5. Don't get cute trying to mix it with older LTX models - it's built for the current generation. And if you're on an older LTX, this node simply doesn't apply to you.

Categoryconditioning/video_models

Inputs (6)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
duration_headMODEL_PATCHLTX 2.4 duration head loaded with ModelPatchLoader.
frame_rateFLOAT24.001–120
min_secondsFLOAT1.00.5–120
max_secondsFLOAT20.00.5–120

Outputs (2)

NameTypeDescription
num_framesINT
secondsFLOATRaw (unclamped) predicted duration.