Nodes/ComfyUI-sonar/SonarCompositeNoise
ComfyUI Node

SonarCompositeNoise

Mixing two noise types by mask, so your background can be calm and your subject noisy

By blepping·Created 3 years ago·Updated 13 days ago· 49
SonarCompositeNoise
  • sonar_custom_noise_dst
  • sonar_custom_noise_src
  • mask
  • SONAR_CUSTOM_NOISE
factor1.000
normalize_dstdefault
normalize_srcdefault
normalize_resultdefault

SonarCompositeNoise takes two custom noise generators and blends them with a mask, so different regions of your latent start from different kinds of noise. It's the node you reach for when a single noise type is a compromise: you want structured noise where the subject is, and plain smooth noise in the background.

Why this is useful

Starting noise isn't just static - it's the seed of everything the sampler builds. Some noise types (pyramid, pattern-broken, structured) give you stronger early composition or texture in one region while leaving another looking busy or repetitive. With a mask you can have your subject start from the interesting noise and your background start from boring, reliable Gaussian. It's also the natural tool for img2img-style "noise the part I want to change" workflows, because a mask is exactly how you say which part.

How it works

Pick your two sources and one mask, and the node does an alpha blend per latent position:

  • sonar_custom_noise_src - the noise used where the mask is set.
  • sonar_custom_noise_dst - the noise used where the mask isn't set.
  • mask - the blend control. The semantics are worth getting exactly right: where the mask is 1.0 you get 100% src; where it's 0.75 you get 75% src and 25% dst. The mask gets rescaled to match the latent size if it doesn't line up, so you don't have to pre-size it.

Each side has a normalize_src / normalize_dst switch (default/forced/disabled) controlling whether that source is normalized to 1.0 strength before compositing, plus a normalize_result for the final blend. The factor input scales the whole thing like it does on every pack noise node.

The inputs a beginner actually sets

  • mask - the big one. Draw or generate it at roughly the right aspect ratio; the node rescales to the latent for you. Remember the 0.75 reading: the mask is a proportion, not an on/off switch.
  • sonar_custom_noise_src and sonar_custom_noise_dst - two SonarCustomNoise (or other) chains.
  • factor - overall strength, default 1.

Output is SONAR_CUSTOM_NOISE, so the composite itself can be fed onward into SonarPowerFilterNoise, SonarModulatedNoise, or straight into a Sonar sampler / NoisyLatentLike. Composite chains nest - you can composite a composite.

Gotchas

Feathering is your friend. A hard-edged mask gives a hard-edged boundary in the starting noise, and while the sampler blurs a lot of it away, a soft mask edge behaves better. Also remember the pack-wide rule: connecting this (or any custom noise node) to a Sonar sampler overrides the noise type you set in the sampler node itself.

Install

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

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

No models, no pip deps. And the usual pack caveats: inputs can change between versions, and seeds may not match across GPU models because noise can be generated on CPU or GPU. Fine for exploring, annoying if you're trying to reproduce a specific result later.

Categoryadvanced/noise

Inputs (7)

NameTypeDefaultDescription
factorFLOAT1.000-10000–10000Scaling factor for the generated noise of this type.
sonar_custom_noise_dstSONAR_CUSTOM_NOISE,OCS_NOISECustom noise input for noise where the mask is not set. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE
sonar_custom_noise_srcSONAR_CUSTOM_NOISE,OCS_NOISECustom noise input for noise where the mask is set. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE
normalize_dstCOMBOdefaultControls whether noise generated for dst is normalized to 1.0 strength.
normalize_srcCOMBOdefaultControls whether noise generated for src is normalized to 1.0 strength.
normalize_resultCOMBOdefaultControls whether the final result after composition is normalized to 1.0 strength.
maskMASKMask to use when compositing noise. Where the mask is 1.0, you will get 100% src, where it is 0.75 you will get 75% src and 25% dst. The mask will be rescaled to match the latent size if necessary.

Outputs (1)

NameTypeDescription
SONAR_CUSTOM_NOISESONAR_CUSTOM_NOISEA custom noise chain.