ComfyUI Node

RandomNoiseCustom

A seed box that actually tells you what seed it ran

By brahianrosswill·Created 9 months ago·Updated 9 months ago· 0
RandomNoiseCustom
    • NOISE
    seed_value42
    modeRandomize

    The name makes it sound like a randomizer widget, but that undersells the one trick it's actually for: this is a seed node for custom sampling that shows you the seed it used. If you've iterated on a Z-Image Turbo or other flow-matching workflow and lost track of which seed produced which render, that's the pain this exists to fix.

    What it is

    RandomNoiseCustom sits in the sampling/custom_sampling/noise category and produces a single NOISE output - the same slot ComfyUI's built-in RandomNoise fills in a SamplerCustomAdvanced graph. It's a drop-in replacement, and honestly, the core node already gives you fixed/increment/decrement/randomize seed behavior. What this one adds: the seed handling is explicit and readable in Python, it tracks the last seed each node actually used (not just the number in the widget), and a tiny bundled JS extension pushes the real seed back into the seed_value widget after every run. What you see is what ran.

    That feedback loop is the point. On a distilled flow-matching model like Z-Image Turbo (8 steps, CFG 1, euler), seeds matter a lot and generations are cheap - you burn through a dozen seeds while hunting for a good one. With this node you can glance at the graph and read the exact seed that made the image on screen, then set mode to Fixed to reproduce it. That's the whole pitch, and for that one job it's genuinely nicer than core.

    How it works

    The mechanism is simple and fully visible in the source. get_noise picks a seed from your seed_value according to the mode, remembers it in a per-node dictionary keyed by the node's internal id, and hands back a noise object. When the sampler asks, that object fills a tensor with standard-normal (torch.randn) noise shaped exactly like the incoming latent - same distribution ComfyUI's own noise source uses, just generated CPU-side and moved to the GPU.

    Two details are worth knowing. First, for anything except Fixed the node's IS_CHANGED returns NaN, which tells ComfyUI "always re-execute me." Without that, the executor's caching could skip the node and you'd silently get the same seed twice. Second, the JS side listens for a comfy_server_noise_update message and writes the used seed back into the widget - which is why the number on screen stays honest.

    The inputs that matter

    Only two, and both are on the widget:

    • seed_value - an integer from 0 up to 2^53-1 (JavaScript's MAX_SAFE_INTEGER, so the JS side can round-trip it without losing precision). Default 42. This is your starting seed.
    • mode - Fixed, Increment, Decrement, or Randomize (the default). Increment/Decrement step the seed by one each run, capping at the top or floor at zero.

    The single output, NOISE, wires into the noise input of SamplerCustomAdvanced (or any other custom sampler that takes one). There's nothing else to set.

    Installing it

    No dependencies, no models, no requirements.txt - it's one Python file plus a small JS hook. ComfyUI Manager can find it by searching "RandomNoiseCustom", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/brahianrosswill/ComfyUi-RandomNoiseCustom
    

    Then restart ComfyUI. One wrinkle: the README's own clone command points at the upstream BigStationW/ComfyUi-RandomNoiseCustom repo. Either URL gets you the same one-commit code - just don't clone both, or ComfyUI will complain about a duplicate node.

    Where people get burned

    • Restart, don't just reload. If the seed widget never updates after a run, the JS extension didn't load - that needs a full restart, not a frontend refresh.
    • The bundled Z-Image Turbo workflow isn't self-contained. workflow_Z-image_turbo.json assumes you already have the Z-Image Turbo UNet, Qwen CLIP, and its VAE downloaded. The repo ships the graph, not the gigabytes.
    • Don't expect exotic noise. This generates plain Gaussian noise, same as core. If you wanted "creative" or sculpted noise, this isn't it - but it'll never give you a surprise either.
    • Mode Randomize still respects seed discipline. If you're debugging, set Fixed and change one thing at a time, per the usual advice - this node makes that easy because the used seed is right there on the widget.
    Categorysampling/custom_sampling/noise

    Inputs (2)

    NameTypeDefaultDescription
    seed_valueINT420–9007199254740991
    modeCOMBORandomize4 options: Fixed, Increment, Decrement, Randomize

    Outputs (1)

    NameTypeDescription
    NOISENOISE