SonarAdvancedDistroNoise
Sample your noise from any probability distribution torch ships
- sonar_custom_noise_opt
- SONAR_CUSTOM_NOISE
Gaussian noise is the boring default because the math says it's right - but "right" and "interesting" are different goals, and SonarAdvancedDistroNoise exists for the second one. It replaces the sampler's noise with samples drawn from any of 26 probability distributions that PyTorch's torch.distributions provides: uniform, beta, cauchy, exponential, gamma, gumbel, laplacian, poisson, geometric, studentt, weibull, vonmises, and more. Heavy-tailed distributions like Cauchy or Laplacian throw in occasional extreme values that give generations a different texture than smooth gaussian; discrete ones like Poisson or geometric produce grainy, quantized patterns. If you've ever wondered what your latent would look like born from a Gumbel distribution - well, now you can find out.
It's a pick-one node, which is the good news. The distribution dropdown selects your flavor, and the rest of the inputs are organized so you only touch the ones relevant to your choice:
factorandrescale- the pack-wide strength controls.rescalenon-zero makes this item plus its chained items scale to add up to that value.quantile_norm- default 0.85, and you should probably leave it near there. Distributions with heavy tails will otherwise blow out the noise range, and this clips outliers to the given quantile. Set to 1.0 or 0.0 to disable. (Experimental bonus: negative values treat values closest to zero as the outliers instead.)quantile_norm_mode- what dimensions the normalization considers;batch(the default) flattens first, thenonflat_*modes can inject strong row/column influence.result_index- some distributions return a batch of samples; this picks which one to keep. Negative indexes count from the end.- Then the long tail:
normal_mean/normal_stdfor normal,cauchy_median/cauchy_sigma,gamma_concentration/gamma_rate,poisson_rate,uniform_low/uniform_high,beta_concentration0/1, and on down the list. Only the params for your selected distribution actually matter; the rest sit idle.
One heads-up: lots of these parameter fields are strings rather than floats (e.g. "0.5 0.5" for multi-valued ones like dirichlet_concentration), so when you paste a value from the docs, keep the quotes.
Output is SONAR_CUSTOM_NOISE, chained through the optional sonar_custom_noise_opt input, and consumed wherever a custom noise input is accepted - a Sonar sampler, NoisyLatentLike, or SamplerConfigOverride. Install is the standard one-liner with no model files:
cd ComfyUI/custom_nodes
git clone https://github.com/blepping/ComfyUI-sonar
The trap is the same one the whole pack sets: ancestral/SDE samplers are the ones that inject noise, so that's where your exotic distribution actually appears - pair this with Euler a or DPM++ SDE. And combine it with the quantile_norm default before judging a distribution, because a raw Cauchy sample without clipping will just nuke the latent. Start with laplacian or cauchy, keep the quantile on, and see what texture does to your output before you go full vonmises.
Inputs (57)
| Name | Type | Default | Description |
|---|---|---|---|
| factor | FLOAT | 1.000-10000–10000 | Scaling factor for the generated noise of this type. |
| rescale | FLOAT | 0.0000–10000 | When non-zero, this custom noise item and other custom noise items items connected to it will have their factor scaled to add up to the specified rescale value. When set to 0, rescaling is disabled. |
| distribution | COMBO | uniform | Sets the distribution used for noise generation. See: https://pytorch.org/docs/stable/distributions.html |
| quantile_norm | 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 distribution and how many of the values are extreme. (Experimental) You can use a negative quantile to consider the values closest to zero as extreme. |
| quantile_norm_mode | COMBO | batch | Controls what dimensions quantile normalization uses. By default, the noise is flattened first. You can try the nonflat versions but they may have a very strong row/column influence. Only applies when quantile_norm is active. |
| result_index | STRING | -1 | When noise generation returns a batch of items, it will select the specified index. Negative indexes count from the end. Values outside the valid range will be automatically adjusted. You may enter a space-separated list of values for the case where there might be multiple added batch dimensions. Excess batch dimensions are removed from the end, indexe from result_index are used in order so you may want to enter the indexes in reverse order. Example: If your noise has shape (1, 4, 3, 3) and two 2-sized batch dims are added resulting in (1, 4, 3, 3, 2, 2) and you wanted index 0 from the first additional batch dimension and 1 from the second you would use result_index: 1 0 |
| exponential_lambd | FLOAT | 1.00 | — |
| cauchy_median | STRING | 0.0 | — |
| cauchy_sigma | FLOAT | 1.00 | — |
| geometric_p | FLOAT | 0.25 | — |
| log_normal_mean | FLOAT | 1.00 | — |
| log_normal_std | FLOAT | 2.00 | — |
| normal_mean | FLOAT | 0.00 | — |
| normal_std | FLOAT | 1.00 | — |
| beta_concentration0 | STRING | 0.5 | — |
| beta_concentration1 | STRING | 0.5 | — |
| continuous_bernoulli_probs | STRING | 0.5 | — |
| dirichlet_concentration | STRING | 0.5 0.5 | — |
| fisher_snedecor_df1 | STRING | 1.0 | — |
| fisher_snedecor_df2 | STRING | 2.0 | — |
| gamma_concentration | STRING | 1.0 | — |
| gamma_rate | STRING | 1.0 | — |
| gumbel_loc | STRING | 1.0 | — |
| gumbel_scale | STRING | 2.0 | — |
| inverse_gamma_concentration | STRING | 1.0 | — |
| inverse_gamma_rate | STRING | 1.0 | — |
| kumaraswamy_concentration0 | STRING | 1.0 | — |
| kumaraswamy_concentration1 | STRING | 1.0 | — |
| laplacian_loc | STRING | 0.0 | — |
| laplacian_scale | STRING | 1.0 | — |
| lkjcholesky_dim | INT | 3 | — |
| lkjcholesky_concentration | STRING | 1.0 | — |
| lrmvariate_normal_loc | STRING | 0.0 0.0 | — |
| lrmvariate_normal_cov_factor | STRING | 1.0 0.0 | — |
| lrmvariate_normal_cov_diag | STRING | 1.0 1.0 | — |
| mvariate_normal_loc | STRING | 0.0 0.0 | — |
| mvariate_normal_cov_multiplier | FLOAT | 1.00 | — |
| pareto_scale | STRING | 1.0 | — |
| pareto_alpha | STRING | 1.0 | — |
| poisson_rate | STRING | 1.5 | — |
| relaxed_bernoulli_temperature | FLOAT | 0.75 | — |
| relaxed_bernoulli_probs | STRING | 0.66 | — |
| relaxed_onehotcategorical_temperature | FLOAT | 1.50 | — |
| relaxed_onehotcategorical_probs | STRING | 0.33 0.66 | — |
| studentt_loc | STRING | 0.0 | — |
| studentt_scale | STRING | 1.0 | — |
| studentt_df | STRING | 1.0 | — |
| uniform_low | FLOAT | 0.00 | — |
| uniform_high | FLOAT | 1.00 | — |
| vonmises_loc | STRING | 1.0 | — |
| vonmises_concentration | STRING | 1.0 | — |
| weibull_scale | STRING | 1.0 | — |
| weibull_concentration | STRING | 1.0 | — |
| wishart_df | STRING | 2.0 | — |
| wishart_cov_size | INT | 2 | — |
| wishart_cov_multiplier | FLOAT | 1.00 | — |
| sonar_custom_noise_optopt | SONAR_CUSTOM_NOISE,OCS_NOISE | Optional input for more custom noise items. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SONAR_CUSTOM_NOISE | SONAR_CUSTOM_NOISE | A custom noise chain. |