MD: Advanced Text Input
A text box that rolls dice for you
- processed_text
- original_text
- seed_used
- selected_seed
- text_length
- wildcard_count
Plain text nodes are fine until you want a prompt that changes every run. AdvancedTextNode is the version that turns {red|blue|neon green} into an actual choice instead of a literal string - inline wildcards, seeded so you can reproduce a draw, with a pile of output wires that tell you exactly what happened.
If you've used wildcard systems before, the syntax will feel familiar: with wildcard_mode on, {option1|option2} picks one option at random, and you can switch the syntax to __option1|option2__ double-underscore style if that's what your collection of wildcard files speaks. Every draw is deterministic from a seed, so the same seed gives the same pick every time.
The inputs that matter
There's a lot of surface here, but a beginner only touches a handful:
text- your prompt, template, YAML, whatever. Multi-line.wildcard_mode- the master switch. Off, and the text passes through byte-for-byte; on, and{a|b}patterns get resolved.seedandseed_mode-fixedfor reproducibility,randomfor a fresh pick every run,incrementfor batch work where each run should advance the draw. The tooltip's suggestion ofincrementfor batching is the right call.seed_list- a separate wildcard string ({1234|5678|9012}) that injects seed numbers rather than words, output on theselected_seedwire. Leave empty unless you're scripting seed sequences.
The rest is convenience: lowercase/uppercase (lowercase wins if both are on), strip_whitespace for cleaning pasted YAML, remove_extra_spaces (on by default, and you'll want it), and wildcard_syntax to pick the brace style.
What comes out
Six outputs, which is more than you'll usually wire up but useful when you need them:
processed_text- the resolved string. This is the one that feeds your CLIP Text Encode.original_text- what you typed, untouched.seed_usedandselected_seed- the actual seed that ran, and the value drawn fromseed_list.text_lengthandwildcard_count- diagnostics, handy for debugging a prompt that's silently shorter than you think.
A nice workflow pattern: run with seed_mode set to increment, batch a few images, and the prompt picks (and seeds) step forward in lockstep so you can see what each option produced. Wire seed_used into your KSampler seed for full reproducibility.
Installing it
It's part of MD Nodes (MDMAchine/ComfyUI_MD_Nodes). ComfyUI Manager: search MD_Nodes, install, restart. Or the manual route:
cd path/to/ComfyUI/custom_nodes
git clone https://github.com/MDMAchine/ComfyUI_MD_Nodes.git
cd ComfyUI_MD_Nodes
pip install -r requirements.txt
Restart ComfyUI. The pack's requirements file pulls in a lot more than text processing needs (audio DSP, LLM integrations), but the one-liner is the supported path. Python 3.10+ and a current ComfyUI.
Common issues
People mostly trip on the obvious thing: typing {red|blue} and getting the literal string back. That's wildcard_mode being off - it's off by default, deliberately, so text passes through exactly as written. Flip it on and the pattern resolves. The other gotcha is expecting the double-underscore syntax to work while wildcard_syntax is set to curly_braces; pick one style and stick to it.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | TEXT INPUT • Purpose: Main text input area for prompts, YAML, JSON, etc. • Usage: Type raw text or use wildcards like {option1|option2}. • Note: Multi-line compatible. | |
| seedopt | INT | 00–9007199254740991 | RANDOM SEED • Purpose: Controls randomization for wildcard selection. • Range: 0 to 9,007,199,254,740,991 (JS Safe Max). • Note: Ignored if 'seed_mode' is set to 'random'. ⭐ Recommended: Fixed value for reproducible generation. |
| seed_modeopt | COMBO | fixed | SEED MODE • Purpose: Defines how the seed updates per execution. • Options: - fixed: Uses the exact seed value provided. - random: Generates a new seed every run. - increment: Auto-adds 1 to the seed (great for batches). ⭐ Recommended: 'fixed' for testing, 'increment' for batching. |
| seed_listopt | STRING | SEED LIST (WILDCARD) • Purpose: Randomly pick ONE seed from a wildcard string. • Example: {1234|5678|9012} or __42|777|1337__ • Output: Outputs chosen value to the 'selected_seed' INT. ⭐ Recommended: Leave empty unless injecting specific seeds. | |
| seed_offsetopt | INT | 00–9007199254740991 | SEED OFFSET • Purpose: Adds an integer offset to the seed before processing seed_list. • Effect: Helps reduce repetition in batch workflows. ⭐ Recommended: 0. |
| wildcard_modeopt | BOOLEAN | false | WILDCARD MODE • Purpose: Enable processing of {opt1|opt2} or __opt1|opt2__ patterns. • Effect: If disabled, text passes through exactly as written. ⭐ Recommended: True if writing dynamic prompts. |
| strip_whitespaceopt | BOOLEAN | false | STRIP WHITESPACE • Purpose: Removes leading/trailing whitespace from the ENTIRE block. ⭐ Recommended: False (unless cleaning bad JSON/YAML). |
| lowercaseopt | BOOLEAN | false | FORCE LOWERCASE • Purpose: Converts entire output text to lowercase. • Note: Overrides 'Force Uppercase' if both are true. ⭐ Recommended: False. |
| uppercaseopt | BOOLEAN | false | FORCE UPPERCASE • Purpose: Converts entire output text to UPPERCASE. ⭐ Recommended: False. |
| remove_extra_spacesopt | BOOLEAN | true | REMOVE EXTRA SPACES • Purpose: Collapses multiple spaces into single spaces. ⭐ Recommended: True (keeps prompts clean). |
| wildcard_syntaxopt | COMBO | curly_braces | WILDCARD SYNTAX • Purpose: Choose the pattern style for wildcard parsing. • Options: {curly_braces} or __double_underscore__. ⭐ Recommended: curly_braces. |
| debug_modeopt | COMBO | 0 - Silent | LOGGING VERBOSITY • Controls console output and parser profiling. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| processed_text | STRING | — |
| original_text | STRING | — |
| seed_used | INT | — |
| selected_seed | INT | — |
| text_length | INT | — |
| wildcard_count | INT | — |