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

string → Dict🗂️ [OLD]

Add a prompt chunk the legacy way

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

A String Constructor fossil that still works

string → Dict🗂️ [OLD] is the legacy alias of the modern string → Dict🗂️ (DictAddString). The "[OLD]" tag is the giveaway: these nodes predate the Dict Tools pack, back when they were supporting utilities inside Lex Darlog's String Constructor pack. When the dict nodes moved into their own home, the old IDs stayed registered so existing workflows keep loading. New graphs should use the modern node; old graphs keep running.

What it does

Stores a single string into a dict under a name - the bread-and-butter operation of any text-bus workflow. You're building prompt chunks, and this is one way to slot a chunk into the bundle:

  • name - the key to store the string under.
  • string - the value, multiline. Prompt text, usually.
  • cleanup - on by default; each line of the value is stripped of leading/trailing spaces before storage.
  • dict - optional; pass an existing DICT in and the new item merges on top, producing a new dict.

The dict output is the merged result. Like every Add node in the pack, it returns a fresh immutable frozendict - you can't mutate the input in place, you always thread the output forward.

The migration gotcha that bites people

There's one subtle behavioral difference between this legacy node and its modern replacement, and it's the kind of thing that costs you an hour. The modern DictAddString strips the key too - cleanup_key defaults to on, so " prompt" and "prompt" store identically. This old version does not strip the key at all. It only runs the value cleanup.

Consequence: if you type "prompt " with a trailing space in the name field here, that space is part of the stored key, and your extract node will fail with No such key in Dict unless it matches exactly. Keys are case-sensitive as well. If an old workflow misbehaves and the keys look right, this is the first thing to suspect - a hidden space in a legacy key.

Installing it

Same pack as always. 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; nothing heavy. Requires ComfyUI >= 0.18.0 - update ComfyUI if the nodes don't show up.

What to actually do

New graphs: use string → Dict🗂️ (DictAddString). It's the same logic with a cleanup_key toggle, better tooltips, and a cleanup_value control that makes the value stripping explicit. If a downloaded workflow references this legacy node, it'll run fine - just remember the key isn't being cleaned, and double-check for stray spaces when things won't match.

Category🗂️ Dict Tools/_old

Inputs (4)

NameTypeDefaultDescription
nameSTRINGKey (name) of the item inserted into the dict.
cleanupBOOLEANtrueWhen enabled, each line in the value-string is individually stripped of any leading/trailing spaces.
stringSTRINGThe actual string to add into the Dict.
dictoptDICTAn (optional) Dictionary to work with.

Outputs (1)

NameTypeDescription
dictDICT