Nodes/ComfyUI-RvTools_v2/Float to Integer
ComfyUI Node

Float to Integer

The Two-Line Conversion Node That Ends 'Can't Wire Float Into INT' Errors

By r-vage·Created about a year ago·Updated 5 months ago· 23
Float to Integer
    • INT
    _float0.00

    You've been there: a slider gives you a float like 2.7, the node downstream needs an integer, and ComfyUI refuses the wire. Float to Integer is the three-second fix - one input, one output, and it just drops the decimals. It's the smallest node in this pack, and it exists for the same reason all the RvTools utility nodes exist: sometimes you need the boring conversion and you don't want to build a mini-graph for it.

    What it does

    Exactly one thing. It takes a _float input (a FLOAT, marked forceInput so it arrives as a wire from a slider or a math node) and returns int(_float) on the INT output. That's Python's int(), which truncates toward zero - 2.7 becomes 2, 2.9 becomes 2, -2.9 becomes -2. No rounding, no nearest-integer logic. If you want rounding, do it upstream or use a round node; this one's contract is "cut the decimals."

    When you'd use it

    It's the duct tape of workflow wiring. Common cases:

    • A step counter or batch-size field needs an integer but your source is a float slider.
    • A prompt-builder or filename node needs a whole number and the value came out of a resolution calc as 1024.0.
    • You're feeding a control_after_generate seed widget and the seed value drifted into float territory.

    Honestly, its most common role in the wild is fixing broken shared workflows. The original RvTools repo's version of this node appears in a lot of downloaded graphs, and when people upgrade to the [RvTools]-named pack, this is one of the nodes they swap in to make the wire connect. It's not glamorous, but it's exactly the kind of glue that keeps a graph from refusing to run.

    Installing it

    Part of ComfyUI-RvTools_v2 - ComfyUI Manager → search "ComfyUI-RvTools_v2", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/r-vage/ComfyUI-RvTools_v2
    # restart ComfyUI
    

    No dependencies beyond ComfyUI itself, and no model files. This is one of the few RvTools nodes you can use in isolation without pulling in anything heavy.

    Gotchas

    The truncation behavior is the thing to remember - if you expect 2.9 to round up to 3, this node will quietly give you 2. And there's a naming wrinkle worth knowing if you download shared workflows: some older graphs call it "Float to Integer // RvTools" (from the predecessor repo), and ComfyUI Manager won't reliably match that to this pack's Float to Integer [RvTools]. If a workflow says the node is missing, search Manager for the [RvTools] version and swap it in - the wires connect identically. The usual pack caveat applies too: RvTools_v2 is unmaintained, with ComfyUI_Eclipse named as the successor.

    Category🫦 RvTools II/ Conversion

    Inputs (1)

    NameTypeDefaultDescription
    _floatFLOAT0.00

    Outputs (1)

    NameTypeDescription
    INTINT