HT Dimension Formatter
Turn sizes into strings, cleanly
- image
- formatted_dimensions
Naming a file scene_1024x768_4k.png instead of scene_1024 768 4k.png should not require thought - but in ComfyUI, turning two INTs into a formatted string is exactly the kind of thing you end up hand-wiring with awkward string-concat nodes. HT Dimension Formatter, from HommageTools, is the node that does it in one step, and it has one nice trick: it can read the dimensions off the image itself.
What it does
Three inputs:
- width (default 1024) and height (default 1024) - the values to format.
- spacing (default
" ") - the separator character. You can set it tox,_,-, or even×for a display-friendly string.
One optional input: image. Wire an IMAGE in and it overrides the width/height widgets by reading the actual tensor dimensions - so the string always reflects reality, even if the image was resized upstream after you set the widgets.
One output: formatted_dimensions, a STRING built as {width}{spacing}x{spacing}{height}. With default spacing that's 1024 x 768; with _ it's 1024_x_768.
It also pushes the result to the node's own preview in the UI, so you can see the string without wiring it anywhere.
Why you'd use it
File naming is the big one. ComfyUI has several save nodes that accept a filename prefix as a string - chain this node's output into one and every saved image carries its dimensions in the name, which is a godsend when you're producing batches at multiple resolutions and need to tell them apart in a folder.
The secondary use is prompts and metadata: some workflows embed the generation size as a text tag, and having it come from a single formatter keeps the format consistent across the whole pipeline. If you've ever seen 512x512 in some filenames and 512 512 in others, you know the consistency problem this solves.
It's a display/plumbing node, not a processing node - it changes nothing about the image. That's fine; not every node needs to be a sampler.
Installing it
Part of HommageTools. ComfyUI Manager → search HommageTools, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ArtHommage/HommageTools.git
cd HommageTools && pip install -r requirements.txt
Restart ComfyUI; it's in the HommageTools menu.
Small notes
- If the image input fails to parse, it falls back to the widget values instead of erroring - handy, but worth knowing so a silent fallback doesn't mislabel files.
- The
spacinggoes around thexon both sides, so a space produces1024 x 768. If you want the common1024x768compact form, set spacing to an empty string.
It's the smallest of small tools, but file-naming consistency is one of those things that only hurts when it's missing. For one output and zero config, that's a fair trade.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–8192 | — |
| height | INT | 102464–8192 | — |
| spacing | STRING | — | |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| formatted_dimensions | STRING | — |