ComfyUI Node Runs on cloud

float

The boring converter that stops you adding two extra nodes

By TinyTerraΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 604
float
    • float
    • int
    • text
    β—„float0.00β–Ί

    Sometimes a node is genuinely thrilling and sometimes it just saves you from adding three more nodes to the graph. tinyterraNodes' float is firmly in the second camp, and that's fine - it's exactly the kind of utility that makes a workflow less cluttered and easier to share.

    All it does is take one number and hand it back in every type ComfyUI speaks. You type a float, and out the other side you get the same value as a FLOAT, an INT, and a STRING (text). One input, three outputs, done.

    Why you'd reach for it

    ComfyUI is strict about types - a FLOAT output won't plug into an INT socket, and there are plenty of nodes where you want the same number in two flavors. A few genuinely common cases:

    • A node wants an INT (like a seed or a step count), but you're thinking in decimals. The int output gives you the truncated whole number from your float.
    • You want to embed a number into a prompt or a filename. The text output feeds straight into text concatenation nodes, or into the pack's prefix parsing (%[widget_name]% style) if you're saving images.
    • You're building a workflow where the same numeric parameter should drive both a strength slider and a text readout. Type it once, fan it out.

    That last one is the real payoff: instead of hand-typing the same value into three places and risking drift, you set it here and wire the three outputs wherever they belong.

    The inputs and outputs

    • float - the only input. A number from 0 up to a very large maximum, stepping by 0.01. Note the minimum is 0, so you can't type negatives here.
    • float (output) - the same value, passed through untouched.
    • int (output) - the value cast to an integer.
    • text (output) - the value as a string.

    The conversion is a straight Python cast (int(float)), which means it truncates, it doesn't round: 2.99 becomes 2. If you need proper rounding, do it in whatever node consumes the value, or reach for a calculation node instead.

    Installing it

    float is part of the tinyterraNodes pack. Install once via ComfyUI Manager (search "tinyterraNodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes
    

    Then restart ComfyUI. No models, no pip dependencies - the whole pack is plain Python plus a JS front-end. You'll find the node under 🌏 tinyterra/util, right next to its sibling int, which does the mirror-image job if you start from a whole number.

    It's not a node you'll write home about. It's a node you'll quietly be glad exists on the 40th time you need a number in two types.

    Category🌏 tinyterra/util

    Inputs (1)

    NameTypeDefaultDescription
    floatFLOAT0.000–18446744073709550000β€”

    Outputs (3)

    NameTypeDescription
    floatFLOATβ€”
    intINTβ€”
    textSTRINGβ€”