Nodes/WAS Node Suite v3/Affine Pattern Noise
ComfyUI Node Runs on cloud

Affine Pattern Noise

Stop starting every image from the same random static

By WASasquatch·Created 3 years ago·Updated 7 days ago· 1,846
Affine Pattern Noise
  • affine_options
  • NOISE
patternwhite_noise
noise_seed0
max_scale1.10
max_bias0.00
clamp_sigma0.0
temporal_modestatic
streamsvideo
normalizetrue

Most custom samplers start from plain Gaussian noise - ComfyUI's prepare_noise gives you the same random static every time. Affine Pattern Noise is the counter-idea: it takes that base noise and augments it with one of the pack's procedural patterns, so your starting noise is structured. Instead of seeding a blank canvas, you seed a canvas that already has a texture to it.

How it works

The node produces a NOISE object. When the sampler asks it for noise at the first step, it:

  1. Generates the base noise the standard way (respecting your seed and batch indices),
  2. Generates your chosen pattern mask at latent size,
  3. If normalize is on (default), centers and scales the pattern to zero-mean unit-std before amplitude scaling,
  4. Scales it by affine_scale and adds it to the base noise as a bias term,
  5. Clamps the result to [-3, 3].

So the pattern shapes the noise's statistics, not its overall brightness. Setting affine_scale to 0 (with affine_bias 0) returns plain base noise - an easy way to A/B the effect.

The pattern menu excludes the ones that make no sense as noise - solid, external_mask, and the content-derived masks (detail_region, edges_sobel, etc.) - because those need a latent to compute from, and there is none at the first step. You get the spectral family (white, pink, brown, blue, violet, green, black), procedural (perlin, cross_hatch, dot_screen, highpass_white, ring_noise), and geometric (checker, bayer).

Inputs and outputs

  • pattern - the noise texture (default white_noise).
  • seed - reproducibility of the pattern.
  • affine_scale (default 0.95) - how much the pattern dominates the base noise.
  • normalize (default True) - center/scale the pattern first.
  • affine_bias - extra additive offset where the pattern is active.
  • options / noise_options - the usual DICT pair for pattern tuning.

Output: one NOISE output, wired into the noise input of a Custom Sampler (it pairs especially well with Custom Sampler Affine Advanced, where you can augment the starting noise and apply affine during the run).

Why bother

Structured starting noise is an old trick for pulling detail out of early denoising steps - the pack's whole philosophy is that what happens early in sampling matters, and this applies it to step zero. Pink or green noise tends to read as natural detail; highpass_white pushes fine texture.

Installing

Part of WAS Affine by WASasquatch. ComfyUI Manager → Install Custom Nodes → search "WAS Affine" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was_affine

Restart ComfyUI. ComfyUI 1.0.0+, torch and numpy.

Common issues

The most common confusion is expecting to see the pattern directly in the image. You won't - it's the noise that's patterned, and what you'll notice is how detail lands during sampling, not a visible texture. Also, this node only does anything in a custom sampling stack: plug it into a plain KSampler and nothing happens, because KSampler generates its own noise internally. And keep affine_scale sensible; at 2+ the pattern swamps the base noise and you get a lopsided, biased start.

CategoryWAS Suite/Sampling

Inputs (9)

NameTypeDefaultDescription
patternCOMBOwhite_noiseWhich mask shapes the draw. `white_noise` is one value per latent element; `pink_noise`, `brown_noise` and `perlin` spread over larger areas; `checker`, `bayer` and `tile_lines` repeat. Affine Options carries each pattern's own settings.
noise_seedINT00–18446744073709550000The seed the draw and the mask are both taken from, as `0` or `12345`. One seed reproduces a clip exactly.
max_scaleFLOAT1.100–10What the draw is multiplied by where the mask is white. 1.0 leaves the draw alone, 1.1 lifts it a tenth, 0.5 halves it. Away from the mask the draw is untouched.
max_biasFLOAT0.00-2–2What is added where the mask is white. 0.0 adds nothing, 0.05 is a faint lift, 0.5 prints the pattern into the draw.
clamp_sigmaFLOAT0.00–8Where the draw is cut off, in standard deviations. 0.0 leaves it uncut. 3.0 cuts the furthest 0.3 percent of values.
temporal_modeoptCOMBOstaticHow a video latent's mask varies over time. 'static' = one mask on every frame, in the same place all clip. 'per_frame' = an unrelated mask each frame. 'drift' = one mask slid across the frame, set by drift_speed, drift_angle_deg and drift_renew on Affine Options. The content-aware patterns ignore this, and so does an image latent.
streamsoptCOMBOvideoWhich streams of a packed audio and video latent the affine reaches. 'video' = stream 0, 'audio' = the rest, 'both' = all of them. An ordinary latent has only a video stream, so 'audio' does nothing to it.
normalizeoptBOOLEANtrue`true` returns the draw at a spread of 1.0, which is the magnitude a sampler's schedule is built for. `false` returns whatever max_scale and max_bias worked out to.
affine_optionsoptDICTPattern parameters and mask shaping from an Affine Options node. Leave it unwired and every value takes its default. A pattern set there wins over the pattern widget.

Outputs (1)

NameTypeDescription
NOISENOISEThe starting noise, for the noise socket of Sampler Custom Advanced or Custom Sampler Affine Advanced.