ComfyUI Node

HT Resolution

Stop guessing output resolutions — HT Resolution does the math for you

By ArtHommage·Created 2 years ago·Updated about a year ago· 4
HT Resolution
  • image
  • width
  • height
  • scale_factor
  • crop_pad_values
  • info
  • pad_left_right
  • pad_top_bottom
width512
height512
priority_modeauto_decide
use_standard_listtrue
modecrop
custom_resolutions

Feeding the wrong resolution into a sampler is a classic way to waste a generation. Maybe it's an aspect ratio that squashes your subject, or a width that isn't a clean multiple of 64 so the latent comes out oddly, or you just stare at 1024×1024 knowing your image is actually portrait and neither option is right. HT Resolution (from the HommageTools pack) exists to take that guesswork out: give it your source dimensions, and it scores a list of standard resolutions against them and hands back the best match.

What it does

This is a "recommender" node, not a resize node. You give it a width and height (or just wire in an image and it reads the dimensions off the tensor), and it compares your aspect ratio against a built-in list of standard sizes - squares like 512/768/1024/1408, plus 16:9 landscape and portrait variants. Each candidate gets scored on three things: how well its aspect ratio preserves yours, how many pixels you lose, and how far you have to scale. The winner comes out the width and height outputs.

The scoring is steered by priority_mode:

  • minimize_loss - weights pixel loss heavily. Best when you want to keep as much of the image as possible and don't care about scaling up a bit.
  • minimize_noise - weights the scale factor instead. Good when upscaling would visibly soften detail and you'd rather crop to a native-ish size.
  • auto_decide - the default, a balanced middle ground. Start here.

mode (crop vs pad) changes what the "fit" looks like. crop picks the size the image fits into, so something gets cut; pad sizes so everything fits and the leftover gets padding - which is why the node also spits out pad_left_right and pad_top_bottom, plus a crop_pad_values string you can feed straight into a pad/crop node.

The inputs that actually matter

  • width / height - your source (or leave them and wire image in instead).
  • priority_mode and mode - the two knobs that change the answer. Flip these to see the tradeoff before you commit.
  • use_standard_list - includes the built-in resolution list. Turn it off if you're only using custom_resolutions.
  • custom_resolutions - one WxH per line (e.g. 832x1216). These get added to the candidates, which is handy when you're targeting a checkpoint's preferred range.

Outputs worth wiring: width/height into an Empty Latent or latent-size node, scale_factor into a scale node, and the pad outputs into whatever padding node your workflow uses. info is a human-readable explanation of the pick - glance at it once and you'll understand the tradeoff it made.

Installing it

This ships in HommageTools, so install the pack once. Easiest is ComfyUI Manager → search "HommageTools". Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ArtHommage/HommageTools.git
cd HommageTools
pip install -r requirements.txt

Restart ComfyUI. The utility nodes themselves need no model downloads - the requirements are just numpy, torch, Pillow, and friends. One honest caveat: the pack's own README calls it "perpetually in alpha" and not for production, so don't bet a mission-critical pipeline on it. For a resolution picker that's fine - worst case you ignore its answer.

Common issues

The big trap is forgetting the divisibility part. This node recommends a resolution that's close to your aspect ratio, but if you're on SDXL or similar you still want a multiple of 64 (or 8 at minimum) for the latent to behave. Feed the recommended width/height through a snap-to-multiple node if your model needs it. Also: when you type custom resolutions, get the format right (WxH, newline-separated) - the node silently ignores malformed entries and falls back to the default list, so check info if the output looks wrong.

CategoryHommageTools

Inputs (7)

NameTypeDefaultDescription
widthINT51264–8192
heightINT51264–8192
priority_modeCOMBOauto_decide3 options: minimize_loss, minimize_noise, auto_decide
use_standard_listBOOLEANtrue
modeCOMBOcrop2 options: crop, pad
imageoptIMAGE
custom_resolutionsoptSTRING

Outputs (7)

NameTypeDescription
widthINT
heightINT
scale_factorFLOAT
crop_pad_valuesSTRING
infoSTRING
pad_left_rightINT
pad_top_bottomINT