Nodes/🐰 MaraScott Nodes/🐰 Is Empty Or None ? - v1 /c
ComfyUI Node

🐰 Is Empty Or None ? - v1 /c

The 'did anything actually arrive?' check β€” empty-or-none in one node

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Is Empty Or None ? - v1 /c
  • any
  • boolean

When a workflow goes wrong, it's usually because something arrived as None when you expected data, or as an empty string when you expected a prompt. Is Empty Or None ? is a tiny guard node that collapses both checks into one: feed it any type, and it tells you, as a BOOLEAN, whether the value is empty, None, or neither.

It's the defensive-programming node of the pack. You reach for it when you want a workflow to branch on "did the optional input actually get fed?" - say, an optional text that, if missing, should route to a fallback prompt, or an optional model that should skip a whole processing block.

How it works

Under the hood it's literally two of the pack's other checks composed: it runs Is Empty ? (returns true when the value equals "") and Is None ? (returns true when the value is None), and ORs them together. So its answer is True for an empty string, for None, and also for anything whose value is falsy in the way those two checks catch - but note the precise semantics: it's "empty string OR None", not "falsy". An integer 0 or a False boolean is not caught by this node. If that surprises you, it's the difference between these exact checks and Python's general truthiness.

Inputs: a single any (* type - anything can go in). Output: boolean (BOOLEAN).

Using it

Wire the boolean into a Switch-style node or a For Loop ToBoolNode-style condition and branch. Common pattern: feed it an optional STRING input that a workflow may or may not populate; if boolean is true, take a default path instead of crashing on a None that downstream nodes won't touch. It also pairs nicely with the pack's DisplayInfo node for debugging - put "did my thing arrive?" on screen without squinting at the console.

Installing it

Ships in the MaraScott pack: ComfyUI Manager β†’ search "MaraScott" β†’ Install β†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes

Then restart. As with every node in this pack, the install is heavier than the node: the pack pins transformers==4.37.2 and installs opencv-python, numba, blend_modes and LLM libs, so you're paying the pack's tax for a two-line check.

Common issues

The main trap is the "empty but not None" distinction. If you're checking an image tensor or a list, an empty tensor or empty list is neither "" nor None, so this returns False even though the data is "empty" in a practical sense - for those, check length or use a dedicated emptiness check for the type you're testing. And remember 0/False aren't "empty" by this node's rules. It's a fine guard, but know exactly what it guards.

Category🐰 MaraScott/Utils

Inputs (1)

NameTypeDefaultDescription
any*β€”

Outputs (1)

NameTypeDescription
booleanBOOLEANβ€”