Nodes/ComfyUI-sonar/SonarNoiseImage
ComfyUI Node

SonarNoiseImage

The one sonar node that works on plain images, not latents

By blepping·Created 3 years ago·Updated 14 days ago· 49
SonarNoiseImage
  • image
  • custom_noise_opt
  • IMAGE
noise_typegaussian
seed0
noise_min0.000
noise_max1.000
noise_multiplier0.500
channel_modeRGB
blend_modesimple_add
blend_strength0.500
overflow_modeclamp
greyscale_modefalse
pure_noise_modefalse
dtypedefault
cpu_noisetrue
normalizetrue

SonarNoiseImage is the odd one out in this pack, and that's its charm: every other node operates on latents in the sampling pipeline, but this one takes and returns plain IMAGE tensors. It adds noise to an image, or - flip one toggle - generates pure noise images from nothing but a shape. It's the node you use when you want the pack's noise types outside of sampling: for textures, for previews, for building masks, for feeding something downstream that wants pixels.

What it does

Feed it an image and a noise_type, and it generates noise and combines it with your image. The mechanics are the usual noise-generation machinery (38 types, seed, cpu_noise defaulting to true), but the image-specific controls are where the personality is:

  • pure_noise_mode - the headline feature. Enabled, the original image is used only for its shape; noise is added to an all-black image, giving you a clean standalone noise image. This is how you generate noise pictures.
  • noise_min / noise_max - the noise is normalized into this range (default 0 to 1). Set both to the same value to disable the normalization.
  • noise_multiplier - strength, applied after the range scaling. Default 0.5.
  • channel_mode - which channels to target: RGB, RGBA (also the alpha channel if present), or the individual/per-channel combos (R, G, B, A, RG, …). 15 choices. For 1-channel images everything gets targeted regardless.
  • blend_mode - how noise combines with the image: simple_add (just adds, ignores blend_strength), lerp, inject, or subtract_b.
  • overflow_mode - what to do when values go outside 0–1: clamp pins them, rescale re-normalizes the whole result.
  • greyscale_mode - force greyscale output.
  • dtype - output precision, default matches the input. The tooltip advises against float16/bfloat16 (limited range).
  • normalize - strength-normalize the noise before scaling (default true).

Optionally, custom_noise_opt lets you plug in a full SONAR_CUSTOM_NOISE chain - when connected, the noise_type dropdown is ignored, which the tooltip states explicitly.

What to actually do with it

Three solid uses. Generate colored/pyramid noise textures as images and feed them through an image-to-image or img2img workflow. Build noise masks - generate noise as an image, threshold or blur it, and you've got a natural-looking mask. And test noise types visually: pure_noise_mode with noise_multiplier 1.0 is the fastest way to see what collatz or highres_pyramid_area actually looks like before you commit it to a latent pipeline.

Install

ComfyUI Manager → search "ComfyUI-sonar" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/blepping/ComfyUI-sonar

No models, no extra deps. Since this deals in pixels rather than sampling, the GPU-seed-reproducibility quirk matters less - but the README's general caveat about noise types being best-effort applies, and if you hand the output to a VAE or img2img node, keep an eye on the value range your overflow_mode produces.

Categoryimage

Inputs (16)

NameTypeDefaultDescription
noise_typeCOMBOgaussianSets the type of noise to generate. Has no effect when the custom_noise_opt input is connected.
seedINT00–18446744073709550000Seed to use for generated noise
imageIMAGEImage noise will be added to.
noise_minFLOAT0.000-10000–10000Generated noise will be normalized to have values between noise_min and noise_max. If you set them both to the same value then this disables normalization.
noise_maxFLOAT1.000-10000–10000Generated noise will be normalized to have values between noise_min and noise_max. If you set them both to the same value then this disables normalization.
noise_multiplierFLOAT0.500-10000–10000Multiplier for the strength of the generated noise. This is performed after noise_min/max scaling.
channel_modeCOMBORGBRGBA will also add noise to the alpha channel as well if it exists. Only used for 3 or 4 channel images, for other numbers of channels (i.e. one channel) then all channels will be targeted.
blend_modeCOMBOsimple_addControls how the generated noise is combined with the image. simple_add just adds it and blend_strength is ignored in that case.
blend_strengthFLOAT0.500-10000–10000Multiplier for the strength of the generated noise.
overflow_modeCOMBOclampWhen set to clamp, values above/below 0, 1 will be set to those values. When set to rescale, the image values will be rescaled such that the minimum value is 0 and the maximum is 1.
greyscale_modeBOOLEANfalseWhen set to clamp, values above/below 0, 1 will be set to those values. When set to rescale, the image values will be rescaled such that the minimum value is 0 and the maximum is 1.
pure_noise_modeBOOLEANfalseWhen enabled, the original image is only used for its shape and you will be adding noise to an image full of zeros (black), suitable for creating pure noise images.
dtypeCOMBOdefaultWhen set to default it will use the same type as the input tensor (probably float32). You can manually set the dtype if you want, though it likely isn't going to matter. Using dtypes with limited range (float16, bfloat16) isn't recommended.
cpu_noiseBOOLEANtrueControls whether noise will be generated on GPU or CPU.
normalizeBOOLEANtrueControls whether the generated noise is normalized to 1.0 strength before scaling. Generally should be left enabled.
custom_noise_optoptSONAR_CUSTOM_NOISE,OCS_NOISEAllows connecting a custom noise chain. When connected, noise_type has no effect. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE

Outputs (1)

NameTypeDescription
IMAGEIMAGE