Is Input Present
The honest 'is anything actually connected here' check
- 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) -truewhen thevalueinput is connected and non-empty,falsewhen 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 thefallbackinput instead - and here's the nice part, thefallbackis 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'sLazy If / Elseuses, 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 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)
| Name | Type | Description |
|---|---|---|
| present | BOOLEAN | — |
| value | * | — |