ComfyUI Node

Prompt Randomizer

Randomizes text prompts using pattern replacement with dictionary support, validation, and flexible text processing options. Can generate multiple prompts for batch processing.

By Pirog17000·Created about a year ago·Updated 9 months ago· 3
Prompt Randomizer
    • modified_prompts
    • selections
    • used_seed
    prompt?color? ?dog|cat? with ?orange|black? dots on the ?couch|floor?
    dictionary_filenameprompt_dictionary.json
    seed-1
    preserve_newlinesfalse
    clean_texttrue
    prompts_count1
    Categorypirog/text

    Inputs (6)

    NameTypeDefaultDescription
    promptSTRING?color? ?dog|cat? with ?orange|black? dots on the ?couch|floor?Use pattern ?word1|word2|metaword? to randomize. Encapsulate groups with question marks. Meta-words are looked up in the dictionary.
    dictionary_filenameSTRINGprompt_dictionary.jsonDictionary filename (relative to this node pack). Will create a default if not found.
    seedINT-1-1–18446744073709550000Set to -1 for random seed each run, or any positive number for reproducible results.
    preserve_newlinesBOOLEANfalseKeep newlines in output. When disabled, newlines are converted to commas.
    clean_textBOOLEANtrueApply text cleaning (remove extra spaces, fix punctuation, convert anime terms).
    prompts_countINT11–100Number of randomized prompts to generate. Useful for batch processing with samplers that support multiple prompts.

    Outputs (3)

    NameTypeDescription
    modified_promptsSTRING
    selectionsSTRING
    used_seedINT