ComfyUI Node

Set Dict Bool

Carry a true/false flag in a ComfyUI dict

By antrobot1234·Created 3 years ago·Updated about a year ago· 28
Set Dict Bool
  • DICT
  • DICT
key
BOOLEANfalse

Sometimes the thing you want to carry across a workflow isn't a number or an image, it's a switch: refine or don't, upscale or don't, use the mask or skip it. Set Dict Bool tucks a single true/false flag into a DICT bundle so that decision can ride across the graph on one wire and get read back later by name. It's the boolean member of the antrobots dict family.

The family exists to fight spaghetti. Instead of running a separate wire for every value your workflow passes around, you pack them into one keyed container and route that - the same graph-legibility move rgthree's Context nodes make, except here it's an open bag where you name the slots yourself. Set Dict Bool is the version with the value locked to a checkbox.

Where a bundled bool earns its keep

Booleans are how you drive branching. This same pack ships a Swap node that flips two pipes based on a boolean, and plenty of setups gate a refiner pass or an optional step on a flag. Stashing that flag in your dict bundle means the toggle travels alongside the rest of your config, so you set your workflow's behavior in one place and read it wherever the branch actually happens.

Why not plain Set Dict

Base Set Dict takes any type, a boolean included. The typed variant just gives you an actual checkbox on the node - flip it inline, no wiring needed - and it pairs with a bool-typed Get Dict that verifies the value really is true/false and hands back a default (rather than something garbled) if it isn't.

How it works

A dict here is a Python dictionary on a custom DICT wire. Give the node a key and a BOOLEAN and it starts a fresh one-key bundle. Give it a key, a BOOLEAN, and an existing DICT, and it appends to that bundle and passes the whole thing along. Chain them - each output into the next DICT input - to build the bundle up.

The inputs and outputs that matter

  • key (string) - the name you'll read the flag by later, matched exactly by Get Dict.
  • BOOLEAN - the flag itself, default false. A checkbox on the node.
  • DICT (optional) - an existing bundle to append to; empty starts a new one.

Output is a single DICT headed for the next Set Dict or a Get Dict.

Installing it

Install the whole pack. In ComfyUI Manager: Install Custom Nodes, search antrobots ComfyUI Nodepack, install, restart. Or manually:

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

then restart ComfyUI. It's pure Python - no models, no heavyweight dependencies - so the install won't fight you.

Common issues

The one that bites hardest with booleans is the silent default. The default here is false, and Get Dict also falls back to a default when a key doesn't match. So if you misspell the key on either end, your branch quietly reads false and takes the "off" path - no error, just a workflow that behaves as if the switch were never flipped. When a toggle "isn't doing anything," check that the set key and the get key are spelled identically before you check anything else.

Two more from the family: the DICT type is antrobots-only, so it only comes back out through a Get Dict, never into a stock node; and this is a small, quiet, one-person pack with basically no community threads to dig through, so if you find a genuine bug the README's request to file a GitHub issue is the practical route.

Categoryantrobots-ComfyUI-nodepack/dicts/set

Inputs (3)

NameTypeDefaultDescription
keySTRING
BOOLEANBOOLEANfalse
DICToptDICT

Outputs (1)

NameTypeDescription
DICTDICT