Nodes/ComfyUI String Tools/StringToolsSeed
ComfyUI Node

StringToolsSeed

The tiny INT feeder the choice nodes insist on

By Taremin·Created 3 years ago·Updated 2 months ago· 3
StringToolsSeed
    • INT
    seed0

    The node that exists because of a refusal

    StringToolsSeed takes an integer, remembers it, and hands it back out on an INT port. That's the whole job description. But it exists for a very specific reason: StringToolsRandomChoice and StringToolsBalancedChoice won't accept a PrimitiveNode on their seed inputs - the pack blocks PrimitiveNode connections on purpose, just like it does on the text slots. So if you want to drive the choice from a number you can change in one place, you need a node that isn't a PrimitiveNode to feed the seed. That node is this one. The README says so in about a sentence, and it's the honest answer to "why does this trivial thing exist?"

    In practice it behaves a lot like the familiar rgthree Seed node: it's a seed generator you wire into a seed port, so the seed value lives in one obvious place instead of buried in a widget. It's also handy for the pack's own wiring pattern - the tests build choice graphs by creating a StringToolsSeed, setting its value, and connecting it to slot 0 of the choice node. That's the intended shape of a prompt-variation workflow: StringToolsSeedStringToolsRandomChoice.

    What it does

    One required input, seed (INT, default 0), and one output, INT. It's a pure pass-through - whatever integer you set comes out unchanged. No minimum-effort cleverness beyond that. It does not re-seed a KSampler or touch the sampling pipeline; it only feeds string-choice nodes. (If you need a seed for a sampler, ComfyUI's own KSampler seed widget or rgthree's Seed covers that ground.)

    Using it in a workflow

    • Drop a StringToolsSeed, set the value (or connect an INT from elsewhere).
    • Wire its INT output into the seed port of a StringToolsRandomChoice or StringToolsBalancedChoice.
    • Bump the seed when you want a different pick. Same seed = same pick, guaranteed - the choice nodes do random.seed(seed) internally.

    Installing it

    Part of the one-pack install. ComfyUI Manager: "Install Custom Nodes", search ComfyUI String Tools (repo Taremin/comfyui-string-tools), install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Taremin/comfyui-string-tools
    

    Restart fully. No pip deps, no model files - stdlib Python plus a small JS file, MIT license, release 0.0.7, from Taremin (also the author of the well-liked WebUI Monaco Prompt editor).

    Gotchas

    • You can type a number straight into the choice node's seed widget too. If you don't need the seed to live elsewhere, you don't strictly need this node. Use it when you want one master seed controlling several choice nodes, or when a PrimitiveNode wire keeps getting rejected.
    • Don't expect it to drive samplers - it's an INT source for the string-tools graph, nothing more.
    • The value is just an integer; any INT feed works, including one from another String Tools choice node if you ever want cascading determinism.
    Categorystring-tools

    Inputs (1)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    INTINT