ComfyUI Node

Random List Picker

A ComfyUI node in utils with 11 inputs and 4 outputs.

By mattjohnpowell·Created 2 years ago·Updated 2 months ago· 57
Random List Picker
    • selected_item
    • prompt
    • item_count
    • selected_index
    itemsrock pop jazz::2 classical hip-hop
    template
    prefix
    suffix
    exclude
    fallback
    count1
    separator,
    caseoriginal
    modepick
    seed-1
    Categoryutils

    Inputs (11)

    NameTypeDefaultDescription
    itemsSTRINGrock pop jazz::2 classical hip-hopOne item per line. Empty lines are ignored. Weighted syntax: item::weight (e.g. jazz::3 is 3× more likely). Default weight is 1.
    templateoptSTRINGPrompt template with {item} as a placeholder. Example: 'Create a {item} song with heavy bass.' When count > 1, items are joined with the separator before substitution. Overrides prefix/suffix when non-empty.
    prefixoptSTRINGText prepended before the chosen item(s). Used when template is empty.
    suffixoptSTRINGText appended after the chosen item(s). Used when template is empty.
    excludeoptSTRINGItems to never pick, one per line. Matching is case-insensitive.
    fallbackoptSTRINGValue returned when no items remain after exclusions.
    countoptINT11–100Number of unique items to pick. Automatically capped at list size.
    separatoroptSTRING, String used to join multiple picked items (e.g. ', ' ' | ' '\n').
    caseoptCOMBOoriginalCase transformation applied to each picked item.
    modeoptCOMBOpickpick – choose random item(s) from the list. shuffle – return the entire list in a random order.
    seedoptINT-1-1–2147483647Random seed. Use -1 for a new random result each run.

    Outputs (4)

    NameTypeDescription
    selected_itemSTRING
    promptSTRING
    item_countINT
    selected_indexINT