Nodes/🗂️ Dict Tools/🗂️Dict → string [OLD]
ComfyUI Node

🗂️Dict → string [OLD]

The legacy Dict → string, and its literal-key trap

By Lex-DRL·Created 4 months ago·Updated 4 months ago· 1
🗂️Dict → string [OLD]
  • dict
  • value
name
show_statusfalse

The oldest Dict → string, still running in old workflows

🗂️Dict → string [OLD] is the legacy alias of the current 🗂️Dict → string (DictExtractString) node. It's a String Constructor-era ID kept alive for backwards compatibility: when the dict nodes split out of Lex Darlog's String Constructor pack into 🗂️ Dict Tools, the old names stayed registered so saved workflows keep loading. It does exactly what the modern node does - pull a string out of a dict by key - with one behavior difference that's easy to trip on.

What it does

Look up a value in a dict by name and return it as a string:

  • name - the key to look up. Case-sensitive.
  • dict - the DICT to pull from.
  • show_status - off by default; turn it on to render the extracted string on the node itself, handy for debugging without wiring up a display node.

The value output is a STRING, ready for CLIP Text Encode or any text consumer. Non-string values are converted with Python's repr(), and a None value comes back as an empty string.

The trap: this node does not clean the key

Here's the difference that has quietly wasted people's afternoons. The modern DictExtractString has a cleanup_key toggle (on by default) that strips leading/trailing spaces and extra newlines from the key you type. This legacy version has no cleanup - it matches the key literally, spaces and all.

So if a dict was built with a key that picked up a trailing space - which the old StringConstructorDictAddString node is prone to producing, since it doesn't strip keys either - the extract has to reproduce that exact space to hit it. Key missing means a hard No such key in Dict error, not an empty string. Note the tooltip here claims a missing key returns an empty string; the shipped code raises instead, so don't plan around the tooltip.

Installing it

Part of 🗂️ Dict Tools. ComfyUI Manager, search Dict Tools (Lex-DRL/ComfyUI-DictTools), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools

Restart ComfyUI. Only dependency is frozendict; no models. Requires ComfyUI >= 0.18.0 - update ComfyUI if the nodes don't appear.

What to actually do

New graphs should use 🗂️Dict → string (DictExtractString) from the Extract category - same lookup, but you get cleanup_key back, so stray whitespace in the box stops being a failure mode. If a downloaded workflow references this legacy ID, it'll run fine; just be aware the key is matched literally and check for hidden spaces if extraction fails. When in doubt, turn on show_status and eyeball exactly what string came back.

Category🗂️ Dict Tools/_old

Inputs (3)

NameTypeDefaultDescription
nameSTRINGKey (unique name) of a string to extract from dictionary. If the element with such key isn't a string, it will be turned to one. If no such key exists in the dict, an empty string returned.
show_statusBOOLEANfalseShow the extracted string on the node itself?
dictDICTA Dictionary to work with.

Outputs (1)

NameTypeDescription
valueSTRINGThe actual string item extracted from the Dict.