Padded File Name v1.2.1
Turn 12 into frame_00012_.png — the file-naming glue for dataset frames
- formatted_filename
A one-trick node, and the trick is genuinely useful: it takes a number and formats it into a zero-padded filename. Give it loop_count = 12 and it hands back frame_00012_.png. That's the whole job - no model, no GPU, no API, no math worth fearing.
Why you'd want that: consistency. Training datasets and frame sequences are miserable to work with when the files are img1.png, img10.png, img2.png - lexicographic and numeric sorting disagree, so a loader that reads files in sorted order grabs them in the wrong sequence and your training set comes out shuffled. Five-digit padding (00001, 00012, 00123) keeps everything collating correctly up to 99999. It's the small, unglamorous thing that saves you from a silently wrong dataset.
The naming convention here isn't arbitrary, either. Prefix, underscore, zero-padded number, underscore, .png - that exact shape is the one this pack expects elsewhere: the Keyframe Video node's frame matcher and its own saved-frame names line up with it. So if you're building the pack's dataset or frame pipeline end to end, this string drops straight into the save node you're already using.
Inputs:
loop_count- the number to format, typically wired from the pack's Counter (from file) node.multiplier- the output isloop_count × multiplier. Lets you step by more than one frame per loop iteration, which you'll want if each loop pass produces several frames.filename_prefix- the name part, default "frame".
Output: formatted_filename, a STRING built as {prefix}_{number:05d}_.png.
The honest limits. It hardcodes 5 digits and the .png extension, so it's a frame/dataset naming node rather than a general file formatter - need a different extension or a longer pad? Grab one of the generic string-format utilities that are everywhere instead. But within its niche it's dead simple, and paired with the pack's counter and batch loader it gives you a mini batch-processing loop with zero scripting: counter advances → filename formats → loader grabs the next image → saver writes the next frame, all the way through the folder.
Install. ComfyUI Manager → search comfyui_AcademiaSD → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/AcademiaSD/comfyui_AcademiaSD. No extra Python dependencies for this one. It ships in a small single-creator pack (the Academia SD channel) - modest community footprint, so GitHub issues are where fixes land.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_count | INT | 0 | — |
| multiplier | INT | 1 | — |
| filename_prefix | STRING | frame | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| formatted_filename | STRING | — |