π― LTX Latent Anchor
Freeze the good mid-sample state and stop late-step drift
- model
- sigmas
- model
Watch a long LTX sampling run and you'll see the same thing every time: the first handful of steps lock in composition and semantics, then the late steps quietly drift - faces subtly change, the scene's physical logic loosens, prompt alignment fades. LTXLatentAnchor is an inference-time regularizer aimed squarely at that late-step drift. It snapshots the model's own representation at a mid-sampling step (when conditioning alignment peaks) and then pulls subsequent computation back toward that cached state, block by block.
The mechanism is what makes it different from the reference-injection nodes in this pack. It's not adding tokens or external images - it hooks the output of transformer_blocks[i].attn1 (video self-attention) and adds a residual that nudges each token's features toward the cached anchor when they're similar enough. The matching uses centered cosine similarity: raw cosine is dominated by common-mode features every token shares (positional encodings, scaffold features), so the node subtracts the per-frame mean first. That leaves identity-specific deviations that actually discriminate.
The inputs that matter
model- required. Returns the same model with per-block attention hooks attached.sigmas- connect this from your scheduler (BasicScheduler, or the STG Guider's schedule). It's the difference between "predictable cache timing" and a fallback that's explicitly described as less reliable.strength(0.10) - pull magnitude. 0.05-0.15 is the typical band. Too high over-damps motion and flattens frame-to-frame variation.cache_at_step(6) - which sampling step locks the anchor. Mid-sampling (3-9 on 13-step schedules) is the sweet spot: conditioning alignment has peaked, fine refinement hasn't started.similarity_threshold(0.50) - minimum centered-cosine similarity for a token to receive pull. Raise to 0.60-0.70 to limit pull to the most similar tokens only.decay_with_distance(0) - per-frame strength decay from frame 0. 0.3-0.5 lets later frames drift more while early frames stay anchored.
That's the simple view. Flip advanced_mode and you get the research knobs - cache_mode (schedule / live_extraction / manual_calls), forwards_per_step, cache_warmup, anchor_frame, depth_curve, block_index_filter. You'll almost never touch these, but the one that matters if you see weirdness: forwards_per_step must match your actual sampler - 1 for distilled CFG=1, 2 for standard CFG>1 (cond + uncond), 3+ for CFG+STG. Get it wrong and the cache fires at the wrong moment.
Where it fits
Chain it on the model path before the sampler: Model β LTXLatentAnchor β Sampler. It coexists with the reference-token and face-anchor nodes - they hook different intervention points and use different sentinel attributes, so they don't collide. It's the basic variant in a family; LTXLatentAnchorAware adds reference-image spatial weighting if you want the pull concentrated on high-energy regions.
Install is the pack-wide clone (10S_Nodes into custom_nodes, restart, or ComfyUI Manager β "10S-Comfy-nodes"), no extra deps, LTX2-class models only. If your LTX clips look great at step six and wander by step thirteen, this is the node that was built for that exact feeling.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | LTX2 model to patch with per-block attention hooks. The returned model has the same behavior plus identity anchoring during sampling. | |
| sigmasopt | SIGMAS | Connect from your sigma scheduler (e.g. BasicScheduler, LTX's STG scheduler). Required for predictable cache timing β without it the node falls back to manual_calls mode which is less reliable. | |
| strengthopt | FLOAT | 0.100β5 | Magnitude of pull toward cached anchor state. 0.05-0.15 typical. 0.10 is default. Higher values can over-damp motion or flatten frame-to-frame variation. |
| cache_at_stepopt | INT | 60β100 | Sampling step at which to lock the anchor (snapshot the model's representation as the stable target). Mid-sampling values (3-9 on 13-step schedules) work best β peak conditioning alignment moment before fine refinement begins. |
| similarity_thresholdopt | FLOAT | 0.500β1 | Minimum centered-cosine similarity for a token to receive pull. Lower = broader effect (more tokens pulled). 0.50 is balanced; raise to 0.60-0.70 to limit pull to most similar tokens only. |
| decay_with_distanceopt | FLOAT | 0.000β1 | Per-frame strength decay from frame 0 (anchor frame) to last frame. 0 = uniform across all frames. 0.3-0.5 lets later frames drift more freely while keeping early frames anchored. |
| bypassopt | BOOLEAN | false | If True, the node passes the model through unchanged. Useful for A/B comparison without rewiring. |
| advanced_modeopt | BOOLEAN | false | Toggle to expose research/diagnostic parameters: cache_mode, forwards_per_step, cache_warmup, anchor_frame, depth_curve, block_index_filter, debug. |
| cache_modeopt | COMBO | schedule | How cache timing is determined. schedule (default, requires sigmas wired): cache fires at the sigma corresponding to cache_at_step. live_extraction: no cache, regenerate target every call (softer effect). manual_calls: cache fires after cache_warmup block calls (fallback when sigmas not wired). |
| forwards_per_stepopt | INT | 11β8 | How many model forward passes occur per sampling step. 1 for distilled CFG=1 (typical). 2 for standard CFG > 1 (cond + uncond). 3+ for CFG+STG. Affects cache timing math when in schedule mode. Variable-CFG schedules use a single approximate value. |
| cache_warmupopt | INT | 1440β5000 | Number of block calls before cache fires (when cache_mode=manual_calls). 144 β 3 sampling steps Γ 48 blocks at CFG=1. Used as fallback when sigmas isn't connected. |
| anchor_frameopt | INT | 00β256 | Which frame's features to use as anchor source. 0 = first frame (the conditioning frame in i2v workflows β recommended). Set higher to anchor to a different frame. |
| depth_curveopt | COMBO | flat | Per-block strength scaling across the 48 transformer blocks. flat = uniform (recommended default). ramp_up = stronger late blocks (handles refinement). ramp_down = stronger early blocks (handles semantics). late_focus = quadratic late emphasis. middle = strongest in middle blocks. |
| block_index_filteropt | STRING | Limit hooks to specific blocks, e.g. '10-30' or '5,7,15-20'. Empty = all 48 blocks. Useful for ablation studies; rarely needed in normal use. | |
| debugopt | BOOLEAN | false | Verbose per-block diagnostic output during sampling. Shows cache state, similarity stats, and per-block timing. Helpful first time tuning a workflow. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | β |