π Dic Convert
A lookup table that turns an input into a mapped output
- input
- value output
Dic Convert is a dictionary node - a lookup table you define inline. You write out a set of key:value pairs, feed it an input, and it returns the value whose key matches. That's it, but it's the piece that lets a workflow turn one choice into a whole set of concrete parameters. Pick a model name, map it to that model's ideal CFG. Choose an aspect label, map it to actual width and height. Route a keyword to a preset. The pack groups it with Menu Option for exactly this: "dynamically changing variables based on input."
It's the node-graph version of a switch statement or a config lookup, and once you see it you'll find uses for it everywhere you were hard-coding a value.
How it works
You define the mapping in the setting box, one pair per line, like:
key:output1
key2:output2
key3:output3
other:output4
Feed an input, pick how to match it with the logic dropdown, and the node walks your pairs, tests the input against each key, and returns the matching output. The other key acts as the catch-all fallback when nothing else matches - a sensible default for anything unexpected.
The logic options go beyond exact equality: input = key, input in key, key in input (substring both directions), and the numeric comparisons input >= key, input <= key, input > key, input < key. So you can map ranges of numbers, or match on a keyword appearing inside a longer string.
The inputs and outputs that matter
input(any type) - the value to look up.logic- how to match input against each key (equality, containment, or a numeric comparison).setting(multiline STRING) - yourkey:valuepairs, one per line, withother:as the fallback.
The output is value output - the mapped result, ready to drive whatever parameter you were mapping toward.
How to install it
Comes with the SDVN pack. ComfyUI Manager, search SDVN_Comfy_node; or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt
from the ComfyUI root, then restart. No models, no dependencies.
Common issues & troubleshooting
The format has to be key:value, one pair per line. A missing colon or a stray blank line can throw off the parse. Keep each pair clean on its own line, and mind trailing whitespace - the default template ships with some padding that's easy to leave in.
Nothing matched and you got the fallback (or nothing). That's what other: is for - always include an other line so an unmatched input has somewhere to land. Without it, an input that matches no key has no output to give.
Wrong logic for the job. Exact input = key won't match if your input is a longer string that merely contains the key - use key in input for that. And for numeric ranges you want the >= / <= comparisons, not equality. Pick the operator that matches how you're keying.
Numeric vs string keys. If you're doing >= comparisons, make sure both the input and the keys read as numbers, or the comparison falls back to text ordering and surprises you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input | * | β | |
| logic | COMBO | 7 options: input = key, input in key, key in input, input >= key, input <= key, input > key, +1 | |
| setting | STRING | key:output1 key2:output2 key3:output3 other:output4 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value output | * | β |