ComfyUI Node

makitextwildcards

Roll a random line from text you pasted — no wildcard file required

By MakkiShizu·Created 2 years ago·Updated about a year ago· 26
makitextwildcards
    • text
    randomstrue
    seed0
    text

    makitextwildcards is the lightweight sibling of makiwildcards in the same pack. Where the main node pulls random lines out of files you've saved, this one pulls a random line out of text you paste directly into the node. One multiline box, one line out. That's the whole trick.

    Which sounds trivial until you hit the workflow where it's exactly right: you have a list of five hair colors you want to randomize for a test batch, but you don't want to create a .txt file, put it in a wildcards folder, restart ComfyUI, and pick it from a dropdown - just to try one idea. Paste the list, run, done. It's also a nice way to prototype a wildcard list before you commit it to a file: verify the lines you'd actually get, then save the file and switch to makiwildcards for the real thing.

    How it works

    The node splits your multiline text on newlines and returns one line. The randoms and seed inputs behave identically to makiwildcards, which is the point of keeping them in the same pack:

    • randoms = true - a random line, seeded by seed. Same seed reproduces the same pick.
    • randoms = false - deterministic row selection: line (seed - 1) % number_of_lines. Seed 1 is the first line; seed 0 wraps to the last.

    This is the same parsing convention traditional wildcard .txt files use, so if you already think in "one option per line," nothing new to learn.

    Inputs and outputs

    • text - the multiline source text. Each line is a candidate.
    • randoms - random pick vs. seed-driven row selection.
    • seed - the random seed (or the row selector when randoms is false).

    Output is a single text string - one line from your pasted block, which you wire into whatever takes a prompt string. Note that unlike the file-based wildcard node, there's no clean_whitespace or replace_underscore here; lines come out stripped but underscores stay put. If you're feeding danbooru-style tag lists with underscores, run the output through textconcatenate (same pack, has the underscore-to-space option) or handle it downstream.

    Installation

    It ships in the ComfyUI-Prompt-Wildcards pack. Via ComfyUI Manager, search the pack title; or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MakkiShizu/ComfyUI-Prompt-Wildcards.git
    

    Then restart ComfyUI. No dependencies beyond what ComfyUI already provides, no model files.

    Common issues

    • Empty output. If the text field is blank or the lines are empty, there's nothing to pick. Make sure the multiline box actually has content.
    • The "wrong" line with randoms = false. Remember it's one-based: seed 1 = first line, and seed 0 wraps to the last line. That tripped up everyone who tried makiwildcards' deterministic mode too.
    • Same output every run. That's the seed doing its job. Change seed to reroll; change randoms to true if you want it different every time without touching a number.

    It's a one-job node, and it does the one job cleanly. If you need real file-based wildcards with probability controls, the pack's makiwildcards and makiwildcards_Advanced have you covered - this one's for the quick, throwaway randomization.

    Categoryutils/Prompt-Wildcards

    Inputs (3)

    NameTypeDefaultDescription
    randomsBOOLEANtrue
    seedINT00–18446744073709550000
    textoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING