LTEx LTXV Context Windows
LTEx LTXV Context Windows, explained
- model
- MODEL
LTX video models are the speed tier of local video generation - a 13B clip in seconds where Wan takes minutes - but they share a problem with every diffusion video model: the longer your clip, the more the transformer attends to everything at once. Past the model's native context you get worse coherence, and eventually an OOM that kills a five-minute queue. Context windows are the fix, and this node is how you turn them on for LTXV and LTX-2.
It does exactly one thing: takes a model and returns a model with sliding-window sampling enabled. Drop it between your checkpoint (or UNET loader) and the KSampler, and sampling happens in overlapping windows of context_length frames, blended back into a single coherent clip. This is the same trick AnimateDiff-Evolved used to break its 16-frame wall back in the day - split, overlap, blend - just done natively on LTX's DiT.
How it works
Under the hood this is a self-contained extraction of Comfy-Org/ComfyUI#13325, the upstream context-windowing PR. The node stuffs an IndexListContextHandler into the model's model_options["context_handler"] slot and leans on ComfyUI's own wrapper extension points - it doesn't edit or monkeypatch core, and it works whether or not that PR has landed in your copy of ComfyUI. When the base model already provides context-window hooks (newer cores do), the pack defers to them instead of fighting them.
One thing worth knowing: the handler only kicks in when your clip is actually longer than context_length. If you're sampling 80 frames with a 145-frame window, the node logs "Not using context windows since context length exceeds input frames" and your video is untouched. That's not a bug, it's the guard doing its job.
The settings that matter
- context_length (default 145, in real pixel frames): the window size. It must be
8n + 1frames (LTX's VAE compresses temporally 8:1), and the node snaps your input to the nearest valid value. Bigger windows = better coherence, more VRAM. - context_overlap (default 40): how many frames adjacent windows share. This is your seam control - too little overlap and you'll see the blend, too much and you're paying for redundant compute. Snaps to a multiple of 8.
- freenoise (default on): FreeNoise noise shuffling. It re-uses shuffled noise across windows, which is most of what makes the seams invisible. Leave it on until you have a reason not to.
- retain_first_frame (default off): keeps the first latent frame in every window, in both conditioning and noise. Turn this on for inplace-style LTX-2 first-frame conditioning and AnimateDiff-style image-to-video - it stops the start reference from degrading as windows slide away from it.
The collapsed advanced settings - context_schedule (uniform vs static), context_stride, closed_loop for looped schedules, fuse_method (pyramid by default), and split_conds_to_windows for regional conditioning via ConditionCombine - are exactly the knobs you should ignore for your first few runs. fuse_method pyramid is the safe default; "relative" is the other one people actually reach for.
Installation
It's a one-node pack (three nodes, same package), by drozbay - the community member who's been keeping RES4LYF alive through 2026 and runs the WanTests sampler-comparison harness, so this is a low-level person shipping clean code. Two ways in:
- ComfyUI Manager: search "LTExperiments" and install.
- Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/drozbay/LTExperiments
Then restart ComfyUI. No extra Python dependencies, no model files to download - it needs nothing beyond a ComfyUI with native LTXV/LTX-2 support.
Gotchas
- Your clip's frame count gets snapped to
8n+1and overlap to multiples of 8. If your numbers look "wrong" in a log, that's why. - IC-LoRA and LTXVAddGuide guides still work under windowing - the pack strips guide frames from the working latent and reinserts them only into the windows they overlap, regenerating the per-window attention metadata. That's the part most windowing implementations get wrong.
- The node outputs a single MODEL socket; wire it straight into your sampler. Nothing else in the workflow changes.
If your long LTX generations have been falling apart past a few seconds, this is the first node to try. It's one of those rare pieces of tooling that's both simple and genuinely solves the thing it claims to.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model to apply context windows to during sampling. | |
| context_length | INT | 1451–16384 | The length of the context window in real frames. Must be 8*n + 1. |
| context_overlap | INT | 40 | The overlap of the context window in real frames. |
| context_schedule | COMBO | standard_uniform | Step-dependent scheduling algorithm for context windows. |
| context_stride | INT | 1 | The stride of the context window; only applicable to uniform schedules. |
| closed_loop | BOOLEAN | false | Whether to close the context window loop; only applicable to looped schedules. |
| fuse_method | COMBO | pyramid | The method to use to fuse the context windows. |
| freenoise | BOOLEAN | true | Whether to apply FreeNoise noise shuffling, improves window blending. |
| retain_first_frame | BOOLEAN | false | Retain the first latent frame in every context window (may help retain initial reference). |
| split_conds_to_windows | BOOLEAN | false | Whether to split multiple conditionings (created by ConditionCombine) to each window based on region index. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | The model with context windows applied during sampling. |