Nodes/comfyui-svdint4/Is Input Present
ComfyUI Node

Is Input Present

The honest 'is anything actually connected here' check

By wjie98·Created 2 months ago·Updated 3 days ago· 2
Is Input Present
  • value
  • fallback
  • present
  • value

Here's the ComfyUI gotcha this node exists to fix. An optional input you leave unwired arrives as None - that part everyone knows. But "not None" isn't the same as "there's something here." A connected-but-empty string, an empty list, or a zero-element tensor all pass a naive is not None check while being completely useless downstream. And the flip side is sneakier: Python truthiness calls the scalar 0 and False "empty," but a seed of 0 or a false flag is a real value you deliberately connected. This node gives you a definition of "present" that actually matches what you mean: connected, non-empty, and scalar-0-counts-as-present.

Two outputs:

  • present (BOOLEAN) - true when the value input is connected and non-empty, false when it's missing, None, an empty string/container, or a zero-element tensor.
  • value - forwards the primary input when present. When it isn't, it forwards the fallback input instead - and here's the nice part, the fallback is lazy. Its upstream branch isn't evaluated unless the primary value is actually absent, so you can wire an expensive fallback and it only runs when needed. That's the same lazy mechanism the pack's Lazy If / Else uses, exposed in a "do I even have this?" shape.

Why you'd actually reach for it

The classic use is optional conditioning. Say you're building one graph that feeds H3 or a video model both first-frame and last-frame conditioning, but you want a run with only a first frame to work. Wire the optional image through this node, drive your gating with present, and the empty case degrades gracefully instead of producing a black placeholder frame. It pairs naturally with the pack's Resize Image If Present, which has the same "if nothing's connected, return nothing" philosophy.

It's also just a nicer check than converting everything to a primitive and comparing - especially when the thing you're checking is a tensor, where "is this empty" is genuinely annoying to express by hand.

Install and usage

This is a pure-logic node, so the easy install is the whole story:

cd ComfyUI/custom_nodes
git clone https://github.com/wjie98/comfyui-svdint4

or ComfyUI Manager → search "Turing Utils", restart. No CUDA kernel, no model files, no compile step. That's rare in this pack - most of the other nodes want the bundled kernel built, but the logic category doesn't.

There are only two inputs and both are optional, so there's nothing to misconfigure. The one thing worth internalizing: present is not Python truthiness. 0 and false count as present, on purpose, because they're connected values. Empty things don't. If you remember that one sentence, you'll never be surprised by this node again.

CategoryTuring Utils/logic

Inputs (2)

NameTypeDefaultDescription
valueopt*Connect any value. An unconnected input, None, an empty string/container, or a zero-element tensor returns false.
fallbackopt*Returned only when value is absent or empty. Its upstream branch is evaluated lazily.

Outputs (2)

NameTypeDescription
presentBOOLEAN
value*