FloatUnaryCondition
Turn one float into a true/false gate
- BOOLEAN
This one doesn't do math so much as it makes a decision. You hand it a single float, pick a check from a dropdown, and it hands back true or false. No sampling, no image, no LoRA - it's plumbing. The kind of node you only go looking for once you're building a graph with actual logic in it: skip this branch if strength is zero, only run the upscale if the input came back positive, gate a whole chunk of the workflow on whether some upstream value blew up to infinity.
FloatUnaryCondition is part of ComfyMath, a small utility pack by evanspearman that adds boolean logic, int/float arithmetic, and vector math to ComfyUI. It doesn't touch models or generate anything - it's the stuff that's normally missing when you try to build "if this, then that" behavior into a graph, which core ComfyUI mostly doesn't give you a clean way to do.
How it works
You pick an op from eleven choices - IsZero, IsPositive, IsNegative, IsNonZero, IsPositiveInfinity, IsNegativeInfinity, IsNaN, IsFinite, IsInfinite, IsEven, and IsOdd - and feed it a, your float (default 0, adjustable in steps of 0.001). The node runs that single check against a and outputs a boolean. That's the whole mechanism: one input, one test, one answer. IsEven/IsOdd are a little unusual for a float - they only make clean sense if the value happens to be a whole number - but they're there if you need them, say for a value that's supposed to be an integer-valued float coming out of some earlier math.
The NaN and infinity checks are the ones worth remembering exist. If a divide-by-zero or a bad log operation happens upstream, the result doesn't crash your graph - it silently becomes NaN or infinity and keeps flowing downstream until something breaks in a confusing way three nodes later. Wiring an IsNaN or IsFinite check right after a suspect calculation catches that at the source instead of debugging it blind.
Inputs and outputs
op- which condition to test (the eleven listed above).a(FLOAT) - the value being tested.- Output: BOOLEAN - worth noting specifically, because this is ComfyUI's own native boolean type, not ComfyMath's own custom
BOOLtype that most of the pack's other condition nodes output. That means this one plugs straight into any switch, gate, or "If" node elsewhere in ComfyUI that expects a real boolean socket, no conversion node required.
How to install it
Easiest path: open ComfyUI Manager, search for ComfyMath, install, restart. By hand, it's just:
cd ComfyUI/custom_nodes
git clone https://github.com/evanspearman/ComfyMath.git
then restart ComfyUI. There's no requirements.txt to fight and nothing to download - it's plain Python doing arithmetic, so there's no CUDA build step and no model weights involved.
Common issues & troubleshooting
"Missing node type" on workflow load. Someone shared a graph that uses ComfyMath and you don't have the pack - install it via Manager as above and reload.
It won't connect to a switch/If node you found elsewhere. Custom node authors don't all agree on boolean type names, and ComfyMath itself is inconsistent internally - most of its own condition nodes output BOOL, a type it defines itself, while this node and IntToBool output ComfyUI's native BOOLEAN. If a wire refuses to connect, check which flavor the two ends actually expect before assuming something's broken.
The pack looks stale. ComfyMath hasn't seen much active development in a while - a 2024 community thread noted the author had moved on from the project. In practice that's not a big deal here: it's self-contained math with zero external dependencies, so there's little for a ComfyUI update to actually break. Treat it as a small, finished utility rather than something you should expect new features from.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| op | COMBO | 11 options: IsZero, IsPositive, IsNegative, IsNonZero, IsPositiveInfinity, IsNegativeInfinity, +5 | |
| a | FLOAT | 0.000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |