🗂️Dict → bool
The on/off switch living inside your dict
- dict
- value
Booleans are the workhorses of workflow control. Face detailer on or off, VAE decode from the first pass or the second, hires fix applied or skipped - a lot of your graph is really a bunch of true/false decisions wired through switch and gating nodes. DictExtractBool ("🗂️Dict → bool") is how those flags travel inside a dictionary instead of as a tangle of separate wires.
The pattern is the same as the rest of the pack: build a dict up top with DictAddBool (key detailer, value true), pass the dict down the bus, and at each decision point a DictExtractBool pulls the flag back out with the type guaranteed. Your "settings" live in one place - a row of Add nodes at the top of the graph that reads like a config file - rather than being buried in whichever switch node you edited last.
What you set
- dict (required) - the dictionary to read from (must be non-empty).
- key - the flag's slot name.
- cleanup_key (on by default) - normalizes spaces and newlines so the key matches loosely.
Output: value as a boolean, typed and ready to feed a switch, an if/else, a gating node, or a KSampler toggle.
The typed-check gotcha that saves you later
This node validates on extraction: the stored value has to actually be a boolean, and if you stored a string "true" or an integer 1 under that key, it errors with something like "Value isn't a <bool> instance". Annoying in the moment, genuinely good in the long run - it catches the classic mistake of writing true as text into a config dict and then wondering why your switch does nothing. Use DictAddBool to write the flag and the types will always line up.
When it's worth it
If your workflow has two booleans, a straight wire is fine. When you're running multi-stage pipelines with a settings dict that controls five different branches - which stage to keep, which pass to skip, whether to run the detailer - gathering all the flags into one dict and extracting them at the decision points turns the graph's behavior into something you can read at a glance. That's the payoff, and it's the same payoff every node in this pack is chasing: fewer wires, one place to look.
Install
Standard for the pack - small, one lightweight dependency (frozendict), no models to download. ComfyUI Manager: search "Dict Tools". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart ComfyUI. It needs 0.18.0+ (newer extension API) - if the nodes don't appear after install, update ComfyUI first. Missing keys raise "No such key in Dict" rather than defaulting, which is the pack's way of making config typos loud instead of silent.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| dict | DICT | A Dictionary to work with. | |
| key | STRING | Key (name) of the item extracted from the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | BOOLEAN | The actual bool-type item extracted from the Dict. |