Nodes/Elegant Nodes/Elegant Seed
ComfyUI Node

Elegant Seed

Fix the seed problem, not the seed value

By wipeer·Created 22 days ago·Updated 13 days ago· 2
Elegant Seed
    • seed
    • seed_text
    ◄modetrue►
    ◄seed0►

    The most upvoted complaint about subgraphs isn't about subgraphs. It's this: "I just love how they put the seed value as an input for the subgraph and the setting to make it fixed/random/increment/etc, but if you do that the seed can't actually change because the subgraph expects you to give it a value, its not just showing you what value it is." That's the exact hole Elegant Seed is built to fill.

    What it is

    Elegant Seed is an INT source with a random/fixed switch and three buttons for the two things you actually do with seeds: roll a new one, and get back the one that made the image you liked. It's based on ComfyUI's own built-in Seed node, and it comes from Elegant Nodes by wipeer - a small utility pack whose organizing idea is that its nodes keep working on the subgraph node, buttons and all.

    In the plumbing layer this is a value node: one seed fanned out to several consumers, so you set it once instead of typing it into four samplers. Prefer it over a plain primitive for the control surface, and over the old dropdown for what comes next.

    Why not just control_after_generate?

    Every integer widget in ComfyUI carries that second dropdown - fixed, increment, decrement, randomize - and it's the most reliable beginner injury in the whole app. It fires after the run by default, so the number in the box is the seed that will be used next, not the seed that just made the picture you're looking at. So you find a great image, flip to fixed to keep it, and you've already lost it.

    Elegant Seed opts out of that mechanism entirely. In its schema the seed input sets control_after_generate to false, deliberately, because the switch and the buttons replace it. What you get instead:

    • 🎲 Random - new seed now, and switch to random.
    • ♻️ Last seed → fixed - restore the seed of the last finished run (the one whose image you're looking at) and switch to fixed. The button label shows that seed. Runs still queued or generating don't count, which is the whole point.
    • 🎲 Random → fixed - new seed, and lock it immediately.

    That's a better model than a dropdown whose semantics depend on a global setting you didn't know existed. If you'd rather fix the global setting anyway - Settings → Lite Graph → Node Widget → Widget control mode set to before - the pack honors it: in random mode, after (the default) uses the seed you see then rolls a new one, while before rolls just before the run so the field shows what was used. Last seed is your undo in either arrangement.

    Inputs and outputs

    mode is a boolean with the labels random and fixed. seed is the integer - type one in and it's used for the next run in either mode, which is how you paste a seed from a Reddit post.

    seed (INT) is the output that matters: right-click the seed widget on your KSampler, choose Convert widget to input, and wire this into it. Do that and one seed drives every sampler in the graph - the entire reason value nodes exist. seed_text (STRING) is the same number as text, which is handy for filename_prefix on Save Image: files named with the seed that made them, no typing.

    Random seeds top out at 2⁵³ − 1 - the largest integer a browser represents exactly - so anything the buttons produce round-trips safely, even though the field accepts far larger numbers.

    Inside a subgraph is where this node distinguishes itself. ComfyUI promotes a seed widget automatically, so the seed stays on the subgraph node - and the three buttons come with it. Every copy of a subgraph keeps its own seed, so a subgraph you drop in five times gives you five independent seeds with no opening and no digging. Promote mode too if you want the random/fixed switch up there; otherwise the inner setting applies.

    The last seed is saved with the workflow, so reopening a file doesn't lose where you were, and in a batch every run gets its own seed with the final one remembered.

    Install

    Manager: search Elegant Nodes, install. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wipeer/comfyui-elegant-nodes.git
    pip install -r comfyui-elegant-nodes/requirements.txt
    

    Restart ComfyUI, refresh the browser - the buttons and the last-seed memory are frontend JavaScript, so a cached page is a node with no controls. No models, no heavy dependencies (the pack's only Python requirement is simpleeval, which ComfyUI already ships). Category: utilities → elegant.

    Honest caveats

    ComfyUI 0.4.0 or newer. The pack is written against the V3 node API and won't register on older builds. Note that this node kept its id across the pack's 1.0.0 rename - unlike the Resolution Selector and the text previews - so old workflows pointing at it still load.

    The other seed node worth knowing is rgthree's Seed, which also remembers the last run and picked up subgraph handling in 2026 - but it's a big pack carrying a known, unresolved rendering break with the Nodes 2.0 frontend. If you want exactly one thing, a seed that behaves inside subgraphs, this is the lighter dependency.

    The trap is upstream of the node: if you don't convert the sampler's seed widget to an input, this node feeds nothing and the buttons appear to do nothing. Wire it once per sampler and the confusion ends.

    Categoryutilities/elegant

    Inputs (2)

    NameTypeDefaultDescription
    modeBOOLEANtruerandom: a new seed for every run (before or after queueing, per the 'Widget control mode' setting). fixed: always use the seed below.
    seedINT00–9223372036854776000The seed. Type a number to use it for the next run.

    Outputs (2)

    NameTypeDescription
    seedINT—
    seed_textSTRING—