Nodes/ComfyUI-sonar/NoisyLatentLike
ComfyUI Node

NoisyLatentLike

The front door to the whole noise toybox

By blepping·Created 3 years ago·Updated 8 days ago· 49
NoisyLatentLike
  • latent
  • custom_noise_opt
  • mul_by_sigmas_opt
  • model_opt
  • LATENT
noise_typegaussian
seed0
multiplier1.000
add_to_latentfalse
repeat_batch1
cpu_noisetrue
normalizetrue

ComfyUI-sonar started life as a momentum-sampler port and quietly turned into a noise toybox. If you want to see why, this is the node to start with. NoisyLatentLike generates noise shaped like a reference latent and optionally adds it to that latent - it's the generic "give me a latently-sized noise field of a specific character" node, and every custom noise chain in the pack eventually feeds into it.

For a beginner the mechanism is simple: you hand it a latent, it makes noise that matches that latent's size and channel layout, and if add_to_latent is on, it adds the noise to the latent instead of to an empty one. That second mode is the img2img trick - you're rebuilding the noisy starting state that img2img needs, but with whatever exotic noise you want instead of the usual gaussian.

The inputs that actually matter

There are eight required inputs but you'll set maybe four:

  • noise_type (default gaussian) - the star of the show. Thirty-eight options: gaussian, brownian, collatz, green_test, grey, the highres_pyramid family, laplacian, the onef_* (1/f) variants, and more. Don't overthink the first time; grab brownian or green_test and see what it does to a fixed seed.
  • seed - ordinary noise seed.
  • latent - the reference latent everything keys off.
  • add_to_latent - off by default. The tooltip's blunt advice: "Generally should be enabled for img2img workflows." In that mode you also want to connect mul_by_sigmas_opt (a SIGMAS socket) and model_opt, which scales the generated noise by the first sigma so the noise level actually matches your denoise strength.

The rest are tune-ables: multiplier scales noise strength (applied after sigma scaling), repeat_batch repeats generation for larger batches, cpu_noise (default true) decides CPU vs GPU - only matters for types that support GPU generation, basically Brownian - and normalize (default true) pins noise to 1.0 strength before scaling. Leave normalize on unless you know why you're turning it off.

There's also the custom_noise_opt socket: connect a custom noise chain here and noise_type is ignored entirely. That's how the SonarAdvanced*, SonarBlended*, and SonarChannelNoise nodes hand their output onward.

Output and wiring

Output is a LATENT. In a text-to-image workflow you can feed it into a SamplerCustom or a KSampler as the initial latent - the Sonar sampler nodes take the same noise and it behaves equivalently. In img2img you chain it with add_to_latent enabled, model and sigmas connected, and let your sampler consume the result.

Installing

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

or "ComfyUI-sonar" via ComfyUI Manager, then restart. No models, no extra requirements.

The honest caveats

The author is upfront that the noise types are best-effort - "pink" noise here may not be what a signal-processing textbook calls pink noise. It doesn't matter; the point is the character, not the taxonomy. Second, seeds aren't portable across GPU types because generation hops between CPU and GPU. And since the toybox is the whole point, spend a minute with the README's docs/base_noise_types.md - it's the only real documentation the noise types have, and it's worth more than an hour of random knob-turning.

Categorylatent/noise

Inputs (11)

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
latentLATENTLatent used as a reference for generating noise.
multiplierFLOAT1.000-10000–10000Multiplier for the strength of the generated noise. Performed after mul_by_sigmas_opt.
add_to_latentBOOLEANfalseAdd the generated noise to the reference latent rather than adding it to an empty latent. Generally should be enabled for img2img workflows.
repeat_batchINT11–10000Repeats the noise generation the specified number of times. For example, if set to two and your reference latent is also batch two you will get a batch of four as output.
cpu_noiseBOOLEANtrueControls whether noise will be generated on GPU or CPU. Only affects noise types that support GPU generation (maybe only Brownian).
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. The following input types are supported: SONAR_CUSTOM_NOISE, OCS_NOISE
mul_by_sigmas_optoptSIGMASWhen connected, will scale the generated noise by the first sigma. Must also connect model_opt to enable.
model_optoptMODELUsed when mul_by_sigmas_opt is connected, no effect otherwise.

Outputs (1)

NameTypeDescription
LATENTLATENTThe noisy latent image.