Nodes/ComfyUI-WJNodes/Random Select Prompt
ComfyUI Node

Random Select Prompt

A reproducible random picker for a list of prompts

By 807502278·Created 2 years ago·Updated 11 months ago· 21
Random Select Prompt
    • Prompt
    • Prompt_list
    Prompt
    select_number1
    Original_data_deduplicationfalse
    allow_duplicatesfalse
    keep_ordertrue
    random_seed1

    Random Select Prompt is a bit of an odd one in this pack: it's not mentioned anywhere in the pack's own README, and its docstring in the code is empty - so what follows is built entirely from what the node's inputs and outputs actually are, not from any author explanation. Worth knowing going in, and it's a genuine gap in this pack's own documentation, not something being guessed at lightly.

    The inputs and outputs that matter

    What it clearly does, from the schema: you give it a block of text in Prompt (a multiline field - almost certainly meant to hold a list of candidate prompts or tags, one per line or comma-separated), and it randomly picks select_number of them, using random_seed so the same seed reproduces the same selection every run. Two toggles shape the pool and the pick: Original_data_deduplication strips duplicate entries out of your input list before anything gets selected, and allow_duplicates controls whether the same entry can be chosen more than once within a single selection. keep_order (on by default) preserves the order entries appeared in your original list rather than shuffling the picks around.

    Two outputs come back: Prompt, a string, and Prompt_list, also typed as a string. The likely intent - reading the naming pattern the rest of this pack uses - is that Prompt gives you the selection collapsed into one usable block, while Prompt_list keeps the selected entries separated for anything downstream that wants to iterate them one at a time. Treat that as an educated read rather than a documented fact, and check both outputs in a node preview the first time you use it to confirm which shape you actually need.

    The obvious use case regardless of the exact output shape: you keep a big running list of styles, tags, character descriptions, or full prompts, and want a reproducible random subset of it each run - for variation testing, dataset sampling, or a "surprise me" picker you can still pin down to a specific outcome later via the seed.

    Installing it

    It comes bundled with the rest of ComfyUI-WJNodes. ComfyUI Manager, search "ComfyUI-WJNodes," install, restart - or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/807502278/ComfyUI-WJNodes.git
    

    You'll find it under WJNode → Prompt once the pack is loaded. No models, no special dependencies for this one.

    Where people get burned

    Since this node has no README coverage and no author notes, the safest way to learn its exact behavior is to just run it: put five or six short test lines in Prompt, set select_number to 2, and watch how the two outputs differ, then flip allow_duplicates and keep_order one at a time to see what each actually changes. That fifteen-minute experiment will tell you more than the docs currently can. And if you went looking through the pack's GitHub README for install notes or examples specific to this node - it won't be there; it simply isn't documented.

    CategoryWJNode/Prompt

    Inputs (6)

    NameTypeDefaultDescription
    PromptSTRING
    select_numberINT11–4096
    Original_data_deduplicationBOOLEANfalse
    allow_duplicatesBOOLEANfalse
    keep_orderBOOLEANtrue
    random_seedINT10–99999999

    Outputs (2)

    NameTypeDescription
    PromptSTRING
    Prompt_listSTRING