ComfyUI Node

floatToText _O

Get a number into your prompt string

By omar92·Created 3 years ago·Updated 5 months ago· 181
floatToText _O
    • STRING
    float0.00

    Numbers are useful. Strings are useful. Putting a number inside a string is the weird middle ground where ComfyUI makes you work for it - and floatToText _O is the one-trick node that does exactly that conversion. You feed it a FLOAT, you get a STRING back containing that number. Sounds trivial until you want a computed value to show up in a filename, a caption, or a prompt term and realize the type system won't let a FLOAT just sit in the middle of your text.

    It lives in O/numbers of the Quality of Life Suit pack, next to floatToInt _O and the equation nodes. If you're building a workflow that computes values and then labels things - a seed that gets baked into a saved filename, an upscale factor that appears in a caption - this is the bridge from arithmetic to prose.

    How it works

    The implementation is str(float): whatever number comes in becomes its plain string representation. 1.5"1.5", 0.0"0.0". One line, no formatting options, no rounding, no locale tricks.

    • float (FLOAT) - the value to stringify. Default 0, widget range 0 to a huge max.

    One output: STRING. That's the whole feature list.

    Where it fits

    The realistic use cases are all "computed number meets text" moments:

    • Filenames. Wire Equation1param _O's result through this node into a saveTextToFile _O filename and your log file is automatically dated or versioned by a computed value.
    • Prompt assembly. A random NSP term or a numeric parameter you want visible in the final prompt string - concat the stringified number into your text with the pack's Concat Text _O.
    • Debugging. Run a float through this into Debug Text _O and read the exact value in the console.

    Before you reach for it, check the actual target node - lots of nodes that accept text will also accept a FLOAT directly and render it for you. The conversion node earns its keep when you're concatenating, not just displaying.

    Installing it

    Part of the Quality of Life Suit pack (omar92/ComfyUI-QualityOfLifeSuit_Omar92). Install via ComfyUI Manager (search "Quality of Life Suit") or clone:

    cd <ComfyUI>/custom_nodes
    git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
    

    Restart ComfyUI properly. No models, no dependencies. The pack creates a config.json on first run with autoUpdate: true, so it may pull new commits at startup - disable it there if you prefer a static folder.

    Common issues

    • "The string shows 0.0 but I wanted 0." That's Python's str() on a float - a whole number stays typed as a float. If you want 0 without the decimal, run it through floatToInt _O first (accepting the truncation).
    • "I can't set the number from a wire." The float input is a widget, but most of the pack's number nodes accept wire input too (defaultBehavior: input), so feed it from Equation1param _O rather than typing.
    • "The number is wrong in my filename." Check upstream - this node converts faithfully, so the corruption is in the math, not the stringify.

    It's a dumb little adapter, but "dumb and correct" is precisely what you want when the alternative is hand-typing numbers into text that's supposed to be computed.

    CategoryO/numbers

    Inputs (1)

    NameTypeDefaultDescription
    floatFLOAT0.000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING