ComfyUI Node

Integer to Float

The boring conversion node you'll actually use

By HavocsCall·Created 2 years ago·Updated 9 months ago· 4
Integer to Float
    • Float
    Integer

    Integer to Float converts an INT to a FLOAT. That's it - one input, one output, no settings. It's the least interesting node in this pack and also one of the most reliable to have around, because ComfyUI's type system is fussier than it looks.

    When you'd use it

    ComfyUI is strict about types in a way that trips up beginners constantly. Some nodes genuinely need a float where you have an integer - CFG values, denoise strengths, weights, strengths of anything. A raw integer wired into a float-only socket will be rejected or silently coerced depending on the node. Integer to Float makes the conversion explicit and removes the guesswork.

    The typical case: your step count, seed, or batch size is an integer (from a Selector, a counter, or a Logic Compare), and you want to feed it into something that expects a FLOAT. Instead of hunting for a node that happens to accept both, this bridge just works.

    How it works

    One line of Python:

    result = float(Integer)
    

    Nothing clever, nothing hidden - which is exactly why it's dependable. 3 becomes 3.0, and the value carries through precisely (small integers are exactly representable as floats, so no precision surprises).

    Inputs:

    • Integer - INT input socket (forceInput).

    Output:

    • Float - the converted value.

    Where people get burned

    Not much to burn yourself on with a pure conversion. The main gotcha is the sibling in the other direction: Float to Integer in this pack truncates toward zero rather than rounding (its description claims rounding - read the Float to Integer article for the full soap opera). Integer to Float has no such drama; it's lossless.

    One practical tip: because these conversion nodes are forceInput, you can't type a value into them - they only accept wired input. If you just want a number to exist, use Float Selector or Integer Selector from this pack's Basic category to create it, then convert.

    Installing it

    ComfyUI Manager → search "HavocsCall" → install → restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/HavocsCall/comfyui_HavocsCall_Custom_Nodes
    

    Restart, under HavocsCall/Conversion. No requirements.txt, no downloads - instant.

    CategoryHavocsCall/Conversion

    Inputs (1)

    NameTypeDefaultDescription
    IntegerINT

    Outputs (1)

    NameTypeDescription
    FloatFLOAT