Nodes/comfyui-zeug/Int to String
ComfyUI Node

Int to String

Turning a number into text, for filenames and metadata

By adrianschubek·Created about a year ago·Updated about a year ago· 1
Int to String
    • string
    value0

    Half the time you build a filename in ComfyUI, you're gluing a number onto some words: portrait_003, seed_12345, scale_7. The problem is that string nodes and number nodes speak different languages, and ComfyUI won't always convert for you. ZeugIntToStr is the two-cent bridge that turns an integer into text so your string pipeline can actually use it.

    What it is

    ZeugIntToStr lives in the zeug → Convert menu. One input, value, an INT (default 0). One output, string. Feed it a number, get back its textual form - 12345 becomes "12345". That's the whole job, and it does it without fuss.

    When you'd reach for it

    This is the node you chain after a ZeugInt (or any integer source) when the destination is text. The most common targets:

    • Filenames - save nodes with a name template that wants "frame_" + str(frame_number).
    • Metadata - writing seed, steps, or CFG values into PNG metadata or a caption string.
    • Prompt building - inserting a number into a prompt template, like a count or an index.
    • Debugging labels - converting a value so a print/display node can show it next to other text.

    It pairs with the pack's ZeugJoinStr to assemble "seed_" + "12345" without pulling in a heavyweight text suite. For a beginner, it's the answer to the classic wall: "why can't I put my seed into a filename?" - because filenames are strings and your seed is an int, that's why.

    How it works

    The implementation is exactly what you'd hope: str(value). Nothing is rounded, truncated, or reformatted - what you typed is what gets stringified. One subtlety worth knowing: a float like 7.0 is not this node's business. If you feed it an integer, you get "7"; if your value is a float, use ZeugFloatToStr instead, because str(7.0) would give you "7.0" and that may not be what a filename template wants.

    How to install it

    Part of the comfyui-zeug pack (German for "gear" or "stuff"), a small GPL-3.0 collection by Adrian Schubek:

    • ComfyUI Manager: search zeug in the Custom Nodes Manager, install ComfyUI-Zeug.
    • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/adrianschubek/comfyui-zeug
    

    Restart ComfyUI. No dependencies, no model downloads - the pack only uses torch and ComfyUI's own internals. About as painless an install as custom nodes get.

    Common issues

    There isn't much to go wrong, but two things catch people:

    • Feeding it a float. If your source is a FLOAT node and you wire it here, ComfyUI will typically refuse the connection. Convert the float to int first (a rounding/floor node from another pack, or the type discipline of using ZeugInt upstream). This node is strictly int-in, string-out.
    • Expecting formatting. Want zero-padded "0007" or a thousands separator? Not here. It's a plain str() conversion; for padding you'd need a formatting utility from a bigger text pack.

    If all you ever need is "number becomes text, losslessly," this is the node, and it's the one you'll actually remember.

    Categoryzeug/convert

    Inputs (1)

    NameTypeDefaultDescription
    valueINT0

    Outputs (1)

    NameTypeDescription
    stringSTRING