ComfyUI Node

Integer to Float

Turn a whole number into a decimal

By jamesWalker55·Created 3 years ago·Updated about a year ago· 215
Integer to Float
    • FLOAT
    value0

    ComfyUI is strict about types. An INT socket and a FLOAT socket are different colors and won't always connect, even though "5" and "5.0" are obviously the same number to you and me. This node is the little adapter that bridges them: integer in, float out. That's the whole job.

    You reach for it whenever a value you're computing as an integer needs to plug into something that wants a float - a CFG scale, a denoise strength, a LoRA weight, a scheduler parameter. You might have a counter or a math node producing ints, and the input downstream is a float. Rather than fight the type system, you drop this in the middle and the wire connects.

    How it works

    It reads the integer and returns the same numeric value as a float. 5 becomes 5.0. No rounding, no scaling, no precision games - it's a type cast, not a calculation.

    Inputs and outputs

    • value - the integer to convert. (Default 0; the min/max span the full integer range, so you'll never hit a limit in practice.)

    Output is a single FLOAT carrying the same value.

    Installing it

    This node lives in the pack's comfyui_primitive_ops file. Install via ComfyUI Manager (search Various ComfyUI Nodes by Type / comfyui-various) or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jamesWalker55/comfyui-various
    

    Restart ComfyUI. No models, no extra dependencies.

    Common issues

    There's nothing to break - it's a one-way cast. The only real question is whether you need it at all. ComfyUI has gotten more forgiving about int-into-float connections over versions, and in some spots the value flows through without complaint. Reach for this node when the graph actually refuses the connection, not preemptively; an unnecessary conversion node is just clutter.

    The bigger picture is that this is one of a whole family of tiny type/math nodes in this pack - there's JWFloatToInteger going the other way, plus add/subtract/multiply/divide for both types. If you're building any logic in the graph (driving a value from a frame index, computing a size, offsetting a seed), you'll usually end up with a couple of these strung together. That's normal; that's what they're for.

    One reason you might have landed here: these JW primitive nodes show up constantly inside other people's workflows - a downloaded Wan or animation graph will often have a few doing arithmetic behind the scenes. If one loaded red as "missing," you just don't have the pack installed. Run ComfyUI Manager's "Install Missing Custom Nodes," or clone the repo above, and it'll resolve.

    CategoryjamesWalker55

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT