Nodes/comfy-ovum/AssertOvum
ComfyUI Node

AssertOvum

Stop the workflow when a condition is wrong, then fail loudly

By sfinktah·Created about a year ago·Updated 10 months ago· 7
AssertOvum
  • passthru_1
  • true_1
  • false_1

    ComfyUI is astonishingly good at running to completion with garbage. Wrong image size, a zero batch, an empty list, a mismatch between two values you assumed would agree - the graph chugs along and hands you a result that's wrong in a way you only notice later. AssertOvum is the "no, stop" node: it checks that conditions hold and refuses to let the pipeline finish if they don't.

    The mechanism is right there in the design. The node validates pairs of inputs - slots named true_N that must evaluate to True, and false_N that must evaluate to False - then passes everything through. The passthrough is what makes it work as a gate: wire a value through passthru_1 into whatever runs next, and downstream nodes literally cannot execute until the assertion has passed. It's execution-order enforcement with a safety check built in.

    The inputs

    • passthru_1 (*) - any value you want threaded through. This is how you place the assertion on the execution path; the node passes it along so your data flow isn't interrupted.
    • true_1 (BOOLEAN) - an input that should evaluate to True. If it's falsy, the assertion fails.
    • false_1 (BOOLEAN) - an input that should evaluate to False. If it's truthy, the assertion fails.

    You get multiple true_N/false_N pairs, so one node can check several conditions at once. The node has no outputs - it's a guard, not a data transform. Downstream nodes connect to whatever you threaded through passthru_1's consumer side.

    How it actually fails

    When a check fails, the node raises, and ComfyUI marks the run as failed. The point of a loud failure over a silent wrong output is that a failed run tells you where - the error references the node and the offending value, so you debug in seconds instead of staring at a subtly-wrong image for an hour.

    Where this earns its keep

    • Guarding a hires-fix or tiled upscale against unexpected input dimensions.
    • Verifying a batch count before a long, expensive pass (a wrong count is much cheaper to catch at the start).
    • Checking that a model actually loaded, or that an env var you assumed was set is set.
    • Any pipeline where a silent "off by one" is expensive and annoying.

    The tradeoff: assertions are only as good as the checks you write. A true_1 that's always true is decoration, and forgetting to thread a passthrough means the assert may never actually sit on the path it's supposed to guard.

    Installing it

    Part of comfy-ovum:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sfinktah/comfy-ovum
    

    Restart, or ComfyUI Manager → "comfy-ovum". No models, no extra deps.

    Gotchas

    Because the node forces ComfyUI to consider itself "always changed" (the source deliberately returns a NaN change token), it re-runs every execution - that's the point, but it also means it won't sit in a cached no-op state. If your graph is huge, one assert at the choke point beats five scattered asserts for keeping execution time down.

    CategoryLogic

    Inputs (3)

    NameTypeDefaultDescription
    passthru_1opt*Any value to pass through unchanged. Connect this to ensure the node executes at the right point in your workflow.
    true_1optBOOLEAN,*Input that should evaluate to True
    false_1optBOOLEAN,*Input that should evaluate to False

    Outputs (0)

    No outputs