Float To Int JK๐
The tiniest node that saves real headaches
- INT
If you've ever wired a computed value into an input that insists on an integer and gotten the red "wrong type" wire, this is the node for you. Float To Int JK takes one float and hands you back an integer. That's the whole job, and it's the kind of boring utility that keeps a graph from dying on a type mismatch five nodes downstream.
How it works
Under the hood it's one line: Python's int(a). The important behavior to internalize is that this truncates toward zero - it does not round. 3.7 becomes 3, 2.1 becomes 2, and -2.7 becomes -2. If you're used to round(), this will surprise you exactly once, usually when a resize dimension comes out one pixel short of where you wanted it.
Inputs and outputs
a- theFLOATyou want to convert. That's the only input.INT- the result, ready to plug into any integer slot: latent width/height, steps, seeds, batch counts.
The classic use is cleaning up the output of float math. Say a resolution node hands you 1024.0 * 0.75 = 768.0 - technically an integer value but still typed as FLOAT. ComfyUI is strict about wire types, so you'd normally reach for a conversion node or fight the UI. This is that conversion node, with nothing else bolted on.
Installing it
It's part of ComfyUI-JakeUpgrade:
- ComfyUI Manager โ search "JakeUpgrade" โ install โ restart.
- Or:
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade
pip install -r requirements.txt
Windows portable: run install.bat or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt.
Common issues
- The result is one lower than I expected. See above - it's truncation, not rounding. If you genuinely need rounding, do it in a math node before converting (
add 0.5for positive values, then truncate), or use aMathoperation that gives you a rounded result. - "I could just use ComfyUI's built-in convert." Sure - ComfyUI core has
Convert Float to Int-style nodes in recent versions. But JakeUpgrade's math nodes (including itsFloat Binary Operation JK) emit floats, and this node is the sibling that pairs with them cleanly, especially if you're already running JakeUpgrade's workflows. It's a matter of what's already on your graph, not a capabilities arms race.
It's a one-input, one-output triviality - the kind of node that looks silly until you're mid-workflow at 11pm and the only thing between you and a render is a FLOAT where an INT belongs.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| a | FLOAT | 0.00 | Input float value to convert |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | โ |