Nodes/LTExperiments/LTEx LTXV Add Per-Window Guide
ComfyUI Node

LTEx LTXV Add Per-Window Guide

LTEx LTXV Add Per-Window Guide

By drozbay·Created 3 months ago·Updated 3 months ago· 6
LTEx LTXV Add Per-Window Guide
  • positive
  • negative
  • vae
  • latent
  • image
  • attention_mask
  • positive
  • negative
rel_index-1
strength1.00

Here's the subtle trap that motivated this node: once you're sampling LTX with context windows, a normal guide stops working the way you expect. The stock LTXVAddGuide pins your guide image to one absolute position in the video - say, frame 0. With windowing, that guide only shows up in the first window; every later window slides on without it, and your reference quietly stops influencing the generation.

LTEx LTXV Add Per-Window Guide fixes that by inserting the guide at the same relative position in every window. It's the difference between "anchor this moment of the video" and "anchor every chunk of the video." If you're doing long LTX clips with a first-frame reference - keeping a character or a look consistent across 300+ frames - this is the node that makes the anchor actually stick.

It's one of three nodes in the drozbay/LTExperiments pack, alongside the Context Windows node it depends on and the conditioning-carried guide experiment. Same install, no extra dependencies; more on that below.

How it works

The guide never touches your working latent. It rides on the conditioning (the pack's ltex_perwindow_guides key), and the context-windowing engine appends it to each window's token sequence, manufactures the matching keyframe_idxs, guide_attention_entries, and denoise mask for that window, then strips it back off the output. Physically the guide is a tail token whose position is purely its RoPE coordinate - which is why rel_index can go negative: it's a real position before the window's first frame, not an index counted from the end.

Because it's conditioning-carried, you can chain several of these nodes. Each one carries its own image, position, and strengths, applied independently within every window.

The inputs that matter

  • rel_index (default -1, in latent frames): where the guide sits inside each window. 0 is the window's first frame; positive values push it deeper into the window; negative places it just before the first frame. Since the engine also prepends a causal-fix anchor frame, -1 lands one step before that anchor - handy for "condition the window's start from just outside it."
  • strength (default 1.0): accepts a single value for every window, or a list of per-window strengths. This is the interesting one. A list's first value applies to the first window, second to the second, and so on, with the last value clamped onto any remaining windows - and 0 for a window skips the guide there entirely. The pack maps the list to windows by the standard_static layout, so it stays consistent even when you sample with a uniform schedule. The String to Float List node from ComfyUI-KJNodes is the easy way to build the list.
  • image: the guide. Multiple frames fill consecutive positions starting at your rel_index.
  • vae and latent: the VAE encodes the guide; the latent is only used to size that encode, never modified.
  • attention_mask (optional): limits where the guide applies.

Outputs are just positive and negative conditioning - the node doesn't modify or output a latent, so wire its conditionings into your sampler's as usual.

Installation and gotchas

Same story as the rest of the pack - this one is called the pack's "experimental" node, but it's installable the normal way:

cd ComfyUI/custom_nodes
git clone https://github.com/drozbay/LTExperiments

restart, or use ComfyUI Manager and search "LTExperiments". No Python deps, no model downloads; you just need native LTXV/LTX-2 in ComfyUI.

Two things bite people:

  1. Forgetting the Context Windows node. This node requires the LTEx LTXV Context Windows node on the same model - without it, nothing consumes the per-window guide key, and you get no guide at all, silently. Add both or don't bother.
  2. Strength-list math. Count your windows, not your frames. A list shorter than the window count clamps to the last value, so if your last window is getting a guide you meant to disable, that's why. Set an explicit 0 at the end.

If you're wondering where a guide actually landed, set the environment variable LTEX_DEBUG=1 before starting ComfyUI and it logs the window index, position, and strength of every injection. That's the pack's own debug switch, and it beats guessing.

Long-story-short: stock guide for short clips, this node once you cross into context-window territory. They're not competing - the per-window one exists precisely because the stock one can't follow you across the seam.

CategoryLTExperiments

Inputs (8)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAEVAE used to encode the guide image.
latentLATENTThe latent being sampled. Used to size the guide encode; not modified.
imageIMAGEGuide image. Multiple frames fill consecutive positions starting at index.
rel_indexINT-1-16384–16384Position of the guide within every window, counted in latent frames. 0 is the window's first frame; use negative values to place it before the first frame.
strengthFLOAT1.000–1How strongly the guide influences each window. Accepts a single value, or a list of per-window strengths (e.g. from a String to Float List node) indexed by window order, clamping to the last value; set a window's value to 0 to skip the guide for that window.
attention_maskoptMASKOptional mask limiting where the guide applies.

Outputs (2)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING