Nodes/ComfyUI Level Pixel/Convert Int To String [LP]
ComfyUI Node

Convert Int To String [LP]

Bridging ComfyUI's strict socket types

By LevelPixel·Created 2 years ago·Updated 5 months ago· 31
Convert Int To String [LP]
    • STRING
    int0

    This node does exactly one thing: it takes a whole number and hands you back the same value as text. 5 goes in, "5" comes out. That sounds almost too trivial to need a node - until you hit the reason it exists, which is that ComfyUI's socket types are strict. An INT output plug does not fit a STRING input socket, even though to your eyes 5 and "5" are obviously the same thing. IntToString is the adapter that makes them fit.

    Where you actually use it

    Anywhere a number needs to become part of a piece of text. A seed value or a loop counter you want stamped into a filename prefix. A batch index feeding into a text-concatenation node so your Save Image output reads batch_03_output. A numeric value you want to eyeball on a Show Text node while debugging a graph, because staring at a raw INT widget mid-pipeline is less convenient than reading it as text alongside everything else. It's small, unglamorous plumbing - the kind of node you don't think about until a wire refuses to connect and you remember why.

    How it works

    There's no configuration here, no format string, no zero-padding option. It's Python's default integer-to-string conversion, nothing more. That means 7 becomes "7", not "007" - if you need padded frame numbers or thousands separators, this node won't do it for you; you'd want a text-formatting node downstream, or to build the string manually with concatenation.

    The inputs and outputs that matter

    • int - the only input, defaulting to 0. The min/max bounds are essentially the full 64-bit integer range, so it won't clamp anything you throw at it.
    • Output - a plain STRING, ready to wire into any text-taking socket.

    There's no optional input and no fallback behavior: if you try to feed this a FLOAT directly, ComfyUI's type-checker will refuse the connection outright, since the socket expects INT specifically. Run it through the pack's FloatToInt-LP first if that's your situation, or reach for AnyToText-LP instead if you want a looser converter that accepts whatever type shows up without caring.

    How to install it

    Easiest path is ComfyUI Manager: search for "ComfyUI Level Pixel" (or the repo name ComfyUI-LevelPixel), install, restart. It'll pick up updates automatically the next time you hit "Update ALL" in Manager.

    Doing it by hand is just as simple:

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

    then restart ComfyUI. This is a pure-Python conversion node with no model files and no extra dependencies to fight with - the restart is the entire install.

    Common issues & troubleshooting

    Connection won't let you wire it in. Double-check the upstream socket is actually typed INT and not FLOAT or STRING already - ComfyUI's connection validator is what's blocking you, not the node itself.

    You need leading zeros or a specific format. This node gives you the plain, unpadded number. Chain a text-formatting or string-concatenation node after it if you need "007" instead of "7".

    You're not sure what type is coming down the wire. If the upstream node's output type is genuinely unpredictable (mixed INT/FLOAT/whatever depending on some earlier branch), skip the strict converters entirely and use AnyToText-LP, which accepts any wildcard-typed input and stringifies it regardless of what actually shows up. The whole conversion family in this pack - StringToFloat-LP, FloatToInt-LP, BoolToInt-LP, StringToCombo-LP, and this one - is worth knowing as a set, since you'll likely need more than one of them in any workflow that does real type juggling.

    CategoryLevelPixel/Conversion

    Inputs (1)

    NameTypeDefaultDescription
    intINT0-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING