Nodes/raylight/LTXV PerStep StatNorm Patcher (Ray)
ComfyUI Node

LTXV PerStep StatNorm Patcher (Ray)

Forcibly tame LTX latent statistics to a target mean and std

By komikndr·Created about a year ago·Updated 2 days ago· 409
LTXV PerStep StatNorm Patcher (Ray)
  • ray_actors
  • ray_actors
factors0.9, 0.75, 0.0
target_mean0.00
target_std1.00
percentile95.0
clip_outliersfalse

LTXV PerStep StatNorm Patcher (Ray) is the sibling of the pack's AdaIN patcher, with a different philosophy: instead of matching a reference latent's statistics, it normalizes the denoised latent toward an explicit target mean and standard deviation - a numeric anchor rather than a reference clip. If AdaIN is "match this footage's grade," StatNorm is "hold the latent's energy at these exact values."

It's the same per-step machinery: after CFG, at each sampling step, the node rescales the latent so its mean becomes target_mean and its std becomes target_std, blended at a per-step factor. The statistical-norm flavor has one genuinely useful refinement, though: it computes the normalization from a percentile-filtered view of the data (default 95th percentile), so the mean/std are measured over the bulk of the distribution rather than being dragged around by extreme outliers. When clip_outliers is on, those outliers get clamped to the normalized bounds instead of being left to wander.

The inputs

  • factors - comma-separated per-step blend schedule, default 0.9, 0.75, 0.0 (same convention as the AdaIN patcher: strong early, off by step 3). This is the "how hard and for how long" control.
  • target_mean - where the latent's mean lands (default 0). This effectively controls overall brightness/level of the latent distribution.
  • target_std - how much spread the latent keeps (default 1). Higher std = more contrast/energy in the latent, which tends to produce punchier, more varied output; lower = flatter, more compressed.
  • percentile - the percentile window used for the robust statistics (default 95). Raise toward 99 if extreme values are skewing the normalization; lower toward 50 for a tighter, mean-only kind of anchoring.
  • clip_outliers - clamp out-of-window values at the normalized bounds instead of transforming them. On for when you want hard limits on extreme latent values.

When it earns its keep

Targeted cases: when a workflow's latents drift into a regime that produces blown-out or crushed frames, StatNorm's explicit target gives you a hard floor and ceiling. If you're seeing "LTX washes out over long clips," raising target_std slightly while holding target_mean can restore punch. If output looks over-saturated and contrasty, that's target_std too high relative to your content.

Honest take: for most people the AdaIN patcher is the more intuitive tool, because a reference clip already is your target. StatNorm shines when you have no clean reference - when you want to enforce a numeric standard regardless of content, or when you're matching stats across a batch of clips that share a look. The robust percentile handling also makes it the more stable choice when latents have stray extreme values, since a single blown channel won't hijack the whole normalization.

Both patchers run inside the Ray workers, compose with the other LTXV patches, and - because it's per-step - cost nothing at load time; the normalization runs with the sampler. Install: ComfyUI Manager → "raylight", or clone + pip install -r requirements.txt. No model downloads.

CategoryRaylight/LTXV

Inputs (6)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
factorsSTRING0.9, 0.75, 0.0
target_meanFLOAT0.00-10–10
target_stdFLOAT1.000.01–10
percentileFLOAT95.050–100
clip_outliersBOOLEANfalse

Outputs (1)

NameTypeDescription
ray_actorsRAY_ACTORS