Nodes/SD-Advanced-Noise/Gaussian Noise (Latent)
ComfyUI Node

Gaussian Noise (Latent)

The 'Gaussian' in the name is a lie — but this latent-noise node is a fun rabbit hole

By city96·Created 3 years ago·Updated 2 years ago· 27
Gaussian Noise (Latent)
    • LATENT
    latent_ver
    width768
    height768
    factor0.50
    null0.00
    batch_size1
    scale1
    random
    seed0

    Let's start with a disclaimer from the author himself. This is city96's pack - the same city96 who brought GGUF quantized weights to diffusion and made Flux run on cards that had no business running it. In the SD-Advanced-Noise README he writes, about this exact node: "I'm not sure if the way I coded this even makes sense, or if it's even gaussian noise. It's just torch.random with a bunch of stuff like scaling/per channel random/etc." So: Gaussian Noise (Latent) is a tinker toy, honestly labeled, and knowing that up front is the correct way to approach it.

    What it actually does

    It generates random noise directly in latent space and hands you a LATENT tensor to start a sampler with. That's the whole trick: instead of letting ComfyUI's Empty Latent Image hand the KSampler a zero latent it then has to noise up, this node produces the noisy starting point itself. In the wider ComfyUI context, this is the corner of the ecosystem where people poke at the latent space directly - that compressed 4-channel representation the model actually does its work in, which the VAE maps to and from.

    Why bother? Three reasons: reproducible noise (your seed genuinely pins the exact latent you start from), skipping the VAE encode/decode round trip, and plain curiosity. It slots in as a drop-in replacement for EmptyLatentImage feeding a KSampler.

    How it works

    The node ships hardcoded per-channel min/max/center values for two latent spaces: SD 1.5 ("v1") and SDXL ("xl"). Rather than guessing what "reasonable" latent noise looks like, it maps random values into the observed range of each of the four latent channels and centers them around the "null" latent - what a black image encodes to. The output formula is roughly (noise * factor) * (1 - null) + null_latent * null, halved. Note it's uniform random scaled to those bounds, not actual Gaussian-distributed noise, hence the author's honesty above.

    The inputs that matter, in rough order of how often you'll touch them:

    • latent_ver - v1 for SD 1.5-era, xl for SDXL/Pony/Illustrious. This is the one that burns people; pick wrong and you're feeding noise calibrated for a different latent space into your model.
    • factor - amplitude of the noise, 0 to 1.
    • null - how much to blend toward the black-image latent instead of pure noise.
    • random - "shared" uses one random map across all four channels; "per channel" rolls each independently. Subtle, but changes texture noticeably.
    • seed - pins the noise, and increments per image in a batch.

    Width and height are in pixels and step by 8 (the latent is 8x smaller), and scale generates at a lower resolution then upsizes with antialiasing - a cheap way to get structured low-res noise. Output is a single LATENT, which you feed into the latent_image input of a KSampler (denoise 1) or any other latent consumer.

    Install

    ComfyUI Manager: search "SD-Advanced-Noise". Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/city96/SD-Advanced-Noise
    

    Then restart ComfyUI. No requirements.txt, no model downloads, no heavy deps - it's plain torch/numpy, Apache 2.0 licensed. Same install covers the pack's other node, MathEncode.

    Where people get burned

    latent_ver mismatch is the big one, as above. Also remember this only knows SD 1.5 and SDXL latent spaces - don't feed its output to Flux (whose VAE carries 16 latent channels) or anything newer, the numbers simply don't apply. And keep the author's warning in mind: for everyday generation, Empty Latent Image is fine and this won't beat it. Reach for it when you're deliberately messing with initialization, or just want to treat the latent space as a sandbox.

    Categorynoise

    Inputs (9)

    NameTypeDefaultDescription
    latent_verCOMBO2 options: v1, xl
    widthINT76864–8192
    heightINT76864–8192
    factorFLOAT0.500–1
    nullFLOAT0.000–1
    batch_sizeINT11–64
    scaleINT11–8
    randomCOMBO2 options: shared, per channel
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    LATENTLATENT