Nodes/🗂️ Dict Tools/🗂️Dict → ANY◯
ComfyUI Node

🗂️Dict → ANY◯

The untyped escape hatch for your dict

By Lex-DRL·Created 4 months ago·Updated 4 months ago· 1
🗂️Dict → ANY◯
  • dict
  • value
◄key—►
â—„cleanup_keytrueâ–ş

Every other extraction node in this pack is fussy in a specific, useful way: DictExtractBool insists the stored value actually is a boolean, DictExtractFloat insists it's a float, and so on. DictExtractAny ("🗂️Dict → ANY◯") is the one that skips all that. It pulls whatever is under a key and hands it back with no type checking at all, as the generic ANY type.

That makes it the escape hatch you reach for in two situations. First: you stored something with DictAddAny and you want it back without declaring what it is. Second: you genuinely don't care about the type at extraction time - you just want "the thing that was saved under this key" and you'll wire it into whatever wants it. In ComfyUI, an ANY output can connect to just about any input, so this is the most flexible wire in the pack.

What you set

  • dict (required) - the dictionary to read from. It must actually have at least one entry; an empty dict is refused.
  • key - the slot to read.
  • cleanup_key (on by default) - strips spaces and extra newlines, so keys are matched loosely on whitespace.

Output: value as ANY. Wire it anywhere.

Where it earns its keep

The dict-bus pattern - build a dict at the top of a workflow, extract values down at the bottom - runs into edge cases where a single dict holds a grab-bag of types. Maybe one slot is a string you know is really a float, or a slot you share between two branches that treat it differently. Typed extractors would force you to commit; DictExtractAny lets the downstream node do the interpreting.

It's also the honest default for quick experiments. If you're prototyping a bus and don't want to think about types yet, DictAddAny + DictExtractAny gets you a working loop in two nodes, and you can tighten the typing later once the shape of the workflow is settled.

How it behaves

Under the hood it's the same machinery as the typed extractors - read the dict, look up the key, return the value - minus the validation. That has a real cost: because there's no type check, a mismatch surfaces downstream instead of here. Where a typed node fails fast with "Value isn't a <float> instance", this one hands you whatever was there and lets the next node choke on it. For glue and prototyping that's a fair trade. For production pipelines, prefer the typed extractors so errors land in the obvious place.

Same pack rules apply: missing keys error hard ("No such key in Dict"), the dict is immutable, and there's no built-in inspector if you want to see what's inside.

Install

Standard for the pack - small, focused, one lightweight dependency (frozendict), no model downloads. ComfyUI Manager: search "Dict Tools". Or:

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

Restart ComfyUI. Needs 0.18.0+ - if the nodes are missing after install, update ComfyUI first. If a workflow you loaded is missing these nodes, that's usually the version gap, not a broken install.

Category🗂️ Dict Tools/Extract

Inputs (3)

NameTypeDefaultDescription
dictDICTA Dictionary to work with.
keySTRINGKey (name) of the item extracted from the dict.
cleanup_keyBOOLEANtrueAutomatically remove leading/trailing spaces and extra newlines from the key.

Outputs (1)

NameTypeDescription
value*The actual any-type item extracted from the Dict.