Nodes/ComfyUI-sonar/SonarWaveletNoise
ComfyUI Node

SonarWaveletNoise

The poor man's wavelet noise, done right

By blepping·Created 3 years ago·Updated 15 days ago· 49
SonarWaveletNoise
  • sonar_custom_noise_opt
  • custom_noise
  • SONAR_CUSTOM_NOISE
factor1.000
rescale0.000
octaves4
octave_height_factor0.500
octave_width_factor0.500
octave_scale_modeadaptive_avg_pool2d
octave_rescale_modebilinear
post_octave_rescale_modebilinear
initial_amplitude1.000
persistence0.500
height_factor2.000
width_factor2.000
update_blend1.000
update_blend_modelerp
normalize_noisefalse
normalizedefault

SonarWaveletNoise is the rare node where the author just tells you exactly how it works, in four steps: generate noise, scale it down 50%, scale it back up to the original size, and subtract the scaled version from the original. Scaling down and back up blurs the noise, so subtracting it is essentially sharpening it - boosting the high-frequency texture and suppressing the smooth low-frequency content. Then it does that over multiple octaves, each at a different scale, and stacks the results.

That's "actual wavelet noise" in the sense of the Wikipedia concept - an additive multi-octave construction - rather than a true filterbank decomposition. Which is exactly why it's the friendly one in the wavelet family: unlike SonarWaveletFilteredNoise and SonarScatternetFilteredNoise, this node has no pytorch_wavelets dependency. It's pure scaling and subtraction, so it just works out of the box.

The inputs that matter

  • octaves (default 4) - how many scale levels to stack. Each octave works at a coarser scale than the last, so more octaves = broader frequency range covered. Negative values run the octaves in reverse, which the author says "may produce weird results" - so that's basically a feature.
  • initial_amplitude (default 1.0) and persistence (default 0.5) - octave strength. The first octave uses initial_amplitude, then each subsequent octave multiplies by persistence, so 0.5 gives you 1.0, 0.5, 0.25, 0.125. Lower persistence means the coarse octaves fade out faster and the result stays high-frequency.
  • octave_height_factor / octave_width_factor (both 0.5) - how much each octave's noise is scaled down before the blur-and-subtract. 0.5 is the classic half-size; the two are separate so you can sharpen only one axis.
  • height_factor / width_factor (both 2.0) - how much the working size shrinks after each octave. Careful: values below 1 grow the working size, and the tooltip warns it's "very easy to reach absurd latent sizes with only a few octaves."
  • octave_scale_mode (adaptive_avg_pool2d) - the blur method for the downscale; octave_rescale_mode (bilinear) - the upscale; post_octave_rescale_mode (bilinear) - how each octave's output gets stretched back to the actual latent size. These are your texture-quality knobs; area and bislerp are worth a try for softer results.
  • update_blend (default 1.0) and update_blend_mode (lerp) - how original - blurred blends with the original noise. With normal wavelet noise you use 100% of the sharpened result; the blend controls are there for the "what if it's only half sharpened" experiments.
  • custom_noise (optional) - supply your own base noise instead of Gaussian. Fine print: all octaves get generated at maximum scale and then cropped, which the tooltip warns "may be slow."

Output is a SONAR_CUSTOM_NOISE feeding a Sonar sampler, SamplerConfigOverride, or NoisyLatentLike.

What it's actually good for

Sharpened, high-frequency noise is what you want when Gaussian feels too bland - it gives the sampler a stronger high-frequency kick at the start of sampling, which can translate into crisper detail in the final image. It's also the natural base for the pack's frequency tricks: run it through SonarQuantileFilteredNoise to tame any extremes, or schedule it in with SonarScheduledNoise so it only owns part of the sampling range. Start with the defaults, then nudge persistence up if you want more mid-frequency energy or down if you want pure grit.

Installing

Ships with ComfyUI-sonar. ComfyUI Manager → search "ComfyUI-sonar" → install, or git clone https://github.com/blepping/ComfyUI-sonar into custom_nodes/, restart. No extra packages, no model files - the rare wavelet node that doesn't need pytorch_wavelets. And the pack's usual honesty applies: noise types are "best-effort," internals have shifted between versions, so pin the git revision if a particular look matters to you.

Categoryadvanced/noise

Inputs (18)

NameTypeDefaultDescription
factorFLOAT1.000-10000–10000Scaling factor for the generated noise of this type.
rescaleFLOAT0.0000–10000When 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.
octavesINT4-100–100Number of octaves to generate. You can use a negative number here to run the octaves in reverse order though it may produce weird results/not work very well.
octave_height_factorFLOAT0.5000.001–10000Wavelet noise works by scaling noise by this factor in each octave, then scaling it back up to the original size. After that, the scaled noise is subtracted from the original noise.
octave_width_factorFLOAT0.5000.001–10000Wavelet noise works by scaling noise by this factor in each octave, then scaling it back up to the original size. After that, the scaled noise is subtracted from the original noise.
octave_scale_modeCOMBOadaptive_avg_pool2dScaling mode used within each octave to produce the scaled noise. By default this will be scaling down that octave's noise.
octave_rescale_modeCOMBObilinearScaling mode used within each octave to scale the noise back up to that octave's original size.
post_octave_rescale_modeCOMBObilinearScaling mode used to scale the output of an octave back up to the actual latent size.
initial_amplitudeFLOAT1.000-10000–10000Basically the strength an octave gets added to the total. This will be scaled by persistance after each octave.
persistenceFLOAT0.500-10000–10000Multiplier applied to amplitude after each octave. 0.5 means the first octave uses initial_amplitude, the second uses half of that and so on.
height_factorFLOAT2.0000.001–10000Scaling factor for height, calculated after each octave. 2.0 means divide by two. Note: It's possible to use values below 1 here but be careful as it's very easy to reach absurd latent sizes with only a few octaves.
width_factorFLOAT2.0000.001–10000Scaling factor for width, calculated after each octave. 2.0 means divide by two. Note: It's possible to use values below 1 here but be careful as it's very easy to reach absurd latent sizes with only a few octaves.
update_blendFLOAT1.000-10000–10000Controls how original_noise - scaled_noise is blended with original_noise. The default is to use 100% original_noise - scaled_noise.
update_blend_modeCOMBOlerpControls how the enhanced noise from each octave is blended with that octave's raw noise. With normal wavelet noise there's no blending and you use 100% enhanced noise.
normalize_noiseBOOLEANfalseControls whether the noise source is normalized before wavelet filtering occurs.
normalizeCOMBOdefaultControls whether noise is normalized to 1.0 strength.
sonar_custom_noise_optoptSONAR_CUSTOM_NOISE,OCS_NOISEOptional input for more custom noise items. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE
custom_noiseoptSONAR_CUSTOM_NOISE,OCS_NOISEOptional: Custom noise input. If unconnected will default to Gaussian noise. Note: When connected, the noise for all octaves will be generated at the maximum scale and then cropped which may be slow. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE

Outputs (1)

NameTypeDescription
SONAR_CUSTOM_NOISESONAR_CUSTOM_NOISEA custom noise chain.