LTXV PerStep AdaIN Patcher (Ray)
Pin LTX color and lighting to a reference, one denoising step at a time
- ray_actors
- reference
- ray_actors
LTXV PerStep AdaIN Patcher (Ray) is a consistency tool for LTX video: it forces the statistics of the generated latent to match a reference latent, step by step, so your output holds the same color, brightness, and contrast character as whatever you're referencing. Think of it as adaptive instance normalization (AdaIN) applied inside sampling instead of as a post-process.
Here's the mechanism. During each denoising step, after CFG produces the "denoised" result, the node computes that latent's per-channel mean and standard deviation and rescales it to match the mean and std of your reference latent - the classic AdaIN operation (normalize your data to zero mean/unit variance, then multiply by the reference's std and add its mean). The result is then blended with the original at a per-step factor. Because it runs inside the sampler, the model keeps getting fed latents whose color/luminance statistics are anchored to the reference - which is a much stronger form of consistency than grading the finished video afterward.
The inputs
- factors - comma-separated floats, default
0.9, 0.75, 0.0. This is a schedule across steps: step 1 normalizes at 90% strength, step 2 at 75%, and from step 3 on it's off. The idea is to lock in the reference's look early while the structure is forming, then let the model finish freely. One factor per step, and the last value repeats for the remainder. - reference - a
LATENT. The anchor whose statistics you're matching. For I2V or V2V workflows, that's your input image/video's latent; for a consistent series, it's whatever frames define the look you want to preserve. - per_frame (optional) - match statistics per frame instead of over the whole clip. Use it when the reference is a single frame and you want every output frame individually anchored to it (the node repeats a single-frame reference across the clip's frames). The tooltip's constraint matters: the reference must have at least as many frames as your latent unless it's a single frame.
When to reach for it
This is the node for "the motion is great but the color drifts" and "I want the output to keep the grade of my input footage." LTX drifts - color and lighting wander across long clips - and AdaIN-per-step is a well-known countermeasure in the ComfyUI video community. If your reference is a graded still or a color-graded video, this is how you carry that through generation rather than approximating it in post.
Two caveats. First, the default 0.9, 0.75, 0.0 schedule is a good starting point but the tail matters: leaving a small factor on late steps (e.g. 0.9, 0.75, 0.1) keeps color locked at the cost of a flatter, less "inventive" result. Second, if output looks too tied to the reference - the model clearly working against a leash - that's the sign to drop early factors, not the late ones. It composes with the other LTXV patches and runs inside the Ray workers, so wire ray_actors through it into the sampler.
Install: ComfyUI Manager → "raylight", or clone + pip install -r requirements.txt. No model downloads.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| factors | STRING | 0.9, 0.75, 0.0 | — |
| reference | LATENT | — | |
| per_frameopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ray_actors | RAY_ACTORS | — |