Nodes/ComfyUI-Przewodo-Utils/LTX VAE Drift Fix
ComfyUI Node

LTX VAE Drift Fix

Rescuing video frames from the color-shift curse

By przewodo·Created about a year ago·Updated 4 months ago· 4
LTX VAE Drift Fix
  • original
  • decoded
  • corrected
modecovariance_global
strength1.00
low_percentile0.1
high_percentile99.9
max_samples1000000
calibration_size512

If you've generated video with LTX or any fast video VAE, you know the specific horror: the model should preserve your reference frame's colors, but what comes out of the VAE decode has drifted - contrast shifted, saturation wrong, skin tones that turned into something radioactive. The community has been complaining about color shifts and light leaks in LTX since 0.9.5, and the fix that keeps getting reinvented is color matching: take the drifted image, and statistically force it to look like the reference.

This node is that fix, packaged properly. You feed it your original reference image and the decoded (drifted) frame, and it returns a corrected version whose color distribution has been mapped back toward the original.

How it works

It's not a filter that guesses what "good color" is. It's a statistical remapping between two images - the ground truth (original) and the problem child (decoded). The node supports four matching modes, each a different way to force one distribution onto another:

  • covariance_global (default) - matches the RGB mean and covariance, i.e. the full color distribution. Because it works on distribution rather than pixel correspondence, it handles cases where the decoded frame isn't perfectly aligned with the reference. This is the one to reach for first.
  • mean_std_global - simpler: match mean and standard deviation per channel. Good for brightness/contrast drift.
  • percentile_global - matches percentile ranges, controlled by low_percentile / high_percentile. Best when the drift is in the extremes (blown highlights, crushed shadows).
  • affine_rgb_global - fits a least-squares affine transform between the two images' pixel values. Strong when the decode has a near-linear color error.

A few engineering details keep it fast: it downscales to calibration_size (default 512) to estimate the transform, caps the sample count at max_samples, and the strength input blends between the corrected and original output, so you can apply 50% of the fix instead of a full remap.

The inputs that matter

  • original - the reference with the colors you actually want.
  • decoded - the drifted frame to fix.
  • mode - which matching algorithm; start with covariance_global.
  • strength - 0 to 1 blend of the fix. Default 1 (full correction).
  • low_percentile / high_percentile - only matter in percentile mode.
  • max_samples / calibration_size - speed/accuracy dials; leave them alone unless it's slow.

Output: corrected, an IMAGE.

Installing it

Part of ComfyUI-Przewodo-Utils. ComfyUI Manager → search the pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/przewodo/ComfyUI-Przewodo-Utils.git

Restart. It needs torch (which you already have) and nothing else.

Where people get tripped up

The classic mistake is feeding the node the wrong reference. If you give it the model's own input frame after it's already been resized or color-graded, you're teaching it to match that - make sure original is the true reference you care about, and decoded is the thing you want to change.

Second, per-frame correction is the naive loop: for a whole video you'd feed each drifted frame in with the same original. That works but can flicker frame-to-frame because each frame gets an independent remap. If you're treating a full clip, a global transform computed once and applied to all frames is steadier - which is why the pack pairs this with its video-node side. And remember strength exists: a 100% correction can over-flatten. Dial it back to 0.5–0.8 and you often get the color back without the plasticky look.

CategoryLTX/Color

Inputs (8)

NameTypeDefaultDescription
originalIMAGE
decodedIMAGE
modeCOMBOcovariance_global4 options: covariance_global, percentile_global, mean_std_global, affine_rgb_global
strengthFLOAT1.000–1
low_percentileFLOAT0.10–10
high_percentileFLOAT99.990–100
max_samplesINT100000010000–3000000
calibration_sizeINT51264–1024

Outputs (1)

NameTypeDescription
correctedIMAGE