⚙️PreShow
Expand your wildcard prompt and actually see it
- SEED
- STRING
If you've ever wanted the ComfyRage Pre node to also show you what it produced, PreShow is the answer - it's the same preprocessing pipeline with a persistent display bolted on. Two nodes' work, one place on the canvas, one less wire to route around.
The context: ComfyUI only expands {a|b|c} random prompt syntax when the text is typed directly into a CLIP text widget. The moment that prompt lives in a subgraph or flows through a reroute, the curly braces stop expanding and the model reads them literally. Pre exists to expand the syntax once, deterministically, into a normal string output. PreShow does that too - it just also keeps the result on screen, saved into the workflow itself, so you can read what actually ran without adding a Show node to the graph.
How it works
PreShow shares the exact processing engine as Pre: strip /* */ and // comments, expand {a|b} blocks using a seed-driven RNG, convert [de-emphasis] into real (weight) syntax, then tidy commas and spacing. Same unbalanced-bracket ValueErrors, same fail-loud behavior.
What's added is persistence. The result gets written back into the node's saved state (widgets_values in the workflow JSON), and a small frontend extension renders it as a read-only widget. Because it's saved into the workflow itself rather than held in a temporary buffer, the text survives a reload - and because ComfyUI workflows travel as JSON or PNG metadata, that text travels with the file when you share it. Reopen a saved workflow and you can see exactly what that prompt expanded to on the run that produced the image.
Inputs and outputs
Same pair as Pre:
seed(INT) - controls which random option gets picked. Same seed, same expansion; change it to shuffle.pre(STRING, multiline) - your raw prompt with the wildcards and comments still in it.
Outputs are SEED (INT) and STRING (the expanded text). Unlike Pre, PreShow is an output node, and it returns its results to the UI - which is the whole point of the display half. The STRING output still wires into a CLIP Text Encode or downstream nodes, so you lose nothing by using the combined node.
Installing it
It's part of ComfyRage, a zero-dependency, public-domain pack - no pip packages, no models to download. Easiest: ComfyUI Manager → search ComfyRage → Install, then restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/rakkarage/ComfyRage
Restart and the nodes show up under rage.
When to use it instead of Pre
If you're iterating on a prompt and want feedback on every run, PreShow is the nicer choice - you get the expansion and the check in one node. If you're building a lean graph where the display would just be visual noise, plain Pre plus a CLIP Text Encode is enough. They're the same engine, so it's purely a question of whether you want to see the intermediate.
One habit to be careful with: since the display is part of the saved workflow, a PreShow left in a shared file carries your seed with it. Fine for reproducibility, mildly annoying if you meant to keep the wildcard fully random. Bump the seed when you want a fresh pick.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| pre | STRING | ({cat, {collar|}|dog, {collar|leash, ({viewer_holding_leash|})|}, {bone||}}), [[ornate_border], simple_background] // test | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| SEED | INT | — |
| STRING | STRING | — |