⛧Raise Exception Message
The assert node your loops were missing
- any
- any
Every automated ComfyUI pipeline eventually needs a way to say "this is wrong, stop." Not preview wrong, not output-wrong - stop the queue wrong. Raise Exception Message is that node. Flip its trigger and it throws an exception with whatever message you wrote, which kills the current run and shows you a red error. Leave it alone and it passes its input straight through as if it weren't there.
That pass-through is what makes it a graph citizen rather than a dead end. The node takes a wildcard any input - model, latent, image, string, whatever - and returns the same object by reference when not triggered. You can drop it inline in a chain purely as a checkpoint, and it costs you nothing until it fires.
The three inputs
- any - any data type, passed through untouched when the trigger is off. This is also your way to provide the condition: wire in whatever you're checking (a count, an image, a boolean) so the node sits in the data path rather than floating beside it.
- trigger - the actual switch.
falseby default; when you flip it on (or wire a boolean into it), the node raises. The clever move is converting that widget to an input and driving it from a comparison node upstream. - message - the text of the exception, defaulting to
"Exception triggered!"and multiline. Whatever you write gets prefixed with[RaiseExceptionMessage]in the error.
The output is any again - the pass-through - so in a typical setup the node both inspects and forwards the data in one hop.
How to think about it
In this pack's Wan loop workflows, this is the "assert" - the same idea as a raise in a script. Classic pattern: Load Images Conditional gives you a count; a compare node checks it against the expected frame count; if they don't match, the compare sets trigger to true and the run aborts with "Expected 81 frames, got 74." You fail fast instead of silently continuing with a broken batch and discovering it three nodes later.
One behavior worth knowing: ComfyUI's type system treats * sockets as "connect anything, and the node is responsible for making sense of it." Since this node's only job with the data is handing it back, that's a safe use of the wildcard - but it also means you get no type checking, so if you're relying on the pass-through, sanity-check the types yourself.
Install
It's one of a handful of nodes in ComfyUI-HeresyNodes, heresyCoder's small personal pack:
cd ComfyUI/custom_nodes
git clone https://github.com/heresyCoder/ComfyUI-HeresyNodes
Restart ComfyUI afterward, or install through Manager by searching "ComfyUI-HeresyNodes". No models, no extra dependencies - this one is pure graph logic.
The honest take
This is a two-state utility: off means nothing, on means "throw and die." There's no partial credit, no custom exception handling downstream - once it raises, the queue stops and you're reading an error in the console. If that's what you want (and for long unattended video renders, it usually is), it beats the alternative of discovering a bad batch after it's already been saved. Some people prefer a soft signal like a boolean or a Show Text, and honestly that's fine for short runs. But for an overnight batch, you want the run to stop when something's off, and this is the smallest way to get there.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any | * | — | |
| trigger | BOOLEAN | false | — |
| message | STRING | Exception triggered! | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |