Prompt Parse
Expand wildcards, groups and variables before the prompt hits the encoder
- text
- raw_text
Prompt Parse is the node that actually does the text-expansion work behind ComfyUI's fancier prompting. Feed it a prompt containing __terms__, <a|b|c> groups or $|phrase|$ variables, and it returns the finished text - the exact markup CLIPTextEncode (NSP) understands, but stopped before the encoder so you can save the result, split it, or encode it elsewhere. If you've been pasting __animals__ into prompts and only half-understanding why the phrase changes each run, this is the node that makes it visible.
It sits one step back from the encoder deliberately. Rather than hiding the expansion inside a text encoder node, Prompt Parse hands you the resolved string on a socket. That one choice makes the whole thing debuggable: you can see exactly what a given seed drew, and you can wire the finished prompt into a save node so every render keeps a record of the actual text that made it - worth doing, because a resolved prompt is otherwise gone the moment the graph moves on.
The three markups it resolves
__term__- draws a phrase from the Noodle Soup Prompts terminology pantry, or a line from a wildcard file.modechooses the source (Noodle Soup Promptsuses the shared pantry, stored inwas_state.db), andnoodle_keysets the markers on either side - the default__turns__animals__into a draw.<a|b|c>groups - dynamic prompt alternation.dynamic_promptsresolves them to one option; turn it off to keep the brackets in the text.$|phrase|$variables - captures numbered in the order they appear and replaced by$1,$2and so on. Gated byprompt_variables.
seed makes the whole parse repeatable: any value other than 0 means the same seed and same input produce the same words every run, which is how you keep a "random" prompt stable while you hunt for the good one.
Outputs
text is the finished prompt with every enabled markup expanded. raw_text is the prompt exactly as it arrived, markup and all - handy for a side-by-side save. Both are plain STRING, so they'll feed any text encoder, a Text Concatenate, or Text Save for the archive.
Where it fits, and the honest caveats
The pragmatic pattern is Prompt Parse → CLIP Text Encode, with the resolved text also split off to a save node. It plays well with Prompt Tag Cleanup downstream if the pantry draws multi-tag lines you want tidied, and with Noodle Soup Term Edit upstream if you want the pantry to hold your own vocabulary.
The caveat is the same one that applies to any wildcard setup: expansion is per-run and seed-dependent, so two runs with the same prompt string can produce different actual text unless you pin the seed. That's a feature when you want variation and a trap when you're debugging a specific bad image - which is exactly why the seed input and the text output (save it!) exist.
Installing
Prompt Parse is part of WAS Node Suite v3. ComfyUI Manager → search WAS Node Suite v3, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
Restart after. Needs ComfyUI 0.14.0+ and Python 3.10+. No packages install - v3 runs on what ComfyUI already has. Pulling a real random word from the terminology pantry is local and instant, unlike the old v2 pack's behavior of requiring a pile of extra dependencies just to boot.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The prompt, in any of three markups. __term__ draws a phrase from the terminology pantry or a line from a wildcard file; <a|b|c> picks one of the alternatives; $|a stormy sky|$ captures the phrase as $1 so it can be repeated by number later in the prompt. | |
| mode | COMBO | What __terms__ are replaced with. `Noodle Soup Prompts` draws from the shared terminology pantry, downloaded once and then cached. `Wildcards` draws a random line from the matching file in the wildcards directory, where a subfolder is part of the name, so __animals/birds__ reads animals/birds.txt. `none` leaves __terms__ alone, for a prompt that only uses the groups and variables below. | |
| noodle_key | STRING | __ | The marker put either side of a term to flag it for replacement. With the default '__', __animals__ is replaced and plain animals is not. |
| seed | INT | 00–18446744073709550000 | Which words get drawn. Any value other than 0 makes the whole parse repeatable, so the same seed and the same prompt always give the same text. 0 is the exception the term draw treats as unseeded, so __terms__ come out different every run while the <a|b|c> groups stay fixed. |
| dynamic_prompts | BOOLEAN | true | Whether <a|b|c> groups are resolved to one of their options. Turn it off to keep the brackets in the text, which is what a prompt being passed on to another parser needs. |
| prompt_variables | BOOLEAN | true | Whether $|phrase|$ captures are expanded. A capture is numbered in the order it appears and replaced by $1, $2 and so on, and every reference to that number anywhere in the prompt then becomes the phrase, which is how one long description is written once and repeated. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | The finished prompt, with every enabled markup expanded. Worth saving beside the image with Text Save, since a new seed produces different words. |
| raw_text | STRING | The prompt exactly as it arrived, markup and all. |