ComfyUI Node

ITOA

The ten-second trick for putting your seed into the prompt

By exectails·Created 2 years ago·Updated 7 months ago· 3
ITOA
    • text
    integer0

    The smallest node in the String Utils pack has exactly one job, and it does it with the kind of simplicity that makes you wonder why you needed a node for it at all. ITOA takes an INT and returns the STRING version. 42 in, "42" out. That's it. But in ComfyUI, string-versus-number friction shows up in the dumbest places, and this tiny converter is the fix.

    What it does and why you'd reach for it

    The genuinely useful pattern is embedding a seed into the prompt itself. People do this for reproducibility - you generate a run, like the image, and having seed: 12345 baked into the prompt text (which ComfyUI saves into the PNG metadata with the workflow) means the seed travels with the image. Chain ITOA into the pack's Text Formatter and you get "style X, seed {arg0}" out the other end.

    It's also the standard answer when some node only accepts STRING and you're holding an INT - a batch index, a parsed parameter, a dimension. And it's the exact inverse of ATOI in this same pack; run an INT through a text-only stretch of your graph and ITOA on the other side, and the round trip is lossless.

    How it works

    str(integer), plain and simple. Which means:

    • No padding. 7 becomes "7", never "0007". If you want zero-padded seeds, str() won't do it for you - you're formatting by hand.
    • No grouping, no formatting flags. 1234567"1234567", no commas.
    • Negative numbers work - -42"-42".

    Input: integer (INT, default 0, roughly ±2 billion). Output: text (STRING).

    How to install it

    Part of exectails/comfyui-et_stringutils ("String Utils"). Through ComfyUI Manager, search "String Utils"; or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/exectails/comfyui-et_stringutils
    

    Restart ComfyUI and it's under exectails/Strings. The pack installs with zero dependencies and zero downloads - you can't break anything adding it.

    Common issues

    Honestly, there aren't many - it's str(). The only real disappointment is padding: if you expected 42 to come out as "000042" for a filename scheme, it won't, and there's no parameter for it. The node takes one input and gives one output; it has no failure modes beyond "you wired the wrong thing into it." If you need the number rounded before converting, do that upstream - ITOA trusts what it's given and converts it verbatim.

    Categoryexectails/Strings

    Inputs (1)

    NameTypeDefaultDescription
    integerINT0-2000000000–2000000000

    Outputs (1)

    NameTypeDescription
    textSTRING