ComfyUI Node

Get Dict Bool

Pull a true/false flag out of a dict

By antrobot1234·Created 3 years ago·Updated about a year ago· 28
Get Dict Bool
  • DICT
  • BOOLEAN
key
defaultfalse

Get Dict Bool reaches into a DICT and pulls out a boolean stored under a given key. It's the retrieval half of antrobot's dict system, specialized for true/false flags. If you've stashed a toggle somewhere upstream - "should this run upscale?", "swap these inputs?", "return the image or just the latent?" - this is how you fetch it back out where the decision actually gets made.

Booleans are the natural thing to route through a dict because they're control signals, and control signals tend to be needed far from where they're set. Carry one flag on the shared DICT wire and you can drive a Swap node, a bypass, or any boolean input deep in the graph without a long dedicated wire. It keeps the "which mode am I in" state in one bag instead of scattered across the canvas.

How it works

This is one of the typed Get Dict nodes, and the README spells out how those differ from the plain Get Dict. Two things: the default is optional (leave it off and the node supplies the standard default for the type - for a bool that's false), and the value is type-validated. If the key exists but the thing stored under it isn't actually a boolean, the node ignores it and returns the default instead. So you always get a real true/false out, never a surprise type.

The inputs and outputs that matter

  • key (required, text) - the name the boolean was stored under. Must match the Set Dict key exactly.
  • DICT (required) - the bag to look in.
  • default (optional, default false) - what you get if the key is missing or holds the wrong type. Set it to the safe fallback for your workflow.

One output: BOOLEAN. Wire it into any boolean input - a Swap's swap flag, a sampler toggle, a bypass condition.

Installing it

Pure Python, no models, no heavy dependencies - installs fast. ComfyUI Manager → Install Custom Nodes → search "antrobots ComfyUI Nodepack" → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack

then restart. It's under antrobots-ComfyUI-nodepack/dicts/get.

Common issues

The type validation is a quiet double-edged sword. If your key is misspelled or the stored value isn't a boolean, you get the default with no error - which is convenient until it silently masks a real mistake. When a flag isn't doing what you expect, verify the key spelling matches the Set Dict node and that you actually stored a bool there, not, say, an int.

Set a deliberate default rather than relying on the automatic false, especially if false is a meaningful "off" in your graph - you want the fallback to be the safe choice, not an accidental one. And the DICT input is required here (unlike the Set nodes where it's optional), so make sure a real dict reaches this node. Small solo pack; genuine bugs go to the GitHub issue tracker the author points you to.

Categoryantrobots-ComfyUI-nodepack/dicts/get

Inputs (3)

NameTypeDefaultDescription
keySTRING
DICTDICT
defaultoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN