Nodes/ComfyUI-Visionatrix/Vix Checkbox Logic
ComfyUI Node

Vix Checkbox Logic

A lazy two-way switch that only computes the branch you chose

By Visionatrix·Created 2 years ago·Updated about a year ago· 3
Vix Checkbox Logic
  • input_off_state
  • input_on_state
  • output_to
statefalse

VixCheckboxLogic is the plain-ComfyUI half of the Visionatrix checkbox-logic pair. It's a switch: one state boolean, two any-type inputs, and it passes one of them through - input_off_state when the box is off, input_on_state when it's on. What makes it worth a second look is that it's lazy: ComfyUI only evaluates the branch that actually runs, so the unselected side's whole upstream chain (models, samplers, entire subgraphs) never executes.

That's the "two modes and paths of workflow execution" the pack README describes. Think a Fast/Quality toggle where Quality wires up a hires-fix pass - with this node, the hires chain doesn't run at all when Fast is selected. That's a real speed and VRAM win that a plain switch node doesn't give you.

It's the sibling of VixUiCheckboxLogic; the difference is this one has no Visionatrix UI metadata, so it lives under Visionatrix/Logic and works in any workflow, Visionatrix or not.

Inputs

  • state (BOOLEAN, default false) - which branch to take. false → off branch, true → on branch.
  • input_off_state (*, any type) - routed to the output when state is off.
  • input_on_state (*) - routed to the output when state is on.

Outputs

output_to (*) - whatever you connected into the active branch, untouched. Because the type is *, one switch can route models, conditioning, text or images without conversion.

How it works

The node declares both inputs as lazy in its schema and implements check_lazy_status, which tells ComfyUI "only send me the input whose branch is active." Then do_it returns whichever input the state selected. The heavy lifting is upstream - ComfyUI walks the graph lazily, so an unselected branch's nodes genuinely don't run.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Visionatrix/ComfyUI-Visionatrix

Restart ComfyUI, or install ComfyUI-Visionatrix via ComfyUI Manager. No model downloads; deps are the stock torch/pillow/numpy.

Gotchas

Two things to keep straight. First, the lazy behavior means you can't count on both branches having run - if you wire the same node's output into both branches, it'll run when either branch is selected, which is fine, but debugging "why didn't X run?" usually means "because it's on the other side of the switch." Second, don't confuse this with VixUiCheckboxLogic when building a Visionatrix flow - that one carries the control metadata Visionatrix needs; this one is for workflow logic that happens to live in the same pack. And note the off-branch is the default: state starts false, so test both positions before you ship, because the default path is the one most users will hit.

CategoryVisionatrix/Logic

Inputs (3)

NameTypeDefaultDescription
stateBOOLEANfalse
input_off_state*
input_on_state*

Outputs (1)

NameTypeDescription
output_to*