force execution order
Two nodes are racing and you're losing. Force a finish line.
- E/O
- any node output
- E/O
- passthrough
ComfyUI figures out what to run in what order from the wires. That works great until two branches of your graph have no real dependency on each other - and then the execution order is effectively a coin flip, and one branch finishes before the other at the worst possible moment. The classic version of this: a multi-stage dataset pipeline where the LoRA training node kicks off before the images have been moved and captioned, because nothing in the graph told ComfyUI those two things are related. People ask about this constantly ("how do I specify which nodes process first?") and the answer is usually a fake dependency - exactly what force execution order exists to build.
It's from Basic data handling, StableLlama's zero-dependency utility pack. The author himself recommends this node in support threads for forcing a pre-check to run early by "syncing it with the model loading," which is a great concrete use: hang a cheap validation step on the slow model-load so it's guaranteed done before the run proceeds.
How it works
ComfyUI executes nodes in dependency order: a node runs only after everything feeding it has finished. force execution order gives you a way to invent a dependency where none exists. You chain several of these nodes together via their special E/O socket in the order you want, and into each one you plug an output from the nodes you need to sequence. Now the chain - and everything hanging off it - has a real wire dependency, so ComfyUI has to run them in that order. The node itself returns None for the chain and passes your value through untouched: it's "lightweight and does not affect the workflow," per the author. All it adds is ordering.
The inputs and outputs that matter
E/O(input and output, a dedicated chain type) - wire the previous ExecutionOrder node'sE/Ooutput into this to extend the chain. This is the socket that actually carries ordering.any node output(input, ANY) - plug in any output from the nodes you want to force into position. Whatever you plug in comes back out unchanged onpassthrough, so you can also use this node as a reroute while you're at it.passthrough(output, ANY) - the value you fed intoany node output, delivered after the ordering constraint is satisfied.
Installing it
Install Basic data handling via ComfyUI Manager (search the pack title), or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart ComfyUI. No dependencies, no models - one of the safest installs you'll do.
Troubleshooting
- "The order is still wrong." The chain only orders what's actually wired into it. If a node you expected to be sequenced isn't connected to any
any node outputin the chain, it's free to run whenever. Also remember: ordering propagates backward through dependencies, not forward - you're anchoring things so they must finish before the next link runs. - You're using it to make things run faster. Wrong tool. This forces sequencing; it can only add constraints, never remove them. If a branch is slow and you wanted it to overlap, this is the opposite of what you need.
- Don't chain it just because two nodes are out of order on screen. Canvas position has nothing to do with execution order. Only wire-dependencies matter.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| E/Oopt | E/O | — | |
| any node outputopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| E/O | E/O | — |
| passthrough | * | — |