Nodes/ComfyUI-DonutNodes/Donut Seeds · Text / Samplers / Filename
ComfyUI Node

Donut Seeds · Text / Samplers / Filename

Three Seeds, One Workflow — Stop Your Wildcards Reshuffling Every Time You Retry

By DonutsDelivery·Created about a year ago·Updated 2 days ago· 22
Donut Seeds · Text / Samplers / Filename
    • text
    • base
    • upscale_1
    • upscale_2
    • face
    • filename
    text_seed0
    sampler_seed0
    filename_seed0

    A single KSampler has one seed and that's all most workflows need. But a serious multi-pass workflow has three independent kinds of randomness, and conflating them is how you end up unable to reproduce anything. There's the seed that picks your wildcard text (__pose__ files, {a|b} choices), the seed that drives the base sampler, and the seed that should stay locked across the upscale/face passes so those passes don't change when you retry the base. Donut Seed Plan splits those apart with three separate inputs and derives clean, deterministic stage seeds from each. The killer feature: randomize the sampler seed and your wildcard text stays put - and vice versa.

    That split is more valuable than it sounds. If text expansion and sampling share one seed, every time you roll a new image you also roll a new prompt, so you can never tell whether a good frame came from the composition or the wording. Worse, an upscale pass fed a raw random seed will keep changing the texture every retry even when the base is fixed. The node's design doc is one line: "explicit seed domains, distinct reproducible sampling stages."

    What goes in and what comes out

    Inputs are just three integers, each with its own control_after_generate dropdown so you can auto-randomize one domain independently:

    • text_seed - feeds your wildcard/text nodes.
    • sampler_seed - the parent of every sampling stage.
    • filename_seed - for output filenames, so the filename doesn't change every time you re-roll the image (annoying when you want to overwrite the same file).

    Outputs: text (the text seed, passed straight through) and filename (the filename seed as a STRING for your save node). The middle three are the clever part - base, upscale_1, upscale_2 and face are all derived from sampler_seed by adding small fixed offsets (0, 2, 3 and 4, wrapped at the 2^53 ceiling). The offsets were picked to be collision-free; the code even notes it fixed an old bug where the upscale-2 and face stages could land on the same seed. The point: wire base into your main KSampler, upscale_1/upscale_2 into the two upscaling passes, and face into the face-detailer pass. They're all different, all deterministic, all children of one number you can write down when you hit a good image.

    The control_after_generate trap

    Because each seed input has the dropdown, you get the standard ComfyUI footgun for free: by default the control fires after a run, so the number showing in the box is the one that will be used next, not the one that just made the image. Roll something great, flip sampler_seed to fixed to keep it, and it's already been overwritten. Fix it once globally: set ComfyUI's "widget control mode" setting to Before and the value on screen is the one that actually runs. This is the same advice for every seed-bearing node in the graph, and it's worth doing before you trust anything this node reports.

    Small print: seeds are only reproducible when the whole pipeline is deterministic - same checkpoint, same sampler, same steps, no random noise sources in between. Change the sampler and "same seed" is a lie, which is fine as long as you change one thing at a time. Donut Seed Plan ships with ComfyUI-DonutNodes: ComfyUI Manager search "DonutNodes", or git clone into ComfyUI/custom_nodes and run pip install -r requirements.txt with ComfyUI's Python. No models, no downloads - it's pure plumbing.

    Categorydonut/control

    Inputs (3)

    NameTypeDefaultDescription
    text_seedINT00–9007199254740991
    sampler_seedINT00–9007199254740991
    filename_seedINT00–9007199254740991

    Outputs (6)

    NameTypeDescription
    textINT
    baseINT
    upscale_1INT
    upscale_2INT
    faceINT
    filenameSTRING