Reroute (Optional)
The wire that survives being unplugged and tells you about it
- value
- *
- present
A reroute node is supposed to be the most boring node in ComfyUI: bend a wire so it doesn't cross the canvas diagonally. This one has a twist - if nothing is plugged into it, it doesn't error and it doesn't silently stop the graph. It reports the fact.
The mechanism
The input is a match-type socket, meaning it takes on whatever type you connect: plug in an IMAGE and it becomes an IMAGE socket, plug in a LATENT and it's a LATENT. It's also optional. In ComfyUI, an optional input you don't wire is simply not passed to the node's function, so the node's parameter falls back to a sentinel - and this node checks for that sentinel specifically. Connected, you get the value through and present = True. Not connected, you get None and present = False, and the node runs happily either way.
That's a small behaviour with a large consequence, because it's the difference between a graph that stops and a graph that tells you why.
Why a plain reroute isn't enough
With a core Reroute, an unplugged input means the node never executes. Not "executes and returns nothing" - never runs. Everything downstream of it never runs either. What you see is a queue that finishes suspiciously fast with no error message and a preview that never appeared, and your only diagnostic is to start hunting the canvas for a disconnected wire. It's one of the most common beginner experiences in ComfyUI and it produces almost no information.
Reroute (Optional) turns the silence into a boolean. Now you can make an actual decision: gate a switch on present, route the connected case one way and the unconnected case another, or just feed present into a text preview so you can see which branch was live. It's the same "optional inputs arrive as nothing, and nodes are expected to read that as a signal" convention the plumbing layer is built on, given a socket.
The second use is the inverse: because an unconnected output is None, this node can deliberately leave a downstream optional input unconnected at runtime. That's the null-output placeholder trick - instead of bypassing a node to mute a branch, you emit nothing into it and let first-non-null logic downstream skip it. Worth knowing you can do that; don't build a whole graph out of it.
Honest limit: it makes the node itself optional-friendly. It does not make a downstream required input optional. Feed its None into something that needs an IMAGE and you'll get a failure at that node instead. This is a probe and a pass-through, not a magic "make it work anyway".
Inputs and output
*(the value) - optional, match-type.- Outputs:
*, the value back orNone, andpresent, a BOOLEAN.
Same idea, different wrapper: Pipe Any (Single) in this pack does the same thing but round-trips the value through the pipe machinery internally. If you're not using pipes, this is the simpler of the two - it doesn't touch the pipe system at all.
Install
Manager: search ComfyUI Utility Suite (publisher tom-m) → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/tom-m-2020/ComfyUI-Utility-Suite
Nothing to download. The pack's single dependency is opencv-python-headless, unused here. Match-type sockets come from ComfyUI's V3 node API and this pack is written against it, so the node needs a reasonably current ComfyUI - on an old build the pack installs and no nodes appear, which reads as a broken install and isn't one.
Troubleshooting
present is always False. The input really is unconnected, or whatever fed it was bypassed - a bypassed node delivers nothing, which is easy to forget when you're muting half a canvas.
The output type won't connect downstream. An unconnected match-type socket has no type to adopt yet. Connect the input first, then wire the output.
Something downstream fails even though this node reports False. Expected. It gave you the signal; the next node still needs a real value. Gate the branch with a switch rather than hoping.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| valueopt | COMFY_MATCHTYPE_V3 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| * | COMFY_MATCHTYPE_V3 | — |
| present | BOOLEAN | — |