Nodes/ComfyUI-PromptWrapper/Random Line Prompt
ComfyUI Node

Random Line Prompt

Pick one random line from your text — the poor man's wildcard picker

By clouddreamfly·Created about a year ago·Updated 8 months ago· 4
Random Line Prompt
    • text
    text
    seed0
    input_prompt

    You want to generate fifty variants and have the outfit, the background, or the pose change between runs. Full wildcard systems do this with __category__ syntax and a whole folder structure. Random Line Prompt does it with a text box and a line break: type one option per line, and the node picks a single random line, seeded, every time you run. It's the minimal version of dynamic prompting, and for "just randomize this one clause" it's honestly enough.

    How it works

    The node's own tooltip is the whole spec: "string split is use \n character." It splits the multiline text input on newlines, treats each non-empty line as a candidate, then picks index seed % line_count. Same seed, same pick - so your randomization is reproducible when you want it to be, and you only need to bump the seed to explore.

    It also has an optional input_prompt (a force-wired string) that gets prepended to the chosen line, joined with a comma. That's a nice touch: a fixed subject in the input_prompt, randomized descriptors on the lines.

    Inputs and output

    • text - multiline, one candidate per line.
    • seed - the picker's dice. Default 0.
    • input_prompt (optional) - a fixed string prepended to the result.
    • text - the single output: input_prompt, <chosen line>.

    Install

    ComfyUI Manager → Custom Nodes Manager → search ComfyUI-PromptWrapper → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/clouddreamfly/ComfyUI-PromptWrapper
    

    No dependencies, no models - it's a string splitter with extra steps.

    Where people get burned

    Nothing exotic here, but a few habits help. Watch your blank lines: the split keeps every line, and while empty entries don't crash anything, a stray blank line shifts your seed math - one extra newline changes which line wins. And it picks only one line; if you want several categories randomized at once, you'd chain a few of these through Combine Prompt, or reach for the pack's Randoms Prompt which does eight draws in one node. Also keep in mind this is text-only randomization - if you're iterating over seeds anyway, this saves you from hand-editing the prompt between runs, but it doesn't coordinate with the sampler's seed unless you wire them together.

    CategoryPromptWrapper

    Inputs (3)

    NameTypeDefaultDescription
    textSTRINGstring split is use \n character.
    seedINT00–18446744073709550000
    input_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING