Nodes/Latent Tools/LTUniformLatent
ComfyUI Node

LTUniformLatent

Fill a latent with flat noise — and get surrealism for free

By Machines-of-Disruption·Created about a year ago·Updated 8 months ago· 27
LTUniformLatent
    • LATENT
    channels4
    width1024
    height1024
    batch_size1
    min-1.0000
    max1.0000
    seed0

    Every diffusion model is trained on Gaussian noise, so when you feed it uniform noise - flat, evenly-spread values with no bell curve - the output looks like nothing you've seen from normal generation. Painterly, color-blocked, almost quantized. LTUniformLatent is the node that makes that happen on purpose.

    What it is

    A latent noise generator from latent-tools. It fills a latent tensor with random values uniformly distributed between a min and max you choose, and hands you a ready-to-sample LATENT. The inputs:

    • width / height - in pixels, default 1024 each. The node divides by 8 to get the latent size (the VAE's 8x downscale), so 1024 becomes a 128x128 latent.
    • channels - default 4, the standard SD 1.5/SDXL latent channel count. Leave it alone unless you know why you're changing it.
    • batch_size - default 1, minimum 1.
    • min / max - the range of the noise, defaults -1 to 1.
    • seed - the author's tooltip: "The random seed used for creating the noise." Fixed seed, reproducible noise; randomize it per run.

    How it works

    Under the hood it's a single line: torch.rand(batch, channels, height//8, width//8) scaled into [min, max]. Every value in the range is equally likely, so the latent is "flat" - no clustering, no tails. And one structural note: the node is flagged as an output node, which just means ComfyUI treats it as a valid graph endpoint. It still returns a usable LATENT, so you can absolutely wire it into a KSampler's latent_image and not treat it as a dead end.

    Why you'd reach for it

    The README is upfront about the catch: "Stable Diffusion models are usually trained with Gaussian noise, so the generations from Uniform noise will look unusual." Unusual is underselling it. Run the classic "quick brown fox" test with uniform noise at -1.67 to 1.67 and you get a striking, flat-textured, almost posterized image - closer to graphic art than photography. Stretch the range to -1.81 to 1.81 and it gets wilder still.

    So the use case is artistic exploration, full stop. Uniform noise is a way to deliberately break the model's prior and get textures normal diffusion never produces - useful for experiments, mood boards, or just seeing your checkpoint do something it was never asked to do. Compare against the pack's sibling LTGaussianLatent (mean/std Gaussian noise): that's the "normal" one that behaves like training data. If you just want a sane starting latent, use the Gaussian sibling or ComfyUI's stock EmptyLatentImage and skip this node entirely. If you want surreal, reach for uniform.

    One practical tip: keep the range tight (say ±1 to ±2) at first. Wider ranges push values further outside the distribution the model saw, and the results go from "interesting" to "unidentifiable" fast. And since it's seeded, the same noise is reproducible - which is handy when you find a range you love.

    Installing it

    latent-tools is a small MIT-licensed pack by xl0 (Alexey Zaytsev), published on the Comfy Registry. Easiest path: ComfyUI Manager → Install Custom Nodes → search "Latent Tools" and install, then restart ComfyUI. Manual path:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xl0/latent-tools
    

    Then restart ComfyUI; it shows up under LatentTools. Only dependency is lovely-tensors, no model downloads. Niche, single-author pack - but for a weird-noise generator, niche is kind of the point.

    CategoryLatentTools

    Inputs (7)

    NameTypeDefaultDescription
    channelsINT4
    widthINT1024
    heightINT1024
    batch_sizeINT1
    minFLOAT-1.0000-1000–1000
    maxFLOAT1.0000-1000–1000
    seedINT00–18446744073709550000The random seed used for creating the noise.

    Outputs (1)

    NameTypeDescription
    LATENTLATENT