Nodes/ComfyUI_EmAySee_CustomNodes/EmAySee Random String SelectorFourChoice
ComfyUI Node

EmAySee Random String SelectorFourChoice

Four prompts in, one random out — the 4-way picker

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Random String SelectorFourChoice
    • RANDOM_SELECTED_STRING
    string_input_1Input String 1
    string_input_2Input String 2
    string_input_3Input String 3
    string_input_4Input String 4

    The four-way random string selector - the biggest fixed-size member of this pack's picker family. Four string inputs, one random.randint(0, 3) roll, one winner out. If your variation pool is a tidy four (four style tags, four character descriptions, four poses), this is the node for it.

    How it works

    string_input_1 through string_input_4 in, RANDOM_SELECTED_STRING out. Every run picks a uniform random index 0–3 and returns the matching string, so each slot gets exactly a 1-in-4 shot. Wire the output to a CLIP Text Encode, a prompt combiner, a filename prefix - anywhere a string flows.

    The honest version

    The implementation is the same handful of lines as the 2- and 3-way versions, plus one more branch. And one thing to know: the code prints the random choice to the console on every run (print(random_choice)), which is harmless but means your ComfyUI log will fill with single digits if you run this in a tight batch loop. Nothing breaks; it's just noise.

    Seed? No.

    There's no seed input and no way to replay a pick. That's consistent with the 2- and 3-way siblings: these are unseeded by design, for pure variety. If you need reproducibility, the pack's 20-slot EmAySee_RandomStringSelector takes a seed. And if four fixed slots are the wrong shape - you want a bigger pool, or slots that appear and disappear as your needs change - that same 20-slot node is the scalable option.

    Installing it

    Part of ComfyUI_EmAySee_CustomNodes. ComfyUI Manager → search the pack title → Install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
    # restart ComfyUI
    

    Under EmAySee_Utils, no dependencies. Note the display name renders as "EmAySee Random String SelectorFourChoice" with no space - it looks like a typo in the menu but it's just how the author registered it.

    Bottom line

    Four inputs, one roll, zero configuration. It's the picker you reach for when your pool is exactly four and you'd rather spend zero seconds setting it up.

    CategoryEmAySee_Utils

    Inputs (4)

    NameTypeDefaultDescription
    string_input_1STRINGInput String 1
    string_input_2STRINGInput String 2
    string_input_3STRINGInput String 3
    string_input_4STRINGInput String 4

    Outputs (1)

    NameTypeDescription
    RANDOM_SELECTED_STRINGSTRING