Nodes/ComfyUI-mnemic-nodes/🎲 Random String
ComfyUI Node

🎲 Random String

Pick one line at random out of a list you paste in

By MNeMoNiCuZΒ·Created 3 years agoΒ·Updated 23 days agoΒ· 105
🎲 Random String
    • random_choice
    β—„input_listoption1 option2 option3β–Ί
    β—„seed-1β–Ί

    A lightweight version of a wildcard: paste a newline-separated list of options into input_list, and this node hands back one of them - either genuinely random each run, or a specific, reproducible pick if you set a seed.

    How it works

    Each line in input_list is one candidate; empty lines get skipped rather than treated as an option. seed is optional - leave it at the default -1 and you get a fresh, different pick every run; set it to any other number and the same line comes back every time, which is the reproducible mode. That makes it genuinely useful for A/B-ing a workflow: fix the seed while you're comparing changes to everything else in the graph, then flip it back to -1 once you want variety again.

    The inputs and outputs that matter

    • input_list - a multiline list of options, one per line. Defaults to a placeholder option1 / option2 / option3.
    • seed (optional, default -1) - -1 means genuinely random each run; any fixed number means the same result every time.

    Output: random_choice (STRING) - the picked line.

    How to install it

    Via ComfyUI Manager: search ComfyUI-mnemic-nodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
    

    Restart ComfyUI. No dependencies, no model files.

    Common issues & troubleshooting

    It's returning a whole comma-separated string instead of picking one item. This node splits on lines, not commas - if your list is all on one line separated by commas, that entire line counts as a single option. Put one choice per line, not one giant comma-separated list on a single line.

    -1 seems to be doing the opposite of what you expected. This trips people up: -1 is the explicit "randomize" flag, not "no seed" or "off." If you want a fixed, reproducible pick, you need to set seed to an actual number - leaving it at -1 guarantees a different result on every run.

    When to reach for this over the pack's full Wildcard Processor. This node is the right size for a short, self-contained list you don't need to reuse across multiple workflows - a handful of lighting options, camera angles, or subject variants typed directly into the node. For anything you're maintaining as a reusable wildcard file on disk, or sharing across several graphs, the pack's dedicated Wildcard Processor node is the better fit. Wire random_choice straight into a String Concat / Append node or a CLIPTextEncode from here.

    It's also a decent stand-in for building your own light checkpoint/sampler randomizer without touching the pack's more involved Prompt Property Extractor - a Random String full of checkpoint names or sampler names, fed into whichever node reads that setting, gets you variation with almost no setup.

    Category⚑ MNeMiC Nodes

    Inputs (2)

    NameTypeDefaultDescription
    input_listSTRINGoption1 option2 option3Newline-separated list of strings to randomly choose from. Each line is one option.
    seedoptINT-1-1–18446744073709550000Seed for random number generator. Use -1 for random seed (different each time), or set a specific value for reproducibility.

    Outputs (1)

    NameTypeDescription
    random_choiceSTRINGβ€”