ComfyUI Node

Check Null

Ask 'did that node actually return something?'

By denyazzolin·Created 3 months ago·Updated 9 days ago· 3
Check Null
  • value
  • is_null

The most maddening thing in ComfyUI is a node that quietly returns nothing. An optional input you left unwired, a loader that came up empty, a video with no audio track - and your whole downstream chain either errors with a cryptic message or, worse, silently produces garbage. Check Null from comfyui-daz-tools is a tiny diagnostic that turns "is this thing actually there?" into a boolean you can branch on.

How it works

It takes one input - value, typed as * (any type) - and returns a single boolean, is_null. It's True when the value is:

  • Python None (an unwired or unpopulated output),
  • NaN (a float that's not equal to itself, which is exactly how NaN behaves),
  • or an empty string, or the strings "none" / "null" case-insensitively.

Everything else - a real number, an image tensor, a model, a filled string - comes back False. That's the whole mechanism: a few lines of Python. The clever bit is the input being *-typed, so you can plug any output in, even one whose type you're not sure about.

What you do with the boolean

Wire is_null into a switch or a conditional-routing node and you've got error handling without a single script. The realistic patterns:

  • Guard optional inputs. If a reference-image input is optional and left empty, CheckNull catches it and routes to a fallback path instead of letting a downstream node choke.
  • Empty text handling. Prompt builders that sometimes produce a blank string - check for null and skip the CLIP encode rather than encoding whitespace.
  • Branches on missing data. Combined with a Switch-style node it becomes "if this loader returned nothing, use this other source."

It's one of those utility nodes that's boring until the moment it saves a run. People reach for anything-anywhere routers and expression nodes for this job, but a dedicated null check is more legible - you can see the guard condition right there in the graph instead of buried in a math expression.

Installing it

Shared pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/denyazzolin/comfyui-daz-tools

Restart ComfyUI, or grab it from ComfyUI Manager under comfyui-daz-tools. No extra dependencies.

Gotchas

One thing to keep straight: the * input will happily accept anything, so a False result means "the value is present" - not "the value is correct." A node can return a real tensor that's garbage; CheckNull only tells you the wire wasn't empty. Also note the empty-string case: " " (whitespace with a space) is not caught - the check strips and lowercases, so a genuinely blank string is caught, but a string of spaces survives. If your pipeline produces those, trim first.

Categoryutils

Inputs (1)

NameTypeDefaultDescription
valueopt*

Outputs (1)

NameTypeDescription
is_nullBOOLEAN