ComfyUI Node Runs on cloud

Int to Float

The INT-to-FLOAT converter in Derfuu's pack

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Int to Float
    • FLOAT
    Value1

    Takes an integer and hands you back a float. That's the entire node, and the reason it needs to exist is that ComfyUI won't let an INT output plug into a FLOAT input - the types don't match and the wire refuses. This is the adapter that makes the connection legal. Integer in, decimal out.

    It's a "Converter" in Derfuu_ComfyUI_ModdedNodes. The DF_ prefix is the pack's current class-naming; the same node shows up as plain Int to float in older workflows, from before Derfuu reorganized things.

    How it works

    One input, Value (INT). One output, FLOAT. It re-types the whole number as a decimal - 7 becomes 7.0. The conversion is exact and lossless; integers are just floats without a fractional part.

    Where it fits

    You'll want it whenever a value born as an integer needs to flow into float-typed machinery. Set a count or dimension with Integer, then feed it into Multiply or Subtract (which work in floats), or into a scaler's float ratio input - DF_Int_to_Float sits in the middle and the wire connects.

    Going the other way? The Integer node accepts a float and outputs an INT, so it's the FLOAT→INT half of the same idea. Together they let a number hop between the two numeric types your nodes insist on. It's pure glue - invisible when it works, and exactly what unblocks a math chain that won't connect.

    A concrete example: read an image's dimensions with Get image size, which gives you INTs, then feed one into Multiply to compute a scale - except Multiply's ports are floats, so the INT won't connect. Drop DF_Int_to_Float in between and the chain flows. Small node, but without it that whole automatic-sizing pattern stalls at the first wire.

    Fair warning: don't add converters you don't need. Some nodes quietly accept either numeric type, and a graph littered with conversion nodes is harder to read than one with a couple of them placed exactly where a connection was actually refused. Reach for this when ComfyUI blocks the wire, not before.

    Common issues & troubleshooting

    Wire still refused. Check the direction. This is INT→FLOAT only. If you're trying to feed a float into something that wants an integer, that's the Integer node's job instead.

    A Int to float (spaces) node in an old graph is red. That's the pre-rename class. Derfuu tends to delete old node classes on reorganizations rather than deprecate them, so old workflows break across updates. Replace with this current DF_Int_to_Float and re-wire.

    ModuleNotFoundError: No module named 'custom_nodes.Derfuu_ComfyUI_ModdedNodes'. An old workflow pointing at a moved module path. Update the pack via Manager, reload, swap the node.

    Install: ComfyUI Manager → search "Derfuu" → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes then restart. No models or heavy dependencies - plain Python.

    CategoryDerfuu_Nodes/Functions/Converters

    Inputs (1)

    NameTypeDefaultDescription
    ValueINT1-9223372036854776000–9223372036854776000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT