basicIn_OptionalPass
The node that lets a wire be optional
- any_input
- any_output
Every ComfyUI graph has a spot where you'd like to say "this branch might be here, might not." A LoRA you use half the time. A second reference image. A ControlNet you bolt on for certain shots. basicIn_OptionalPass is the smallest possible answer to that: one optional input called any_input, one output called any_output, both typed as the wildcard *, and a pass-through that returns whatever it got.
The pack's own description is the honest spec, translated: unconnected, it outputs empty; connected, it lazily loads and passes the input through unchanged - and downstream nodes need to support empty values. That last clause is the whole story.
Why it exists
Because ComfyUI's engine has no "maybe" state for a wire. An input socket is either connected or it isn't, and an unconnected optional input simply isn't passed to the node's function, so the node sees None. That's the convention the entire utility layer is built on. What this node gives you is a place to put that uncertainty so the rest of the graph can be written as though the branch always exists.
The lazy part is the useful bit. The input is declared lazy and implements check_lazy_status, which means the upstream branch is only asked for its value if the input is still None. A branch that's wired but not yet needed doesn't get evaluated. Combined with the wildcard type - the node also declares VALIDATE_INPUTS returning True so the backend skips type-checking a socket it can't reason about - you get a node that accepts anything, asks for nothing it doesn't need, and hands it along untouched.
Where it earns its keep
Three patterns, all plumbing:
A conditional input on a shared workflow. Put the optional pass between a LoRA loader and the sampler. With nothing plugged in at the far end, the loader never runs and the sampler gets None. Plug something in and it flows.
A junction you'll fill in later. It holds a socket open at the top of a graph without breaking anything, so you can wire the downstream half before the upstream half exists. That's more useful than it sounds when you're building a workflow from the middle out.
A labeled placeholder for "extra reference." The pack's AD workflows lean on optional media slots heavily, and this node is the honest way to represent one that the model may or may not receive.
Installing it
ComfyUI Manager → ComfyUI-Apt_Preset, or:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r ComfyUI-Apt_Preset/requirements.txt
Restart and look under Apt_Preset → IO_Port.
The traps, and there are two real ones
The first is that None propagates. If you wire this into a node that doesn't handle empty values, you don't get a warning at the socket - you get a crash inside the consumer, or worse, a node that quietly contributes nothing to the batch. When you add one of these, run the graph once without the optional branch connected. If it survives that, it's wired correctly.
The second is that * erases type checking. The canvas won't stop you connecting a MODEL where a string was expected, and the error will surface three nodes later in a message that names the wrong culprit. The community has been fairly consistent about this trade-off - the long-running argument against blanket any-type convenience nodes is precisely that they make a broken graph look like a working one - so treat this node as a scalpel, not an adapter. If a socket has one legitimate type, use the pack's typed ports (basicIn_int, basicIn_string, and friends) instead.
Used narrowly, it's exactly the right tool. Used as the universal joint for your workflow, it's the node you'll be swearing at at 2 a.m.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| any_inputopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any_output | * | — |