Latent Channel Nonlinear Transform
Gates, quantization, and dropout
- latent
- mask
- latent
Latent Channel Nonlinear Transform is where the Skoogeer-Noise pack gets weird on purpose. Where its sibling linear transform rotates and permutes channels smoothly, this one is a bank of eight destructive-ish operations - gating, quantization, hard and soft clipping, and three flavors of dropout - applied to your latent's channels. The results range from "posterized art print" to "the VAE ate a bad mushroom." If you're building glitch aesthetics, datamosh-adjacent looks, or just experimenting with what latent space can be pushed into, this is the node.
The honest framing: these are not fixes. They're disturbances. Each operation mangles channels in a specific way, and the fun (and the usefulness) is in the controlled mangle.
How it works
You pick an operation and it does its thing on selected channels:
- gate_multiply / gate_add - build a per-pixel gate from a random projection and multiply (or add) it into channels. This creates "alive" glitches that track existing image structure instead of blanket noise.
gate_strengthsets the gate's steepness,betaits strength,blur_radiussmooths the gate map. - quantize - rounds values to a fixed quantize_step, giving posterized, flat, vector-art texture.
- clip_hard / clip_soft - clamp values at clip_threshold. Hard = abrupt plastic flattening; soft (tanh-based) = gentler, dreamier compression.
- dropout_zero / dropout_noise / dropout_swap - zero out selected channels, replace them with matched noise, or swap them with other random channels. Zeroing is where you get "missing feature" hallucinations and sudden structure gaps.
Because these hit the latent, not the pixels, the artifacts track what the model is actually representing - one channel might carry a face's structure, and knocking it out makes the face dissolve while the rest of the image stands. That's the "latent" magic and the reason the results look unlike any pixel-space filter.
The controls that keep it sane
- selection_mode -
all,random,top_variance,top_roughness(pick the channels carrying the most texture/detail), or explicitindicesviaselection_indices(comma-separated). This is your surgical control: glitch the texture channels but leave the structural ones alone. - mix - blend between original (0) and transformed (1). Your emergency brake. Almost every "why is this ruined" is fixed by dropping mix to 0.3.
- match_stats - re-normalize each channel's mean/std after the transform. It stabilizes the latent so the sampler doesn't cascade the damage into something unrelated.
Everything else (seed, selection_fraction/count/order) follows the pack's common conventions.
Installing it
It's part of Skoogeer-Noise. ComfyUI Manager: search "Skoogeer-Noise", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
# restart ComfyUI
Standard deps, no downloads.
Gotchas
- Start with
quantizeorclip_soft. They're the least likely to destroy the image and easiest to reason about. Savedropout_zerofor when you're chasing pure chaos. - Dropout ops can nuke a whole image fast. Even at
selection_fraction0.1, zeroing the wrong channel (the structural one) collapses the composition. Usetop_roughness+lowestorder to target fine detail instead of structure. - Turn on
match_statsbefore you panic. A lot of "it's ruined" is actually the channel distribution drifting out of the range the sampler expects; matching stats fixes that without changing the glitch character. - Pair it with
LatentChannelStatsPreviewfrom the same pack - you want to see which channels are about to be mutated before you drop them.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Latent to transform in channel-space. | |
| operation | COMBO | Nonlinear channel-space transform to apply. | |
| seed | INT | 00–18446744073709550000 | Seed for deterministic gating/dropout patterns. |
| gate_strength | FLOAT | 1.000–10 | Slope for gate sigmoid (gate_* operations). |
| beta | FLOAT | 1.00-4–4 | Gate strength for gate_* operations. |
| blur_radius | INT | 00–64 | Blur radius for gate maps (latent pixels). |
| quantize_step | FLOAT | 0.250–10 | Step size for quantize operation. |
| clip_threshold | FLOAT | 2.000–10 | Clip threshold for clip_* operations. |
| selection_mode | COMBO | all | How to choose which channels are transformed. |
| selection_fraction | FLOAT | 1.000–1 | Fraction of channels to select when selection_count is 0. |
| selection_count | INT | 00–4096 | Exact number of channels to select (overrides selection_fraction when >0). |
| selection_order | COMBO | highest | Whether to pick high or low variance/roughness channels. |
| selection_indices | STRING | Comma-separated channel indices to select when selection_mode=indices. | |
| mix | FLOAT | 1.000–1 | Blend factor for the transformed channels (0=off, 1=full). |
| match_stats | BOOLEAN | false | Match per-channel mean/std after the transform (stabilizes latent stats). |
| maskopt | MASK | Optional mask to limit the transform to masked areas. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |