π― Gimbal Latent Truncation
The one-line variance shrink for cleaner renders
- latent
- reference_batch
- stabilized_latent
- truncation_telemetry
GimbalTruncation is the lightest-weight member of the pack's stabilizer family: a single mathematical operation that pulls a latent's values toward its mean. If GimbalLatentStabilizer is the full flight-stabilizer system, this is the one knob version - and for a lot of "why does my image look fried?" problems, one knob is all you need.
How it works
It implements the classic truncation formula z' = ΞΌ + Ο(z β ΞΌ): take every value, measure its deviation from the mean, shrink that deviation by the factor truncation_psi, and add it back to the mean. At Ο = 1.0 the latent passes through unchanged. Below 1.0 you're compressing outliers toward the center - which is exactly what you want when high CFG or aggressive steering has shoved values into the extreme tails where the decoder produces black outlines, plastic skin, and harsh ringing. Above 1.0 it exaggerates variance for a punchier, grittier look.
Two inputs set it up: latent and truncation_psi (default 0.8). Then channel_adaptive (default on) computes the mean per channel instead of as one global scalar - meaningfully better, since each channel has its own healthy range. There's also an optional reference_batch: wire in a batch of representative latents and it uses that batch's empirical mean as the centroid instead of the input's own mean, which is the right call when your input is a single oddball frame. Outputs: stabilized_latent and truncation_telemetry.
How to set it
The doc's calibration guide is actually useful: 0.80β0.85 for strong cleanup on high-CFG pushes, 0.88β0.92 as the everyday production value (keeps fine texture, kills ringing), 1.0 for passthrough/baseline, 1.1β1.3 to exaggerate texture for stylized looks. Compared to the full Stabilizer it's cheaper to run and easier to reason about - it's one formula, no SVD - so it's a reasonable default first thing to try when a render comes out harsh.
Installing
Standard pack install: ComfyUI Manager β search "Gimbal-comfy" β install β restart, or git clone https://github.com/FormAndNoise/Gimbal-comfy into ComfyUI/custom_nodes. Dependencies are torch/numpy/pillow, already bundled; nothing to download. The README's clone URL is stale - the live repo is FormAndNoise/Gimbal-comfy.
Where people get burned
Same trap as its bigger sibling, in miniature: too low a Ο and you get the "plastic smooth" look - the variance shrink becomes a blur, because you've compressed not just the outliers but the whole signal envelope. Keep Ο β₯ 0.8 unless you're specifically chasing a template-like baseline. And note the honest ceiling: truncation rescues latents that drifted out of the healthy range, but it can't fix a render where the underlying generation is bad - it's a cleanup pass, not a model swap. The pack is young and thinly documented in the wild, so treat the calibration table as a starting point and tune against your own checkpoint; the formula itself is standard GAN-era truncation, well-trodden, and this is one of the more trustworthy nodes in the suite.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | β | |
| truncation_psi | FLOAT | 0.800β3 | 1.0 = identity; <1.0 = pulls toward core mean (cleaner, less chaotic); >1.0 = exaggerates variance |
| channel_adaptive | BOOLEAN | true | Computes mean per-channel rather than globally |
| reference_batchopt | LATENT | Optional batch to compute empirical centroid mean |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| stabilized_latent | LATENT | β |
| truncation_telemetry | DICT | β |