Nodes/was-node-suite-comfyui/Integer place counter
ComfyUI Node Runs on cloud

Integer place counter

Pad a number with leading zeros for filenames

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Integer place counter

      An honest flag before anything else: this node doesn't appear in WAS's own README node list, and I found no community discussion that pins down its exact behavior - the name itself is what I'm working from here. "Place counter" is the standard way to describe padding a number out to a fixed number of digit places, and that's the most reasonable read of what this node does: turn a plain integer like 7 into a fixed-width string like 007.

      Why zero-padding matters

      If you've ever saved a batch of frames or images without padding and watched your file browser sort them as 1, 10, 11, 12, ..., 2, 20, 21, ... instead of numeric order, you've hit the exact problem this kind of node exists to prevent. Lexicographic (alphabetical) sorting doesn't know 10 comes after 9 unless every number has the same number of digits - pad everything to, say, three places and 007 sorts correctly before 010 and 100 sorts correctly after both. It's a small, unglamorous fix for a very common annoyance in any workflow that outputs a numbered sequence.

      Where you'd use it

      Anywhere a number needs to become part of a filename or a piece of text and you care about it sorting or displaying consistently: batch render frame numbers, versioned output filenames, or a counter value (from WAS's own Number Counter node, most naturally) formatted for a Save Text File or Save Image token rather than dropped in raw.

      The inputs and outputs that matter

      An integer in, a target number of digit places, and a zero-padded string/text out that you'd wire into a filename token or a text-concatenation node. I want to be direct that I can't confirm these field names from a schema - this description is my best-grounded inference from the node's name and its obvious purpose, not a verified spec. Drop it on the canvas and check its actual widgets before relying on this write-up for exact behavior.

      How to install it

      Bundled with the full WAS Node Suite:

      • ComfyUI Manager - search "WAS Node Suite", install, restart.
      • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui, install requirements.txt (portable: python_embeded\python.exe -s -m pip install -r requirements.txt), restart.

      No model, no heavy dependency - a plain text/number utility.

      Common issues & troubleshooting

      Numbers overflow your configured padding. If your batch runs past the digit count you set (three places handles up to 999, but not 1000+), most implementations of this pattern either let the extra digit show anyway or truncate it - worth testing at your actual expected maximum count before trusting it across a long unattended batch run, rather than discovering the wraparound partway through.

      Beyond that, the standing pack caveat: WAS Node Suite has been unmaintained since December 2023, and the recurring complaint since is the whole suite failing to import after a ComfyUI update - a pinned dependency clash, not a plain number-formatting node like this one. If the whole suite throws "Import Failed," reinstall requirements.txt against your actual ComfyUI Python before troubleshooting a single node in isolation.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs