ComfyUI Node

InputCheck

A tiny gatekeeper that tells you when a socket is empty

By bandifiu·Created about a month ago·Updated about a month ago· 0
InputCheck
  • any
  • any
  • is_none

Conditional logic in ComfyUI usually needs one piece of information: is this input actually connected, or is it empty? NNInputCheck answers that with a boolean, and - here's the useful part - it passes the original value through at the same time. One node, two outputs, and you can wire branches that react to whether something exists.

What it is

NNInputCheck is a tiny NN/util node from the bandifiu/ComfyUI-NN-custom-nodes pack. The README describes it in one line: "Checks whether an input value is connected or empty." It takes a single optional any input (the * wildcard, so it accepts anything - an image, a latent, a string, a model) and emits two outputs: the value itself, and a boolean saying whether that value is None.

How it works

The mechanism is the engine convention every plumbing node leans on: an optional input that isn't wired arrives as None. The node simply surfaces that fact. Its execute method returns (any, any is None) - the input untouched, plus a BOOLEAN flag that's True when the input is empty/missing and False when it's connected. That's the entire logic, and it's transparent by design.

The reason that matters is what you can do with the boolean. Wire it into a switch's selector, a gate, or a branch condition, and your graph can react: if this input is empty, use the fallback path; if it's present, use the real one. That's the first-non-null fallback pattern from the KB's node-plumbing doc, except you get the "is it empty?" decision as an explicit, visible signal instead of it being buried inside a switch node.

The inputs and outputs

  • any - optional, any type. Leave it unwired and is_none comes out True.
  • any output - the original value, passed through untouched (useful when you're branching and still need the data downstream).
  • is_none output - a BOOLEAN: True when the input is empty, False when connected.

Two outputs, one of which is the passthrough you didn't have to buy a reroute for.

When to reach for it

Conditional workflows, mostly. The classic setup: an optional reference or override input feeding a node, and you want a switch to pick between "user supplied a value" and "use the default." Chain NNInputCheckNNAnyBoolSwitchTyped (same pack) and you get exactly that: the check tells the switch which branch is live, and the switch's lazy evaluation means only the live branch actually runs. It's also a decent debugging aid - drop it on a socket you're not sure about and read the boolean to confirm whether something is actually reaching that point of the graph.

Where it's not the tool: checking what the value is (empty string vs. a real string, zero vs. a number) - that's value-level logic, and this node only distinguishes connected/None. And it doesn't replace a true fallback switch; it's the probe that makes one work.

Installing

Part of bandifiu/ComfyUI-NN-custom-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/bandifiu/ComfyUI-NN-custom-nodes

Restart ComfyUI (or Manager → "NN-custom-nodes"). Deps: torch, numpy, pillow - no models. GPL-3.0, newer V3 backend API.

The one mental note: the output is "is None," not "is connected," and those are the same thing in ComfyUI's optional-input convention but feel inverted the first time you read it. If your brain wants "is this there?", flip the boolean before using it - or wire it into the switch the way the pack's own docs imply and let select be your "use the supplied value" flag.

CategoryNN/util

Inputs (1)

NameTypeDefaultDescription
anyopt*

Outputs (2)

NameTypeDescription
any*
is_noneBOOLEAN