- DICT
- default
- any
GetDict pulls a value out of a DICT by its key. It's one half of this pack's dictionary system - an alternative to piping where, instead of bundling connections into a typed pipe, you pack arbitrary values into a dictionary under string keys and unpack them wherever you need them. Set Dict puts things in; GetDict takes them back out.
Why you'd reach for it
Pipes and bus nodes are great when you're moving a fixed, known set of things (model, VAE, conditioning). But sometimes you want to shuttle a loose, ad-hoc collection of values around a big workflow - a resolution here, a chosen prompt there, a couple of settings - without wiring each one across the whole canvas. That's what the DICT nodes are for. You stuff values into a dictionary under names you choose, route that one DICT wire around, and use GetDict to fetch any value back by name at the far end. It's a named grab-bag, and it keeps a sprawling graph from turning into a cable nightmare.
GetDict specifically is the safe, general reader: it takes a default so that a missing key doesn't blow up your workflow.
How it works
Given a DICT and a key, it looks the key up. If the key exists, its value flows out the * output. If it doesn't, the default you provided is used instead. That fallback is the whole point of this variant - it's the forgiving reader, versus the pack's stricter get-dict nodes that return type-appropriate defaults automatically or (in the "unsafe" variant) return nothing at all and let downstream nodes break.
The inputs and outputs
- key - the string name to look up.
- DICT - the dictionary to read from (built by the pack's Set Dict node).
- default (optional) - the value to fall back to if the key is missing. Since the output is wildcard-typed, this can be anything.
The output is any (*) - the found value, or the default.
Installing it
ComfyUI Manager → search antrobots ComfyUI Nodepack, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack
Pure plumbing - nothing to download.
Common issues
By far the most common problem is a key mismatch. The keys are plain strings and they must match exactly - "width" is not "Width" and not "width " with a trailing space. If GetDict keeps returning your default, the key almost certainly doesn't match what Set Dict stored it under. Copy the key verbatim rather than retyping it.
Second, know which get-dict you're using. This one falls back to default, so a missing key fails quietly - which is safe but can mask a real wiring mistake (you think you're passing a value, you're actually passing the default forever). If you'd rather have a missing key be loud, that's the stricter/unsafe variants' job. And because the output is * (any type), make sure the value you fetch is actually the type the downstream node expects - a DICT can hold anything, and there's nothing stopping you from wiring a mismatched value into a slot that won't accept it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | — | |
| DICT | DICT | — | |
| defaultopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |