Variables (Shinsplat)
One dictionary that rewrites $PLACEHOLDERS across your whole workflow
- STRING
- help
The biggest maintenance annoyance in ComfyUI is changing the same value in six places. Variables is the pack's small answer: define a name-to-value dictionary once, write $NAME in any text that flows through this node, and get the substituted text out the other side. It's basic, it's from June 2024, and it's exactly the kind of node you stop noticing after a week because it just works.
How it works
The text input (multiline, with a sensible default) holds a dictionary/JSON mapping like:
"THAT": "some text here",
"THIS": "some other text",
Anything else you type in the same box - or pipe in through the optional text_in - gets scanned for $PLACEHOLDER tokens, and each one is replaced with its dictionary value. The STRING output is the substituted result; there's also a help output with the usage notes. If you're already using the pack's String Interpolated node, this slots in right before it: Variables resolves the $NAME tokens, String Interpolated handles the dynamic/prompt expansion.
The dictionary lives on the node itself, so one Variables node can be the single source of truth for a workflow's recurring values - a style token, a character name, a resolution - and anything you route through it picks up the change in one place instead of six.
The inputs and outputs
text- the dictionary definition (and optionally, literal text to substitute).text_in- optional input carrying text that should have its$PLACEHOLDERs replaced.
Outputs: STRING (the substituted text) and help.
How to install it
Ships in ComfyUI-Shinsplat:
cd ComfyUI/custom_nodes
git clone https://github.com/Shinsplat/ComfyUI-Shinsplat
or ComfyUI Manager → "ComfyUI-Shinsplat" → restart. No extra deps.
Common issues
- "The placeholder didn't get replaced" - check the syntax: the node looks for
$followed by the name in the dictionary, and the dictionary keys are case-sensitive. A missing key usually passes through unchanged. - "Do I need this AND String Interpolated?" - different jobs: Variables does named substitution, String Interpolated does dynamic-prompt/wildcard expansion. They compose, they don't compete.
- Output looks identical to input - if nothing in your text uses
$NAME, there's nothing to substitute. That's not a bug, that's a placeholder with no callers.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | "THAT": "some text here", "THIS": "some other text", | — |
| text_inopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| help | STRING | — |