◯ANY → Dict🗂️
Shove Anything Into a Dict
- dict
- value
- dict
The rest of the Dict Tools pack is a row of type-checked adders - one for images, one for latents, one for each flavor of model. DictAddAny is the one that says "sure, throw it in" and asks no questions. It stores any type of value under a string key, no validation at all.
Reach for it when the thing you want to bundle into your bus isn't one of the pack's predefined types, or when you're prototyping and don't want to think about which typed node you need. It's the same node the pack's older StringConstructor workflows used, carried over under a new name - so if you see old guides referencing StringConstructorDictAddAny, this is its modern equivalent.
How it works
Where a typed Add node checks your value against its expected type and raises a TypeError if you wire a mismatch, this one just stores whatever you hand it. Everything else is shared Dict Tools behavior: the dict is a frozendict, the node returns a new dict each time rather than mutating what you fed in, and keys get sorted alphabetically on every update.
The trade-off, naturally, is on the way out. DictExtractAny will happily return the value, but if you want a typed extraction you need the key to hold the type that extractor expects. Garbage in, type error out.
The inputs that matter
- key (STRING) - the name you'll fetch it by later.
- cleanup_key (BOOL, default on) - strips stray spaces/newlines from the key.
- dict (DICT, optional) - extend an existing dict, or leave empty to start one.
- value (*, optional) - the anything-goes payload. Wire anything: a string, an image, a list, a model.
Output is dict (DICT), ready to chain into another Add or into an Extract node.
Install
ComfyUI Manager: search Dict Tools, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart ComfyUI after. The only dependency is frozendict, which Manager installs for you.
Gotchas
Same pack-wide note as everywhere else: this is a Node-2.0-API pack, so it needs ComfyUI 0.18.0+. If it shows up red in Manager, update ComfyUI.
The "any" nature bites in one specific way: since there's no type check on add, a wrong type only surfaces when an Extract node downstream tries to validate it. If your workflow is acting up and you're sure the logic is right, check what's actually sitting under that key - this node is the usual suspect for smugglers.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | Key (name) of the item inserted into the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
| dictopt | DICT | An (optional) Dictionary to work with. | |
| valueopt | * | The actual any-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |