Nodes/ComfyUI Ino Nodes/Ino Float To Int
ComfyUI Node

Ino Float To Int

Pick your rounding instead of fighting Python's

By nobandegani·Created about a year ago·Updated 2 months ago· 6
Ino Float To Int
    • int
    input_float0.00
    method

    Sooner or later a node hands you a float - a denoise strength, a scale factor, a CFG value - and the next node wants a whole number. That's when you discover ComfyUI's implicit casting is fine right up until it isn't, and you need a real conversion you can reason about. Ino Float To Int is the pack's answer: one float in, one int out, with the rounding strategy you actually chose.

    It's a small node from the Ino Nodes pack (nobandegani), built on ComfyUI's newer V3 schema. There's no magic here, which is the point - it's a conversion you can trust instead of guessing what round-trip the graph silently did.

    What you control

    Two inputs, and only one of them needs your attention most of the time:

    • input_float - the value to convert.
    • method - the rounding strategy, one of round, floor, or ceil.

    That second dropdown is the whole reason this node exists. floor always goes down (3.9 → 3), ceil always goes up (3.1 → 4), and round uses Python's banker's rounding - 2.5 → 2, not 3. If you've ever had a batch size come out "wrong" because 7.5 rounded down when you expected up, this is the fix: you pick the behavior instead of inheriting one.

    The single output, int, plugs into any INT input downstream - batch sizes, width/height for latent creation, step counts, anything that rejected the float you were feeding it.

    When you'd use it

    The honest answer: whenever the float/int boundary keeps biting you. Common spots - turning a computed denoise or scale factor into a concrete step count, converting a percentage slider into a batch size, or sanitizing a float that came out of a math expression before it hits a node that only speaks integers. It's the kind of node you don't think about until you need it, and then you're glad it's sitting in the menu next to its sibling Ino Int To Float for the reverse trip.

    Installing it

    It arrives with the full Ino Nodes pack, so you install that once. ComfyUI Manager: search "ComfyUI Ino Nodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/nobandegani/ComfyUI-InoNodes.git
    cd comfyui_ino_nodes
    pip install -r requirements.txt
    

    Restart ComfyUI after. Both gotchas from the rest of the pack apply: it's built on the V3 node schema (README wants ComfyUI v0.18.1+), and pip install -r requirements.txt matters because every node imports inopyutils, the author's helper library.

    Common issues

    The only real surprise is round not behaving like you learned in school - banker's rounding rounds halves to the nearest even number, so 2.5 → 2 and 3.5 → 4. If that bites you, switch to floor or ceil. And note the output is a plain INT; if a downstream node wants a FLOAT, you'll need the sibling node for the return trip. Search "Ino Float To Int" in the node menu to find it (it's grouped under InoFloatHelper).

    CategoryInoFloatHelper

    Inputs (2)

    NameTypeDefaultDescription
    input_floatFLOAT0.00
    methodCOMBO3 options: round, floor, ceil

    Outputs (1)

    NameTypeDescription
    intINT