ComfyUI Node

Seed (Inteliweb)

The seed node that lets you recover the run you just made

By maoper11·Created about a year ago·Updated 9 days ago· 4
Seed (Inteliweb)
    • SEED

    Every ComfyUI beginner hits the seed trap eventually, and this node exists to disarm it. The stock KSampler's control_after_generate fires after the run, which means the seed shown in the box is the one that will run next, not the one that just made the image you're staring at. You find a perfect result on a random seed, flip the dropdown to fixed to keep it, and it's already gone - overwritten the moment the run ended. The standard advice is to set "widget control mode" to Before once, and the other standard advice is to use a seed node that remembers. This is that node, in the Inteliweb flavor, and the author credits rgthree's Seed as the inspiration.

    How it works

    It's a frontend-driven INT source. You get a seed field plus three buttons:

    • 🔀 Randomize Each Time - every run rolls a fresh seed.
    • 🆕 New Fixed Random - rolls one random seed and pins it as a fixed value you can tweak.
    • ↩️ Use Last Seed - recovers the seed that actually went into the last queued run.

    In randomize mode the field displays random but stores the sentinel -1 internally. When you hit queue, the frontend injects a small JSON state ({seed, run_seed}) into a hidden input, and the backend returns the resolved run seed. The "last used" seed is kept in the session without touching your saved workflow, so Use Last Seed is your undo button for the classic trap. There's also a Python-side fallback: if the node runs through the API without the frontend ever touching it, a -1 rolls a random seed server-side. Range is 0 to 2^50, the exact-integer ceiling for JavaScript.

    The output that matters

    One output: SEED (an INT). Wire it into any seed input - KSampler, a sampler, a noise node - and you're done. If you convert a KSampler's seed widget to an input first, one Seed node can drive five samplers from a single socket, which is exactly the "one seed, five samplers" pattern the plumbing docs preach.

    Installing it

    It's part of the Inteliweb pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/maoper11/comfyui_inteliweb_nodes.git
    cd comfyui_inteliweb_nodes
    python -m pip install -r requirements.txt
    

    ComfyUI Manager: search "ComfyUI_Inteliweb_nodes". Dependencies are just psutil and nvidia-ml-py, no model downloads, then restart.

    Things to know

    The mode buttons aren't a control_after_generate replacement - they're better at exactly one job (recovering a lost seed) and you give up the increment/decrement stepper behavior of the stock control. If you rely on stepping seeds by one per run, this node doesn't do that; keep the stock KSampler widget for that. And because randomize is frontend-managed, an API-driven run that never passes through the UI genuinely randomizes each time rather than honoring a stored value - which is the correct behavior for batch scripting, but worth knowing if you expected a fixed saved seed to reproduce. For the core pain - "I found the image, where's my seed?" - this is the cleanest fix I've used.

    CategoryInteliweb/Utils

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    SEEDINTSeed value to connect to KSampler or any other seed input.