Float to Int
Float to Int — the conversion nobody thinks about until a node yells at you
- int_value
ComfyUI is annoyingly picky about types. A KSampler wants steps as an INT. A batch size wants an INT. Your upscale node just handed you a FLOAT from some division, and now the field you're wiring it into is turning red and refusing the connection. This node is the two-second fix: one FLOAT in, one INT out.
It's from the Utilitools pack, and it's about as stripped-down as a node gets - a single required input value (FLOAT, default 0) and a single output int_value (INT). Wire any float in, get an integer out, done.
The mechanism, and the subtlety
The conversion is just Python's int(), which truncates toward zero - it does not round. 3.7 becomes 3, 2.1 becomes 2, and -3.7 becomes -3. That's the gotcha most people hit eventually. If you're computing a resolution or a step count and you get 2.9, this node will quietly hand you 2, not 3. For most generation math that truncation is fine or even desirable - you usually want the floor when you're sizing things down. But if you specifically need rounding, throw the float into a Calculator node (int((x + 0.5)) style expression) instead, or handle it upstream.
The other thing worth knowing: there's no guard for extreme values. A NaN or infinity will flow through and produce whatever Python produces. In practice you'll never feed those in, so don't lose sleep over it.
Why use it over other options
ComfyUI's math nodes already emit both INT and FLOAT outputs in a lot of cases, so you can sometimes skip the converter entirely. The case this node earns its keep: you have a FLOAT from a sampler's cfg, a LoRA's strength, or a scaling factor, and you need it as an INT in a spot that won't accept floats. Dedicated converters like this also keep your graph readable - one box that visibly says "this is now an integer" beats a hidden type change buried inside a math node. It pairs naturally with the pack's Int to Float and Whatever To String for a complete conversion trio.
Installing it
Same as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/aesethtics/ComfyUI-Utilitools
or search "Utilitools" in ComfyUI Manager, then restart ComfyUI. It lives under Utilitools → Conversion. There's no requirements.txt and nothing to download - pure Python, no dependencies beyond what ComfyUI already ships. It's not the kind of node that gets discussed much anywhere, but it's also not the kind that needs discussing. It converts a float to an int and never once crashes doing it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| int_value | INT | — |