Nodes/ComfyUI_MqUtils/MQ Int To String
ComfyUI Node

MQ Int To String

Number goes in, text comes out. Sometimes that's exactly what you need

By mikeshuangyan·Created about a year ago·Updated about a year ago· 1
MQ Int To String
    • STRING
    int0

    Some nodes need an essay. This one is the entire argument for owning a pack of boring utilities: it takes an integer and hands you the string version of it. str(int) in Python, exposed as a node. If that sounds like the most obvious four lines of code ever written, you're right - and you'll still install it the first time ComfyUI refuses to put a seed into a text field.

    Here's the situation that makes it earn its place. ComfyUI keeps strings and ints in separate worlds, and a lot of what you actually want to do lives in the string world. You want the seed that produced an image written onto the image, or into a filename, or into a caption. You want a step count or a batch index stitched into a prompt or an API payload. Every one of those starts with a number becoming text, and core ComfyUI just... doesn't have a node for that. Enter MQ Int To String.

    The mechanism is not mysterious: one input, int (INT, min -1,000,000,000, max 1,000,000,000, step 1), and one output, STRING. The interesting bit is a flag on the input called forceInput, which in practice means you can right-click the widget and convert it so another node's output wires straight in. That's the move for the seed case - drag your seed wire in, run, and the string comes out ready for a text field, a Show Text node, or concatenation into a prompt.

    Two honest limitations, because this node is exactly as smart as str() is. First, there's no formatting. No zero-padding, no hex, no thousands separators. If you need "007", you're formatting elsewhere and feeding the result in. Second, the range clamps at ±1e9. That covers basically everything you'll generate, but it's a fraction of the 64-bit range ComfyUI's own seed widgets accept - so if you're running workflow-shared seeds that live way up near 2^64, this node will quietly cap them at a billion. In practice you'll never hit it; in theory, now you know.

    Also keep straight what it is not: it's integer-to-string, full stop. Floats go elsewhere.

    Install is the same one-liner as the rest of the pack - ComfyUI Manager, search ComfyUI MqUtils, install, restart - or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mikeshuangyan/ComfyUI_MqUtils.git
    

    then restart. No dependencies, no models to download, about five lines of real logic in the whole pack.

    You'll use it maybe once a week. But on that once, the alternative is hand-typing a seed into a text box and hoping it matches the one that actually ran - which is exactly how you lose an afternoon debugging something that was never wrong.

    CategoryMQ Utils/Utils

    Inputs (1)

    NameTypeDefaultDescription
    intINT0-1000000000–1000000000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING