Mpi Any Blocker
Kill a ComfyUI branch the second it comes up empty
- any
- any
The most common way a ComfyUI workflow dies is not a crash with a scary traceback - it's a node downstream quietly refusing to do its job because whatever it got handed was empty. Mpi Any Blocker exists to make that failure loud and early instead of silent and confusing. Drop it on a wire, and if the value crossing it is empty, the whole branch behind it just stops running.
It's a pass-through with a tripwire. The input any accepts literally anything - the * wildcard socket means model, latent, string, image, whatever - and the any output echoes it back unchanged. The magic is what happens in between: the node checks the value with the pack's is_empty_value helper, and if it's empty it returns an ExecutionBlocker instead of the value. ComfyUI treats that as "this branch produced nothing," so everything downstream of the node is skipped for that run. No error dialog, no half-processed latent - the branch just doesn't execute.
What counts as empty is worth knowing, because it's not Python's idea of falsy. Empty here means None, an empty string, an empty list, tuple, or dict, a tensor with zero elements (like an image batch with no frames), or an audio object with an empty waveform. The deliberate gotcha that trips people up: 0, 0.0, and False are NOT empty and pass straight through. The source has a comment that sums it up - "falsiness would wrongly treat 0/0.0/False as empty." If you wire a boolean False in here expecting the branch to block, it won't, because False is a perfectly valid value. If you want to gate on a boolean, use Mpi Blocker (its boolean widget is a manual continue/block switch) rather than this.
Where this earns its keep: you've got a branch that only exists when some upstream condition is met. A prompt list comes back empty, a text search found nothing, an image loader got handed a blank path and produced a zero-batch tensor. Without the blocker, downstream nodes run on garbage and you spend twenty minutes tracing which one choked. With it, the branch simply never runs. It's the plumbing-layer idiom of "let the empty case be silent" - the same family of control-flow nodes covered in the KB's node-plumbing doc, and the reason you can build workflows that are half-optional.
One honest limitation: Mpi Any Blocker only stops the branch after it. Everything feeding the node still runs, because the input isn't lazy. If you want to skip the expensive upstream work too, that's what Mpi Blocker's lazy input is for - with its gate off, nothing behind it executes at all. Blockers like this one are for stopping the cheap-but-wrong downstream work.
Installing is the same story for every node in this pack. Easiest: ComfyUI Manager → search ComfyUi-MpiNodes → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart ComfyUI. The pack has no requirements.txt and no model downloads - the logic nodes are pure Python on top of torch, so there's nothing extra to fetch. If you're seeing "Mpi Any Blocker" under the MpiNodes/Logic menu, you're in the right place. And if you also see a node literally named MpiBlockIfEmpty in old workflows, that's this same node - it's a kept alias so pre-rename saves keep loading.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| any | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |