PVL Check If Connected
One wildcard input, a passthrough and a has_value flag
- value
- value
- has_value
Branching in ComfyUI gets awkward the moment a value might not exist. You've got an optional reference image, or a text field that might be empty, and you want different behavior depending on whether it's actually there. PVL Check If Connected is the pack's answer: one wildcard input, and two outputs - the same value passed straight through, plus a has_value boolean that tells you whether the input was connected and non-empty. Local, no API, no key, part of the pvlprk/comfyui-pvl-api-nodes grab bag.
The name undersells it a little. It's not just "is a wire attached" - it's "is there real content," which is what you usually actually mean. An empty string counts as not having a value; False and 0 count as having one. That distinction saves you from a whole class of "the node ran with nothing" bugs.
How it works
The optional value socket is typed * (wildcard), so ComfyUI lets you connect nearly anything. Internally the node uses a small permissive type system so the wildcard binds to whatever type is wired in. Its _has_value check is where the nuance lives: strings must have non-whitespace content, lists/dicts must be non-empty, tensors must have >0 elements, booleans and numbers always count (even False and 0), and latent dicts are checked via their samples tensor. The value output echoes the input unchanged (or None if nothing was connected), and has_value carries the verdict.
Inputs and outputs
value(optional, wildcard).- Outputs:
value(wildcard passthrough) andhas_value(BOOLEAN).
A typical pattern: wire has_value into a PVL_BooleanLogic gate or a switch to choose between "use the connected reference" and "run the fallback branch."
Install
cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
Restart ComfyUI. No key, no network, no heavy dependencies.
Where people get burned
- "Connected but empty" reads as not-having-a-value. If you genuinely need to distinguish "wire present, empty string" from "no wire at all," this node can't - that's the one nuance it collapses.
- The wildcard passthrough means the node can't always prove a type downstream. If the next node demands an exact type, you may need a typed node in between.
- Don't expect it to evaluate the value's quality. It checks emptiness, not whether the number is sane or the image is usable - that's your job further down the graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| valueopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| value | * | — |
| has_value | BOOLEAN | — |