Format Int To String
Zero-padded numbers for filenames and labels
- STRING
- INT
Format Int To String is a tiny helper with one obvious job: take an integer, and turn it into a string with leading zeroes so it lines up right in filenames and labels. 7 becomes 0007. 42 becomes 0042. That's the whole trick, and for anyone doing numbered batch saves it's the difference between files sorting as 1, 2, 10 and files sorting as 0001, 0002, 0010 in your output folder.
ComfyUI's own Save Image node has a little filename templating, but it's clunky for custom numbering schemes. This node plugs the gap: it's a plain formatter you slot between a counter and a filename, and it's designed to pair with the same pack's Get Counter In Output Folder node - that one counts your PNGs, this one pads the number, and you concatenate the result into whatever Save Image filename you want.
The three inputs
- initial_int - the integer to format. It's marked as a forced input, so you can wire another node's output into it (that's the whole point).
- number_digits - how wide to pad, 1 to 20, default 4. With 4 digits,
7→0007. Numbers longer than the width pass through unchanged. - use_digits - the toggle that switches padding on or off. Flip it off and the node just stringifies the integer with no zeroes. The README is explicit that this doesn't alter the input number itself - it only affects the string representation.
The two outputs
- STRING - the formatted text (
0007). This is what you feed into a filename or a label. - INT - the original integer, passed through untouched. Handy if you want to use the same number for a second calculation downstream without running a second copy of the node.
The output is one node's business, really - text going into a filename box, an integer going wherever integers go.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/Kaleidia/KaleidiaNodes
# restart ComfyUI
Or ComfyUI Manager → "KaleidiaNodes". No dependencies, no models.
Where people get burned
Honestly, not much to burn here. The one surprise is that number_digits is about padding width, not precision - there's no rounding, no truncation, nothing clever. If you feed it a float from a node that says "INT" in its title but hands over decimals, that's the upstream node's problem, not this one's. Keep use_digits on for filenames, and you'll forget the node is even there - which is the correct relationship to have with a formatter.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| number_digits | INT | 41–20 | — |
| initial_int | INT | — | |
| use_digits | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| INT | INT | — |