ComfyUI Node Runs on cloud

Seed Generator

One seed, wired to both the sampler and the metadata

By giriss·Created 3 years ago·Updated 23 days ago· 339
Seed Generator
    • INT
    seed0

    Seed Generator does exactly one thing: it holds a seed number and hands it out as an INT. That's it. No fancy randomizer logic, no history - just a widget you type a seed into and an output wire. So why does a node this trivial exist? Because it lets one seed be the single source of truth for a whole graph.

    Here's the situation it solves. You want the seed that actually produced an image to be the seed written into that image's metadata, so Civitai and Prompthero (and future-you) can reproduce it. If your KSampler generates its own random seed and the Save Image w/Metadata node writes a different number you typed by hand, the two disagree and the metadata is fiction. Seed Generator fixes that by being upstream of both: its output feeds the sampler's seed input and the save node's seed_value at the same time. One number, two destinations, guaranteed to match.

    How it works

    The node stores a single integer and outputs it. Wire that output into your KSampler's seed (you may need to convert the sampler's seed widget to an input first - right-click the KSampler, "Convert seed to input", or on newer ComfyUI just drag the wire onto the field). Split the same output into the Save Image w/Metadata node's seed_value. Now whatever seed the render used is exactly what gets recorded. Change it in one place and both follow.

    This also sidesteps a long-standing ComfyUI annoyance: with a randomized seed, the number you see after a run is the one queued for the next run, not the one that made the image on screen. People have burned real time fishing the right seed back out. Drive the seed from an explicit Seed Generator and there's no ambiguity - the value in the node is the value that ran.

    The input and output

    • seed (INT, default 0) - the seed. Range runs from 0 up to the full unsigned 64-bit ceiling (18446744073709551615), which is the same range ComfyUI's samplers accept, so any seed you've seen elsewhere drops straight in.

    The single output is INT - the seed, ready to fan out to your sampler and your save node.

    Installing it

    It ships with the pack, so install once and you get all of it. ComfyUI Manager: search Save Image with Generation Metadata, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/giriss/comfy-image-saver
    cd comfy-image-saver
    pip install -r requirements.txt
    

    Restart ComfyUI. No models, no heavy dependencies.

    Where people get tripped up

    The one real snag isn't the node, it's the wiring. A KSampler's seed is a widget by default, not a visible input port, so if you can't find anywhere to plug this in, convert the widget to an input first. Once it's a port, the connection is obvious.

    And be clear about what this node isn't: it doesn't randomize or increment for you. If you want a fresh seed every run, ComfyUI's own controls (the control_after_generate setting on a seed widget) or a dedicated random-seed node still do that job better. Seed Generator is for when you want a fixed, known seed shared across the graph - reproducibility, not exploration. Reach for it when you've found a keeper and want the metadata to nail it down.

    CategoryImageSaverTools/utils

    Inputs (1)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    INTINT