SonarQuantileFilteredNoise
Clip the extremes out of your noise
- custom_noise
- SONAR_CUSTOM_NOISE
Gaussian noise has a long tail. Most of the values sit near zero, but a few extreme outliers show up in every batch, and when they land they act like little bombs in your latent - over-bright spots, speckle, banding that wasn't there in the prompt. SonarQuantileFilteredNoise is a custom noise filter that measures the noise's own distribution and trims those outliers, so what reaches the sampler is a tamer, better-behaved version of whatever noise you fed it.
It works the way the name suggests: compute the quantile bounds of the noise (0.85 by default means the top 15% of values count as extreme), then treat everything beyond the bounds however you like. The default quantile of 0.85 is the author's recommendation for a reasonable starting point - "it really depends on the input and how many of the values are extreme," which is his polite way of saying tune it and look.
The inputs that matter
custom_noise- what to filter. Feed it aSonarCustomNoisechain or another custom-noise node. This is the source you're taming.quantile(default 0.85) - where the cutoff sits.1.0or0.0disables quantile normalization entirely. A negative value flips the logic and treats values closest to zero as the "extremes" - explicitly experimental, but it's how you build noise that's mostly zeros with occasional spikes.strategy- the big one, with 43 choices.clampis the sane default: outliers get pinned to the quantile bounds. The rest are experimental reshaping modes -tanh,sigmoid,sinand friends squash outliers instead of pinning them, andzero/reverse_zeroare for when you plan to add this noise to something else (zero zeroes everything outside the range;reverse_zerokeeps only the outliers). Unless you have a specific effect in mind, leave it onclamp.dim- what dimensions the quantile normalization uses. "global" flattens everything; otherwise it's a dimension index starting at 0. For image latents that's batch=0, channel=1, row=2, column=3. Video latents add a frame dimension.flatten(default true) - flattens before normalizing. Turn it off and rows/columns get a strong influence on the result; the author warns this can look weird.norm_factor/norm_power- applied right around the clipping step.norm_factorscales the input just before clipping,norm_powerraises the absolute value to a power after. Both "generally should be left at the default."factor- overall strength of the generated noise;normalize- the standard default/forced/disabled rebalance-to-1.0 control.
Where it slots in
The output is a SONAR_CUSTOM_NOISE, so it behaves like any other link in the pack's noise chain: feed it into a Sonar sampler, a SamplerConfigOverride with a custom noise input, or NoisyLatentLike. A popular pattern is putting it after an extreme noise type - take a Pyramid or Voronoi source that's too wild, run it through quantile filtering, and get the character without the blowouts.
Installing
It's part of ComfyUI-sonar - install the pack once via ComfyUI Manager (search "ComfyUI-sonar") or git clone https://github.com/blepping/ComfyUI-sonar into custom_nodes/, restart, done. No extra Python packages needed for this one.
One honest warning from the pack's own changelog: quantile normalization internals have been reworked a few times, and the author notes those fixes "will likely change seeds." So if you're chasing a specific look across updates, pin the git revision. Also, if your outputs suddenly look different after updating the pack, the quantile math is the first suspect.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| factor | FLOAT | 1.000-10000–10000 | Scaling factor for the generated noise of this type. |
| custom_noise | SONAR_CUSTOM_NOISE,OCS_NOISE | Custom noise type to filter. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE | |
| quantile | FLOAT | 0.850-1–1 | When enabled, will normalize generated noise to this quantile (i.e. 0.75 means outliers >75% will be clipped). Set to 1.0 or 0.0 to disable quantile normalization. A value like 0.75 or 0.85 should be reasonable, it really depends on the input and how many of the values are extreme. (Experimental) You can also use a negative quantile to consider values closest to 0 to be 'extreme'. |
| dim | COMBO | 1 | Controls what dimensions quantile normalization uses. Dimensions start from 0. Image latents have dimensions: batch, channel, row, column. Video latents have dimensions: batch, channel, frame, row, column. |
| flatten | BOOLEAN | true | Controls whether the noise is flattened before quantile normalization. You can try disabling it but they may have a very strong row/column influence. |
| norm_factor | FLOAT | 1.0000.00001–10000 | Multiplier on the input noise just before it is clipped to the quantile min/max. Generally should be left at the default. |
| norm_power | FLOAT | 0.500-10000–10000 | The absolute value of the noise is raised to this power after it is clipped to the quantile min/max. You can use negative values here, but anything below -0.3 will probably produce pretty strange effects. Generally should be left at the default. |
| normalize_noise | BOOLEAN | false | Controls whether the noise source is normalized before quantile filtering occurs. |
| normalize | COMBO | disabled | Controls whether the generated noise is normalized to 1.0 strength after quantile filtering. |
| strategy | COMBO | clamp | Determines how to treat outliers. zero and reverse_zero modes are only useful if you're going to do something like add the result to some other noise. zero will return zero for anything outside the quantile range, reverse_zero only _keeps_ the outliers and zeros everything else. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SONAR_CUSTOM_NOISE | SONAR_CUSTOM_NOISE | A custom noise chain. |