Resolution Wrangler
The Resolution Calculator That Hates Fractional Pixels
- 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
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:
- Find the ratio. In
Automaticmode 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). InManualmode you supplyAspect_XandAspect_Ydirectly. - Crop to fill. It expands the image to the target aspect and crops, with
Crop_positionchoosing 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. - Resize to the budget.
Resize_bycontrols the math:Max ResolutiontreatsMax_Resolution_X × Max_Resolution_Yas a hard pixel cap;Ratioscales by a percentage of the cropped size; and aMax Resolution x Ratiomode (added in the Feb 2026 update) combines both. The final dimensions stay exactly on the aspect ratio, divide cleanly byAspect_tolerance(8 or 16), andResizing_methodpicks the interpolation (lanczosdefault, 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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| Aspect_method | COMBO | Automatic | 2 options: Automatic, Manual |
| Aspect_X | INT | 41–9999 | — |
| Aspect_Y | INT | 31–9999 | — |
| Crop_position | COMBO | Center | 9 options: Left and Top, Left and Y-Center, Left and Bottom, X-Center and Top, Center, X-Center and Bottom, +3 |
| Resize_by | COMBO | Max Resolution | 2 options: Max Resolution, Ratio |
| Max_Resolution_X | INT | 102464–16384 | — |
| Max_Resolution_Y | INT | 102464–16384 | — |
| Ratio | FLOAT | 100.000.1–10000 | — |
| Aspect_tolerance | COMBO | 8 | 2 options: 8, 16 |
| Resizing_method | COMBO | lanczos | 4 options: nearest-exact, bilinear, bicubic, lanczos |
| imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (12)
| Name | Type | Description |
|---|---|---|
| Aspect_Image | IMAGE | — |
| Aspect_RGBA | IMAGE | — |
| Aspect_Mask | MASK | — |
| Resized_Image | IMAGE | — |
| Resized_RGBA | IMAGE | — |
| Resized_Mask | MASK | — |
| Aspect_X | INT | — |
| Aspect_Y | INT | — |
| Aspect_Image_X | INT | — |
| Aspect_Image_Y | INT | — |
| Resized_Image_X | INT | — |
| Resized_Image_Y | INT | — |