🦑 Kraken Resolution Helper (Exact)
Your Upscaled Image Is Never the Right Size — This Node Makes It Exact
- image
- image
- size
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, butanchor_x/anchor_ylet you pin the image to top-left, bottom-right, wherever.fill / crop- scale to cover the target, then crop the overflow.anchor_x/anchor_ydecide what you keep;crop_margin_pxenlarges 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 proportionorpadon an image whose aspect doesn't match the target. That's the mode working as designed - switch tofill / cropif you want the whole canvas covered. - "It didn't get bigger!"
allow_upscale=Falseis 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."
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mode | COMBO | keep proportion | 4 options: fill / crop, pad, keep proportion, stretch |
| interpolation | COMBO | lanczos | 4 options: lanczos, bicubic, bilinear, nearest |
| allow_upscale | BOOLEAN | false | — |
| preset_in | STRING | — | |
| target_resolution_inopt | STRING | — | |
| widthopt | INT | 10241–8192 | — |
| heightopt | INT | 10241–8192 | — |
| anchor_xopt | COMBO | center | 3 options: left, center, right |
| anchor_yopt | COMBO | center | 3 options: top, center, bottom |
| crop_margin_pxopt | INT | 320–512 | — |
| scale_stepopt | FLOAT | 0.0100.001–0.25 | — |
| multiple_ofopt | INT | 00–128 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| size | STRING | — |