Nodes/ComfyUI-Fossiel-QoL-Nodes/Resolution Wrangler
ComfyUI Node

Resolution Wrangler

The Resolution Calculator That Hates Fractional Pixels

By Fossiel·Created 10 months ago·Updated 5 months ago· 1
Resolution Wrangler
  • image
  • mask
  • Aspect_Image
  • Aspect_RGBA
  • Aspect_Mask
  • Resized_Image
  • Resized_RGBA
  • Resized_Mask
  • Aspect_X
  • Aspect_Y
  • Aspect_Image_X
  • Aspect_Image_Y
  • Resized_Image_X
  • Resized_Image_Y
Aspect_methodAutomatic
Aspect_X4
Aspect_Y3
Crop_positionCenter
Resize_byMax Resolution
Max_Resolution_X1024
Max_Resolution_Y1024
Ratio100.00
Aspect_tolerance8
Resizing_methodlanczos

Every ComfyUI user has done this dance: your source image is 1537×861, your VAE wants clean multiples of 8, your video model wants a tidy 16:9, and you're sitting in a resize node with a calculator open. Resolution Wrangler automates the whole ritual - it finds the closest clean aspect ratio, crops to fill it, and resizes to the largest VAE-safe size within your pixel budget. No fractional scaling, no aspect drift, no wasted VRAM on a resolution the model will quietly mangle.

The name is accurate. This thing is a wrangler.

How it works

Three stages, and the source shows each one:

  1. Find the ratio. In Automatic mode it takes your input image's dimensions and runs a continued-fraction reduction to find the closest clean integer aspect ratio (so 1537×861 → a nice round 16:9 instead of 1.785:1). In Manual mode you supply Aspect_X and Aspect_Y directly.
  2. Crop to fill. It expands the image to the target aspect and crops, with Crop_position choosing where the crop sits - nine combinations of left/center/right × top/center/bottom, so a face hugging the left edge doesn't get chopped when you go to 16:9.
  3. Resize to the budget. Resize_by controls the math: Max Resolution treats Max_Resolution_X × Max_Resolution_Y as a hard pixel cap; Ratio scales by a percentage of the cropped size; and a Max Resolution x Ratio mode (added in the Feb 2026 update) combines both. The final dimensions stay exactly on the aspect ratio, divide cleanly by Aspect_tolerance (8 or 16), and Resizing_method picks the interpolation (lanczos default, or bicubic/bilinear/nearest-exact).

If you're on a mid-range GPU, this is the node that answers "what's the biggest 16:9 video batch my card can actually chew on" without trial and error - it returns the maximum clean resolution under your cap every single time.

Inputs and outputs

The inputs are mostly the knobs above. Two things worth calling out: there's an optional mask input (ComfyUI convention: 0 = keep, 1 = masked), and it's carried through every stage - so you can crop and resize an inpaint mask in lockstep with the image. The outputs are generous: Aspect_Image, Aspect_RGBA, and Aspect_Mask (pre-resize, at the target aspect), then Resized_Image, Resized_RGBA, Resized_Mask (final), plus the resolved numbers - Aspect_X, Aspect_Y, Aspect_Image_X/Y, and Resized_Image_X/Y - so the rest of your graph can read exactly what it got.

Wire the Resized_Image into a VAE Encode and your latent is guaranteed clean.

Installing it

Manager search "ComfyUI-Fossiel-QoL-Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Fossiel/ComfyUI-Fossiel-QoL-Nodes
pip install -r ComfyUI-Fossiel-QoL-Nodes/requirements.txt

Restart, find it under utils. Pure image math - no downloads.

Honest caveats

The changelog shows it's young (added Feb 2026) and has already been patched twice - a null mask error and a 1-to-1 resize bug. So keep the pack updated, and if a mask run misbehaves, update first. The image input is required for normal operation even though it's technically optional in the schema. And a fair warning: "Automatic" ratio detection is clever but it's still a heuristic - for a deliberate 21:9 or 1:1 output, use Manual mode and stop guessing.

Categoryutils

Inputs (12)

NameTypeDefaultDescription
Aspect_methodCOMBOAutomatic2 options: Automatic, Manual
Aspect_XINT41–9999
Aspect_YINT31–9999
Crop_positionCOMBOCenter9 options: Left and Top, Left and Y-Center, Left and Bottom, X-Center and Top, Center, X-Center and Bottom, +3
Resize_byCOMBOMax Resolution2 options: Max Resolution, Ratio
Max_Resolution_XINT102464–16384
Max_Resolution_YINT102464–16384
RatioFLOAT100.000.1–10000
Aspect_toleranceCOMBO82 options: 8, 16
Resizing_methodCOMBOlanczos4 options: nearest-exact, bilinear, bicubic, lanczos
imageoptIMAGE
maskoptMASK

Outputs (12)

NameTypeDescription
Aspect_ImageIMAGE
Aspect_RGBAIMAGE
Aspect_MaskMASK
Resized_ImageIMAGE
Resized_RGBAIMAGE
Resized_MaskMASK
Aspect_XINT
Aspect_YINT
Aspect_Image_XINT
Aspect_Image_YINT
Resized_Image_XINT
Resized_Image_YINT