Nodes/Mikey Nodes/Int to String (Mikey)
ComfyUI Node

Int to String (Mikey)

The small converter that unblocks filenames and captions

By bash-j·Created 3 years ago·Updated 11 months ago· 188
Int to String (Mikey)
    • STRING
    int_0
    use_commasfalse

    Nothing glamorous here - this node takes an integer and hands it back as a string. But ComfyUI is strict about socket types: a STRING input will not take an INT plug, full stop. So the moment you want to embed a seed, a step count, or any computed number into a filename, a caption, or a piece of metadata, you need exactly this conversion, and this is Mikey Nodes' answer to it.

    How it works

    One number goes in, one string comes out. There's a single extra option - use_commas - that decides whether the output gets thousands-separators. Off, and 1024000 stays 1024000. On, and you get 1,024,000. That's the entire feature set, and it's the right amount of feature for what the node is for.

    The inputs and outputs that matter

    • int_ (INT, default 0) - the number to convert. The schema's declared max is enormous (roughly the ceiling of a 64-bit unsigned integer), which is really just the widget's numeric limit leaking through rather than a hint you should be feeding it huge values - most real uses are seeds, step counts, or pixel dimensions, all comfortably small.
    • use_commas (true/false, default false) - thousands-separator formatting. Leave it off for anything that becomes part of a filename or a machine-readable field (commas in a filename are asking for trouble on some filesystems); turn it on for anything a human reads directly, like a caption or an on-image label.
    • STRING (output) - the converted value, ready to plug into anything expecting text.

    How to install it

    Same install as the rest of the pack - there's no standalone version of this one node. Via ComfyUI Manager, search "Mikey Nodes" and install. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bash-j/mikey_nodes
    

    then restart. No models, no extra dependencies - it's pure Python string formatting under the hood.

    Where it actually gets used

    The obvious pairing inside this same pack is SaveMetaData's filename_prefix, which wants a string - run your seed or a computed value through Int to String first if you want it baked into the saved filename. It's also the natural partner for any "Show Text" or caption-overlay node once you've computed something numeric mid-graph and want to see it, or burn it into the image.

    Common issues & troubleshooting

    No decimals. This node is INT-only by design - feed it a FLOAT socket and ComfyUI will refuse the connection at the graph level before you even queue. The pack ships a separate Float to String node for that case (not covered here, but it's the same idea one type over).

    Negative numbers aren't accepted at the widget. The schema's min is 0. If a value you're piping in could legitimately go negative - a difference computed by EvalFloats, say - clamp it upstream rather than assuming this node will handle the sign for you.

    Commas breaking a filename. If you wire this into a path or filename field with use_commas left on, some filesystems and some downstream tools choke on the literal comma character. Default to false for anything that isn't purely for human eyes.

    CategoryMikey/Utils

    Inputs (2)

    NameTypeDefaultDescription
    int_INT00–18446744073709550000
    use_commasCOMBOfalse2 options: true, false

    Outputs (1)

    NameTypeDescription
    STRINGSTRING