๐ผ> Int to Text
Turn a number into a zero-padded string for frame numbers and filenames
- text
A small conversion node that turns an INT into a STRING, with one genuinely useful extra: optional zero-padding. Plain type conversion alone would just be 5 โ "5", but for anything sequential - frame numbers, batch indices, sortable output filenames - you usually want "00005" so files sort correctly and line up visually. That's what leading_zeros and length are for.
The natural pairing is with something like Load Image From Folder's index-driven iteration, or any counter feeding into a Save Image filename via Text Combine - instead of your batch outputs sorting as 1, 10, 11, 2, 3... in a file browser, zero-padded names sort the way you'd expect.
How it works
Converts the integer to its string representation. If leading_zeros is on, it pads the front of that string with zeros until it reaches length characters total.
The inputs and outputs that matter
int(default0) - the number to convert.leading_zeros(BOOLEAN, defaultfalse) - turn on zero-padding.length(default5, range 0โ5) - target string length when padding is on. Per the README's own example,10withleading_zeroson andlengthat5becomes"00010".
One output: text (STRING) - feed it into Text Combine to build a filename, or anywhere else a string is expected instead of a raw number.
How to install it
Via ComfyUI Manager: search "yanc" or "YANC - Yet Another Node Collection," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ALatentPlace/ComfyUI_yanc
then restart. No dependencies, no downloads.
Common issues & troubleshooting
No padding showing up even with a small number. Double-check leading_zeros is actually toggled on - it defaults to false, so a bare int value like 7 converts to "7", not "00007", until you flip that switch.
Number gets truncated instead of padded. length caps out at 5 in this node's range - if your int value has more digits than length (say 123456 against a length of 5), padding can't help you shrink a number that's already longer than the target width; the node pads up to the length, it doesn't truncate down to it. For sequences that might run past 99999, this node's padding ceiling won't cover you.
Just need a raw string, no padding. Leave leading_zeros off - the node still works as a plain int-to-string converter with no padding logic applied, which is the simpler and more common use case if you're not building sortable filenames.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| int | INT | 00โ18446744073709550000 | โ |
| leading_zeros | BOOLEAN | false | โ |
| length | INT | 50โ5 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | โ |