Nodes/ComfyUI-KrakenTools/🦑 Kraken Resolution Helper (Exact)
ComfyUI Node

🦑 Kraken Resolution Helper (Exact)

Your Upscaled Image Is Never the Right Size — This Node Makes It Exact

By krakenunbound·Created about a year ago·Updated 9 months ago· 3
🦑 Kraken Resolution Helper (Exact)
  • image
  • image
  • size
modekeep proportion
interpolationlanczos
allow_upscalefalse
preset_in
target_resolution_in
width1024
height1024
anchor_xcenter
anchor_ycenter
crop_margin_px32
scale_step0.010
multiple_of0

You ran your upscale loop and now you have a problem in the opposite direction: the image is bigger than you wanted, in the wrong aspect ratio, and it definitely isn't the exact 736×1344 your canvas was supposed to be. The stock resize nodes either crop whatever doesn't fit or leave you with a sloppy dimension. 🦑 Kraken Resolution Helper (Exact) is the finisher: it guarantees the final W×H, and it's built to downscale without cropping, which is the whole trick.

Here's the philosophy this pack runs on: generate small, upscale big with Ultimate SD Upscale, then bring the result back down to your exact target with high-quality filtering. The enlarge pass adds real micro-detail; the downscale pass cleans seams and lands on the exact size. The helper is step three, and it's the node that makes the "exact" part of the plan true.

How it works

You tell it the target - via target_resolution_in or preset_in (a "736 x 1344" string, easily fed from the latent's resolution output or the tile calc's target_resolution) - or just set width/height. Then pick a mode:

  • keep proportion (default) - scale to fit inside the target, pad the rest with black. Centered, never crops.
  • pad - same contain-and-pad idea, but anchor_x/anchor_y let you pin the image to top-left, bottom-right, wherever.
  • fill / crop - scale to cover the target, then crop the overflow. anchor_x/anchor_y decide what you keep; crop_margin_px enlarges the region before cropping so you lose less.
  • stretch - resize to exact dimensions, distortion be damned.

The setting beginners get burned by: allow_upscale (default False). It guarantees the final step never enlarges - if your source is smaller than the target, you get padding, not upscaling. Turn it on only if you genuinely want it to blow the image up in this pass. multiple_of rounds the scaled size up to a grid (handy for model-friendly multiples), and interpolation defaults to lanczos, which is exactly the right default: lanczos adds pixels without inventing content, so the micro-detail your upscale pass earned survives the trip back down.

Inputs and outputs that matter

Realistically you set image, mode, allow_upscale, and feed preset_in or target_resolution_in from upstream. The rest have sane defaults. Outputs are image (now exactly the target size) and a size string like "736 x 1344" you can read or chain elsewhere.

Installing it

With the rest of the pack - ComfyUI Manager (search Kraken Tools) or:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/krakenunbound/ComfyUI-KrakenTools

Restart. No extra dependencies, no model files - this is pure Pillow resize math.

Where people get burned

  • "Why are there black bars?" You picked keep proportion or pad on an image whose aspect doesn't match the target. That's the mode working as designed - switch to fill / crop if you want the whole canvas covered.
  • "It didn't get bigger!" allow_upscale=False is doing its job. If you actually wanted enlargement, flip it.
  • "I cropped more than I expected." crop_margin_px (default 32) adds headroom before cropping; crank it down toward 0 if you want minimal loss, up if you're paranoid about clipping.
  • It's a young, small pack (MIT, late-2025, by "The Kraken") - don't expect a community wiki. The code is a couple of hundred lines of PIL, which is honestly reassuring.

My honest take: if you never do the upscale-big-then-downscale dance, you don't need this node. But if that's your workflow - and for small Flux canvases it's one of the most reliable ways to add detail on a budget - this is the piece that turns "good enough" into "exactly right."

Categorykraken/resize

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
modeCOMBOkeep proportion4 options: fill / crop, pad, keep proportion, stretch
interpolationCOMBOlanczos4 options: lanczos, bicubic, bilinear, nearest
allow_upscaleBOOLEANfalse
preset_inSTRING
target_resolution_inoptSTRING
widthoptINT10241–8192
heightoptINT10241–8192
anchor_xoptCOMBOcenter3 options: left, center, right
anchor_yoptCOMBOcenter3 options: top, center, bottom
crop_margin_pxoptINT320–512
scale_stepoptFLOAT0.0100.001–0.25
multiple_ofoptINT00–128

Outputs (2)

NameTypeDescription
imageIMAGE
sizeSTRING