Nodes/ComfyUI-LTXVideo/πŸ…›πŸ…£πŸ…§ LTXV Adain Latent
ComfyUI Node Runs on cloud

πŸ…›πŸ…£πŸ…§ LTXV Adain Latent

Color-match LTX latents to fix drift between stages and clips

By LightricksΒ·Created 2 years agoΒ·Updated about a month agoΒ· 3,956
πŸ…›πŸ…£πŸ…§ LTXV Adain Latent
  • latents
  • reference
  • LATENT
β—„factor1.00β–Ί
β—„per_framefalseβ–Ί

Color drift is the quiet tax on multi-stage video workflows, and LTXVAdainLatent is the eraser. It uses AdaIN - Adaptive Instance Normalization - to push one latent's color and contrast statistics toward a reference latent's. In plain terms: it makes clip A look like clip B tonally, without touching the content. When your two-stage LTX render comes out of the upscaler slightly warmer or washed out compared to the base pass, or your stitched segments don't quite match, this snaps them back into agreement.

AdaIN is a well-worn trick from style transfer. The insight is that a lot of "look" - overall color cast, brightness, contrast - lives in the mean and standard deviation of the feature (here, latent) channels. Re-normalize one signal to carry another's mean and std and you've transplanted the tonal character while leaving structure alone. Doing it in latent space means the correction rides along before decode, so you're not color-grading pixels after the fact.

How it works

The node computes the per-channel mean and standard deviation of the reference latent, then rescales the latents input to match those statistics. The factor controls how far it goes, and per_frame decides whether the match is computed over the whole clip at once or frame by frame.

The inputs and outputs that matter

  • latents (LATENT) - the clip you want to correct.
  • reference (LATENT) - the clip whose color/contrast you want to adopt. This is your "make it look like this" target.
  • factor (FLOAT, default 1, range -10 to 10) - strength. At 1 you fully adopt the reference's statistics; lower values blend partway back toward the original; you rarely need to go far past 1. It's the main knob.
  • per_frame (BOOLEAN, optional, default false) - off, it matches using stats pooled across the whole sequence (steadier, preserves intended changes over time). On, it matches each frame independently, which nails per-frame consistency but can flatten deliberate lighting changes through the clip. Leave it off unless you specifically need frame-locked color.

Output is a single corrected LATENT.

How to install it

ComfyUI Manager is the path the README recommends: Ctrl+M β†’ Install Custom Nodes β†’ search LTXVideo β†’ Install β†’ restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Lightricks/ComfyUI-LTXVideo

then restart ComfyUI; it lands under Lightricks β†’ latents. The node itself is cheap; the LTX-2 pipeline around it is what needs 32GB+ VRAM and 100GB+ disk.

Common issues & troubleshooting

The correction is too aggressive / washes out the image. Pull factor down below 1. Full matching forces the target's exact statistics, which can overshoot if the two clips are very different in content. A partial match (say 0.5–0.8) often looks more natural.

Colors flicker frame to frame after turning on per_frame. Ironically, per-frame matching can introduce temporal flicker when frames legitimately differ in content, because each one gets normalized to its own stats. If you see shimmer, switch per_frame off and let it pool across the sequence.

It's not fixing the drift. Make sure the reference is actually the look you want - people sometimes wire the drifted clip in as the reference by accident. Reference = the good-looking one; latents = the one to fix.

Deliberate lighting change got flattened. That's per_frame (or a very high factor) enforcing uniform tone. If your shot is supposed to get darker or shift color over time, keep per_frame off and ease the factor so the intended change survives.

CategoryLightricks/latents

Inputs (4)

NameTypeDefaultDescription
latentsLATENTβ€”
referenceLATENTβ€”
factorFLOAT1.00-10–10β€”
per_frameoptBOOLEANfalseβ€”

Outputs (1)

NameTypeDescription
LATENTLATENTβ€”