Nodes/Endless ️🌊✨ Nodes/β™ΎοΈπŸŒŠβœ¨ Float to Integer
ComfyUI Node

β™ΎοΈπŸŒŠβœ¨ Float to Integer

The boring little converter that unblocks your graph

By tusharbhuttΒ·Created 3 years agoΒ·Updated about a year agoΒ· 69
β™ΎοΈπŸŒŠβœ¨ Float to Integer
    • INT
    β—„FloatValue0.00β–Ί

    ComfyUI is strict about types. A node that wants an INT will not take a FLOAT, no matter how "obviously fine" the conversion looks - the graph just refuses to connect. ESS Float to Integer is the fix: it takes one float, rounds or truncates it into an int, and hands the result to whatever integer input was blocking you. It's the node equivalent of a language barrier interpreter, and it's boring in the best way.

    The "ESS" prefix marks it as part of the newer, Endless-branded converter family in the pack (β™ΎοΈπŸŒŠβœ¨). The pack ships a small set of these type bridges - int to float, string to float, number to int, and this one - all doing one job with no surprises.

    Inputs and outputs

    • FloatValue - the one input, a FLOAT, default 0.
    • INT - the one output, an integer.

    Under the hood it's a standard cast, so 3.7 becomes 3 (truncation, not rounding) and 3.0 stays 3. If you need rounding instead of truncation, round the float upstream first - ComfyUI's built-in math nodes can do that - and feed the result here.

    When you'll actually use it

    The classic spot is resolution handling. Resolution calculators and image analysis nodes often emit floats (aspect-ratio math produces 2.35, widths come out as 1344.0), and the Empty Latent Image or KSampler inputs want clean ints. Same story for any math node output feeding a seed or step input. One conversion node between them and the error message disappears.

    There's a mild overlap with ComfyUI's own primitives - int conversions exist elsewhere - but the ESS family's appeal is that you can name and save it in a workflow and it does exactly one obvious thing, which keeps a graph readable when you're reconstructing it later.

    Installing it

    Ships in Endless 🌊✨ Nodes by tusharbhutt:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tusharbhutt/Endless-Nodes
    # restart ComfyUI
    

    Or ComfyUI Manager β†’ search "Endless". No dependencies or model files - it's a pure type cast, nothing to download.

    Gotchas

    Truncation, not rounding, is the behavior to remember: if FloatValue is 2.9 you get 2, and if that matters to your math you'll want to round first. Keep the pack caveat in mind too - one hobbyist maintainer, AI-assisted, June 2025 rewrite. This node is trivial enough that it's not where the pack's risk lives, but if you need a float-to-int bridge and don't otherwise use Endless, ComfyUI's own math and primitive nodes may already cover you.

    CategoryEndless 🌊✨/Converters/Float

    Inputs (1)

    NameTypeDefaultDescription
    FloatValueFLOAT0.00β€”

    Outputs (1)

    NameTypeDescription
    INTINTβ€”