β¨οΈ IG ZFill
Pad your filenames so frame_100 doesn't sort before frame_2
- STRING
The first time you export a frame sequence and your video player plays frame 2 after frame 10, you'll understand why this node exists. IG ZFill is a one-trick primitive: it takes an integer and left-pads it with zeros to a fixed width, so 7 becomes "000007".
That's it. That's the whole job. It's the kind of utility that looks like filler until you're assembling an animation workflow and every other node is quietly producing unpadded numbers.
How it works
Under the hood it's literally Python's zfill - the source is a one-liner:
return (f"{value}".zfill(fill),)
Two inputs, one output. value is the integer you want padded. fill is the target width, default 6, capped at 8. The output is a STRING - "000007" - not a number.
Where it earns its keep
- Filenames and frame sequences. Batch-saving 300 frames as
frame_7.pngwill sort wrong in basically every file browser and video tool.frame_000007.pngsorts correctly, always. - Zero-padded IDs in paths. It pairs naturally with the pack's
IG Path Joinprimitive, so you can assemble a full export path entirely in-graph. - Deterministic ordering anywhere the string lands. It turns a number into something you can sort lexicographically and trust.
Where people get burned
fillmaxes out at 8. You cannot pad to 10 digits with this node. That's a hard cap in the schema, not a suggestion.- The output is a string. You can't plug it back into an INT input. Route it through a text/template node or into a filename; it won't feed a number socket.
- Negative numbers pad after the minus sign, which is standard Python
zfillbehavior --123at fill 6 becomes-000123. Usually fine, occasionally surprising.
Installing it
It's part of IDGallagher/ComfyUI-IG-Nodes ("IG Interpolation Nodes"). In ComfyUI Manager, search "IG Interpolation Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/ComfyUI-IG-Nodes
Restart, let the requirements install, and it'll be under IG Nodes β Primitives. No models, no downloads, no external service.
Honest take: this is a convenience wrapper around a standard-library function, and if you already have a text-formatting node you like, you don't strictly need it. But it's free, it's already installed if you have the pack for the SM Video nodes, and it keeps the padding inside the primitive layer where the numbers are. One small disclaimer: the pack's README is a smiley face and there's essentially no community writing about these nodes, so the source code is the manual - which is fine, because there's very little to this one.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value | INT | 0-9223372036854776000β9223372036854776000 | β |
| fill | INT | 60β8 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |