Nodes/ComfyUI_Mira/Text Wildcard Seprator
ComfyUI Node

Text Wildcard Seprator

Split one text box, pick the piece you want

By mirabarukaso·Created 2 years ago·Updated 5 days ago· 206
Text Wildcard Seprator
    • text_out
    text
    seprator|
    switch0

    This one's for people who want to run their own wildcards by hand instead of letting a random node roll for them. You paste a list of options into a text box, separated by some character, and this node splits on that character and hands you back the segment at the index you pick. "Wildcard," but manual - you choose the pick, not chance.

    That's the whole appeal, and it's a real one. Dynamic-prompt wildcards are great for batch variety, but sometimes you know exactly which option you want and you just want it selectable from a dial - think of a text box holding red dress | blue kimono | green hoodie and you flip to segment 1 to lock the blue kimono for this run. It's old-school A1111 wildcard energy (a syntax most people who arrived after 2024 never learned) reimagined as a deterministic picker.

    How it works

    You give it the text, the separator character, and an index. The node splits the text on the separator into a list of segments and outputs the one at your index. Segments are zero-based, and the current ceiling is 20 (indices 0 through 19). The default separator is the pipe |, which is the classic wildcard delimiter, but you can set it to anything - a comma, a newline, whatever matches how you wrote your list.

    The inputs that matter

    • text - your multi-line source list, e.g. several options separated by |.
    • seprator - the split character. Defaults to |. (Yes, "seprator" - that's the actual input name.)
    • switch (INT, 0–19) - which segment to output, counting from 0.

    The output

    • text_out - the selected segment as a plain STRING. Wire it into a CLIP Text Encode, into another Mira text node, or anywhere a prompt fragment goes.

    Installing it

    Install the pack. ComfyUI Manager: Manager -> Custom Nodes Manager, search ComfyUI_Mira, Install, restart. Or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mirabarukaso/ComfyUI_Mira.git
    

    Restart. On a load error, pip install -r requirements.txt inside the folder, then restart. No models.

    Common issues

    Two things bite. First, whitespace: the split is on your separator, so if you wrote red | blue | green with spaces around the pipes, your segments come out as " blue " with the padding attached. Either write the list tight (red|blue|green) or be ready for leading/trailing spaces in the output. It's a literal split, not a smart tokenizer.

    Second, the index range. It tops out at 19, and pointing switch past the number of segments you actually have gets you nothing useful - count your options and stay in range. If you're pairing this with a Seed Generator or a counter to cycle through segments, make sure that driver stays within your list length.

    For genuinely random selection you'd want an actual dynamic-prompt wildcard node instead; this is the deliberate, "I'll pick it myself" tool, which is exactly what the author built it for. It's part of ComfyUI_Mira, mirabarukaso's personal utility pack (the WAI Character Select dev). The README pairs it with their Text Loop Combiner in a shared example if you want to see manual wildcard assembly end to end.

    CategoryMira/Text

    Inputs (3)

    NameTypeDefaultDescription
    textSTRING
    sepratorSTRING|
    switchINT00–19

    Outputs (1)

    NameTypeDescription
    text_outSTRING