Nodes/comfyui-sg-nodes/Wait For Passthrough
ComfyUI Node

Wait For Passthrough

Run This After That — Without Wiring the Value

By sebagallo·Created 9 months ago·Updated 6 months ago· 0
Wait For Passthrough
  • passthrough
  • wait_for
  • PASSTHROUGH

ComfyUI only runs a node when something needs its output. So how do you make "this thing" run after "that thing" when you don't actually want to pass any data between them? Wait For Passthrough is the answer: it sits there waiting for one input to be ready, and only then hands through a second input that you didn't want to touch the timing of.

The shape is simple:

  • wait_for - any type, the required input that triggers execution. When this becomes available, the node runs.
  • passthrough - any type, lazy. It's only fetched once wait_for has arrived.
  • PASSTHROUGH - the output, the value from passthrough.

The lazy part is the clever bit, and it's worth actually understanding. A lazy input means the node tells ComfyUI "don't bother computing this until I ask for it." Wait For Passthrough asks for passthrough only after wait_for is non-None. So the effective guarantee is: by the time PASSTHROUGH flows, wait_for has already been produced - which is exactly an execution-order constraint with almost no data moving through it.

When you'd use it

The classic case is a node whose timing depends on something that produced a side effect rather than a value. Example: Select File From Directory (same pack) reads whatever file is currently in a folder - if you've got a process writing that file, you want the file read to happen after the write. Or you want an HTTP call in Call Remote URL to fire only once some earlier generation finished, without shoving the latent through a network node. Wire the "trigger" (the thing whose completion you care about) into wait_for, and the thing you actually want sequenced into passthrough. Both run, in order, and you never had to contort a data dependency into existence.

A couple of things to keep straight. First, wait_for triggers on "is not None," not on "has meaningfully changed" - so it gates on availability, not on updates. Second, because passthrough is lazy, if nothing downstream asks for the PASSTHROUGH output, the passthrough branch never runs; make sure something consumes it, or your "after" guarantee evaporates. And if wait_for is itself unwired... there's nothing to wait for, so the node has no reason to fire.

Install

Part of comfyui-sg-nodes by sebagallo. ComfyUI Manager → search comfyui-sg-nodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/sebagallo/comfyui-sg-nodes

Restart ComfyUI; it's under SGNodes/Utilities. No model downloads, no extra dependencies.

CategorySGNodes/Utilities

Inputs (2)

NameTypeDefaultDescription
passthroughCOMFY_MATCHTYPE_V3Any type, lazy input that will be returned
wait_for*Any type, required input that triggers execution

Outputs (1)

NameTypeDescription
PASSTHROUGHCOMFY_MATCHTYPE_V3