is integer
3.0 is an integer, 3.5 isn't — the float reality check
- BOOLEAN
is integer (Basic data handling: FloatIsInteger) asks one question: is this float actually a whole number? One FLOAT in, one BOOLEAN out. 3.0 → True. 3.5 → False. 0.0 → True. That's the whole node - and it's one of those deceptively small things that shows up everywhere once you know it exists.
Mechanically it's Python's float.is_integer(), which checks the value, not the representation. That's the subtle part: a float can have a decimal point and still be an integer value. 3.0 isn't 3 in type terms, but is_integer() still says yes, because the number itself is whole. This is the node that tells you whether a computed value landed on a clean number or drifted off.
Why you'd bother
This is a guard, and guards belong in front of decisions. Wire a computed value into is integer, feed the BOOLEAN into a flow-control node, and you can branch on "did this come out clean?" Use it to validate before a step that requires whole numbers - resizing an image, setting a seed, indexing into a list - or to detect when a computation has produced a fractional result you didn't want.
It also makes a nice debugging tool. If a node is refusing a value you swear is an integer, run it through is integer and you'll find out it's actually 4.999999999 thanks to float precision. That's the classic case: a division or power that should give a whole number but doesn't, because float math is float math. This node catches it in one glance.
Installing it
Part of the Basic data handling pack by StableLlama. ComfyUI Manager → search "Basic data handling" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart. No dependencies, no requirements.txt, no model downloads.
Troubleshooting
The one thing that catches people: huge floats. 1e100 is mathematically an integer (it's 1 followed by 100 zeros), and is_integer() correctly returns True. If that surprises you, you're in good company. And remember the output is a BOOLEAN, not the number - if you want to convert 3.0 into 3, that's a cast node, not this one.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| float_value | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |