Nodes/ComfyUI Utilitools Nodes/Whatever To String
ComfyUI Node

Whatever To String

A conversion node with a catch

By aesethtics·Created about a year ago·Updated about a year ago· 1
Whatever To String
    • string_result
    int_value0
    float_value0.00
    string_value

    Whatever To String is supposed to be the node that turns "whatever value you have" into text - a seed, a step count, a CFG number - so you can stuff it into a filename, a prompt, or a note. That's the idea, and it's a genuinely useful one in ComfyUI, where values show up as colored wires and you sometimes just need the literal text of a number. But this specific node has a catch baked into its source, and you should know about it before you wire it into anything.

    Here's the mechanism. The node takes three optional inputs:

    • int_value (INT, default 0)
    • float_value (FLOAT, default 0.0)
    • string_value (STRING, default "")

    ...and returns a single string_result. The conversion logic checks the inputs in order: if int_value is present it returns str(int_value); otherwise it tries float_value, then string_value.

    And here's the catch: in practice, it always outputs "0". All three inputs carry defaults, and in ComfyUI an optional input with a default is always present - the widget fills in that default when nothing is connected. So int_value is never actually None; it's sitting at 0 every single run. The node checks it first, finds it, and returns "0" - no matter what you wire into float_value or string_value. Wire a float in, get "0". Wire a carefully built string in, get "0". The float and string paths are effectively unreachable, because the int input with its default wins the check before the code ever looks at them.

    The one path that does work: connect something to int_value itself, and you get that number as a string. That's... a way to get str(int) out of a node, sure, but you could also just look at the widget. It's not a lot of value.

    So what do you do? If you need a float or string converted to text, don't fight this node - use a conversion node from a larger, maintained pack, or handle it inline. If you specifically want str(int_value), this node will do that one thing without issue. It's a shame, because "convert whatever to string" is a real workflow need; this implementation just checks its own default first.

    Honest framing: this is a small hobby pack - the author describes the whole collection as "utility nodes I made for myself, useful but not groundbreaking" - and this is the node where that shows. It's a fine lesson in why you read the source of the small packs you install.

    Install. It ships in ComfyUI Utilitools. In ComfyUI Manager, search "ComfyUI Utilitools" (pack title: ComfyUI Utilitools Nodes), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aesethtics/ComfyUI-Utilitools
    

    Restart ComfyUI. The pack has no dependencies beyond the Python standard library and no models to download, so installation is trivial and safe.

    If your output is "0" and you expected something else - that's not you being confused, that's the node. Connect int_value, or reach for a different tool. Worth knowing, so you don't spend an evening debugging it the way somebody already has.

    CategoryUtilitools/Conversion

    Inputs (3)

    NameTypeDefaultDescription
    int_valueoptINT0
    float_valueoptFLOAT0.00
    string_valueoptSTRING

    Outputs (1)

    NameTypeDescription
    string_resultSTRING