Nodes/comfyui-noise-match/Extract Real Noise Pattern
ComfyUI Node

Extract Real Noise Pattern

Turn a flat photo patch into reusable grain you can tile

By fuselayer·Created 10 months ago·Updated 10 months ago· 0
Extract Real Noise Pattern
  • noise_sample
  • noise_pattern
high_pass_radius2.0
methodhigh_pass_centered
contrast_boost1.0
preserve_colorfalse
make_tileabletrue
seam_fix_width16
tile_methodpairwise_blend

RealNoiseExtractor is the middle of the fuselayer noise-match pipeline, and it's where the actual craft lives. Feed it the flat crop that NoiseRegionDetector found - a patch of sky, a wall, out-of-focus background - and it separates the real grain from the image content underneath, producing a reusable noise pattern centered at 0.5 (50% gray). ApplyNoisePattern then stamps that pattern onto your composite so an AI-generated element finally matches the sensor noise of the photo it's sitting in.

It's worth restating why this matters: too-smooth, denoised-looking surfaces are the single most reliable "this is AI" tell, and adding realistic grain in post is one of the oldest fixes in the book. The difference here is you're not applying generic Photoshop noise - you're applying that specific photo's noise signature.

How it works: frequency separation, automated

The mechanism is a textbook high-pass. The node Gaussian-blurs your sample (high_pass_radius, default 2.0 - that's the sigma), then subtracts the blur from the original. What's left is the high-frequency content: the grain, plus any hard edges that were in the patch. Three method options differ only in how the result gets recentered and scaled:

  • high_pass_exact - O − B + 0.5. Raw.
  • high_pass_centered - (O − B − mean) + 0.5. Removes any DC shift so the pattern is truly neutral; the safe default.
  • frequency_separation - (O − B) / 2 + 0.5. Halves the amplitude; the gentlest and the most Photoshop-familiar.

Two more inputs matter:

  • high_pass_radius - the one you'll actually tune. Higher sigma keeps coarser content (bad - that becomes ghost structure, not grain). For fine sensor grain, stay around 1–3. If your pattern looks like a blurry ghost of the wall, this is too high.
  • contrast_boost - amplifies the noise contrast if the extraction came out too subtle.

preserve_color (default off) extracts per-channel RGB noise instead of grayscale. Off is usually right - colored noise carries a cast from the sampled surface and looks blotchy. Turn it on only if the photo's grain genuinely has a chroma component you need to match.

The seamless part

make_tileable is on by default, and it's the quiet reason this whole approach works. A noise pattern that tiles with visible seams would be useless on a large image, so the node enforces periodicity: pairwise_blend cross-fades opposing edges with a cosine ramp (seam_fix_width controls how many pixels deep the blend goes), or mirror_cosine builds a 2×2 mirrored mosaic, windows it, and center-crops. After tiling, the code re-centers the mean to 0.5 - guarding against the seam fix nudging the gray point.

Output and chain

One output, noise_pattern (IMAGE). From here it goes two places: into NoisePatternVisualizer to confirm the mean sits at ~0.5, and into ApplyNoisePattern for the actual blend. The visualizer check isn't optional theater - the apply node's math assumes a centered pattern, and a drifted mean tints everything it touches.

Install and troubleshooting

Part of fuselayer/comfyui-noise-match, installed together with the rest of the pack - ComfyUI Manager ("comfyui-noise-match") or:

cd ComfyUI/custom_nodes
git clone https://github.com/fuselayer/comfyui-noise-match

Restart, find it under image/noise. No models to download; it's numpy/scipy math on CPU.

Common failure modes, all diagnosed through the visualizer:

  • Pattern has ghost blobs of the sampled surfacehigh_pass_radius too high; drop toward 1.
  • Pattern is basically flat (tiny std dev) → raise contrast_boost, or the patch you sampled genuinely had no grain.
  • Pattern carries a color cast → you left preserve_color on and sampled a tinted wall; go grayscale.
  • Seams visible in the final result → disable tiling only if the pattern never needs to repeat (a single cutout smaller than the pattern); otherwise it's a seam_fix_width too small for your pattern size.

One honest caveat: extracted grain is a statistical approximation, not a pixel-perfect copy of the camera's noise. On a clean composite it reads as real. That's the bar it clears, and for most of this pack's use cases it's all you need.

Categoryimage/noise

Inputs (8)

NameTypeDefaultDescription
noise_sampleIMAGE
high_pass_radiusFLOAT2.00.1–20Gaussian blur sigma. Higher = coarser separation
methodCOMBOhigh_pass_centeredhigh_pass_exact: O-B+0.5 | high_pass_centered: (O-B-mean)+0.5 | frequency_separation: (O-B)/2+0.5
contrast_boostFLOAT1.00.1–5Amplify noise contrast
preserve_colorBOOLEANfalseExtract RGB noise per-channel vs grayscale
make_tileableBOOLEANtrueMake the noise pattern seamless
seam_fix_widthINT164–128Edge width used for seamless pairwise blending
tile_methodCOMBOpairwise_blendSeamless method

Outputs (1)

NameTypeDescription
noise_patternIMAGE