Nodes/ControlFlowUtils/πŸ”Ά Simple Toggle
ComfyUI Node

πŸ”Ά Simple Toggle

A boolean switch you can actually flip mid-queue

By VykosXΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 147
πŸ”Ά Simple Toggle
  • run_after
  • out
β—„toggletrueβ–Ί

πŸ”Ά Simple Toggle is exactly what the name says: a checkbox that outputs True or False. That sounds too trivial to be a whole article, but this little box is the difference between a workflow you can operate and a workflow you have to edit. Once you've built one branching graph with this pack's IF selector, you'll want a handful of these sitting on the canvas like light switches.

ComfyUI has plenty of nodes that output booleans - the ones you already know are probably buried inside logic packs or tied to a comparison you don't need. Simple Toggle is the one you grab when you just want a manual on/off signal to hand to a condition, a string operation, or a switch, with zero ceremony.

How it works

It's one BOOLEAN widget - a checkbox, defaulting to True, labeled "Enabled"/"Disabled" - and one output that mirrors it. The detail that actually earns it a place in your workflow is buried in the source: the node declares itself as always changed by returning NaN from its change check. What that means in practice: flip the toggle while a batch is running and the next prompt picks up the new value. ComfyUI won't decide "this didn't change, skip it" and silently feed you the stale boolean. For a control knob, that's exactly the behavior you want.

There's also an optional run_after input, the same dummy * slot the whole pack uses to force execution ordering - connect a slow upstream node to it and this toggle won't emit until that node has finished. Useful when your toggle is meant to gate something that depends on a prior pass completing.

The inputs and output

  • toggle (required, BOOLEAN, default True) - the checkbox. This is the whole input side.
  • run_after (optional) - ordering hook, doesn't carry data.
  • Output: out (BOOLEAN) - your True/False, ready to plug in anywhere a boolean slot lives.

Where it earns its keep

  • Driving conditions. Feed it into the pack's IF Condition Selector to toggle a branch of your workflow on and off without touching any wires. "Refiner pass on or off today? Checkbox."
  • Gatekeeping. Many nodes take a boolean that switches between two behaviors - keep it, drop it, apply it, skip it. A visible checkbox beats remembering which node holds the setting.
  • Flow control. In combination with the Universal Switch and String Operation, a couple of toggles can select whole execution paths. Since the pack is built around the newer execution model where branches run conditionally, having a manual boolean around is more useful here than in a flat linear workflow.

Install and gotchas

No dependencies beyond the pack itself:

cd ComfyUI/custom_nodes
git clone https://github.com/VykosX/ControlFlowUtils

or ComfyUI Manager β†’ search ControlFlowUtils β†’ install β†’ restart.

The only gotcha is a non-gotcha: remember the toggle is a value, not a decision-maker. It doesn't stop a branch by itself - it just hands False to whatever you wired it into, and it's up to that node (an IF selector, a switch, a string op) to act on it. Wire it to nothing and it does nothing, which is fine - but if your goal is "turn this whole branch off," route the toggle into something that actually consumes booleans.

Category🐺 VykosX-ControlFlowUtils

Inputs (2)

NameTypeDefaultDescription
toggleBOOLEANtrueβ€”
run_afteropt*Connect something to this slot if you wish to ensure this node runs after another node of your choice

Outputs (1)

NameTypeDescription
outBOOLEANβ€”