Dict Get
Pull one value out of a dict and get it in six flavors
- py_dict
- as_string
- as_int
- as_float
- as_bool
- as_dict
- as_list
Dict Get is the keyhole into any PYDICT. You hand it a dictionary and a key, and it digs the value out - then hands it back to you in six type flavors at once, because ComfyUI doesn't do dynamic types and someone had to cover the bases. It's the natural second half of the JsonParse flow, and it's where "parse a JSON API response" stops being a pain and becomes a two-node habit.
Here's the shape of a real use: your workflow calls an image API that returns a big JSON blob with width, height, seed, and a parameters object nested inside. You parse it with JsonParse, wire the py_dict into Dict Get, type parameters.seed as the key, and the seed comes out as an integer you can feed straight into a sampler node. That's the whole point - API output goes from opaque text to a value you can wire.
The inputs that matter
py_dict(required) - the dictionary to search. Comes from a JsonParse node or any otherPYDICTsource.key(required) - the lookup key, and it supports dot notation.parameters.seedwalks nested dicts.settings.widthtoo. This is the single most useful feature and easy to miss, because the field just looks like a plain text box.default(optional) - a fallback value if the key doesn't exist. The catch: it's parsed as JSON first, so"42"(with quotes) gives you the number 42, while42also gives you 42, and plaintextgives you a string. Empty string means "no default," and you getNoneinstead.
The six outputs, and which to use
The node returns as_string, as_int, as_float, as_bool, as_dict, and as_list. Every value is coerced into all six types where possible; where a coercion fails, that output is None.
as_stringis your safe bet - every value becomes a string, including dicts and lists (JSON-serialized).as_int/as_float/as_bool- pick the type that matches what the target node wants."3"coerces to int 3;"true","yes","1"coerce to bool True;"false","no","0"to False.as_dict/as_list- only populated if the value actually is a dict or list. Wire these when you want to drill one level deeper or iterate.
The trap beginners hit: they wire as_int for a value that can't coerce, get None, and blame the node. If you're not sure what type the value is, grab as_string first and look at it.
Installing it
ComfyBros installs like any custom node pack - ComfyUI Manager, search "ComfyBros", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/turnbros/ComfyBros
The pack's README is stale (it references a requirements.txt that doesn't exist; the real deps are in pyproject.toml and Manager installs them). Dict Get lives under ComfyBros/JSON.
Gotchas
Missing keys with no default raise a KeyError, so if your workflow dies complaining about a key, either the JSON shape changed or your dotted path has a typo - parameters.seed and parameters.seeds are not the same. Dotted paths also mean a key that literally contains a period can't be reached; that's rare, but it's the one real limitation.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| py_dict | PYDICT | — | |
| key | STRING | — | |
| defaultopt | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| as_string | STRING | — |
| as_int | INT | — |
| as_float | FLOAT | — |
| as_bool | BOOLEAN | — |
| as_dict | PYDICT | — |
| as_list | PYLIST | — |