Nodes/Kraken Tools/πŸ™ Kraken Image Resize
ComfyUI Node

πŸ™ Kraken Image Resize

Resize images the way the pipeline needs, without a ladder of scale nodes

By krakenunboundΒ·Created 8 months agoΒ·Updated 8 months agoΒ· 2
πŸ™ Kraken Image Resize
  • image_input
  • image
  • width
  • height
  • info
β—„source_modeuploadβ–Ί
β—„image_uploadβ–Ύβ–Ί
β—„longest_side1024β–Ί
β—„interpolationlanczosβ–Ί
β—„maintain_aspecttrueβ–Ί
β—„resize_modelongest_sideβ–Ί
β—„upscale_smallerfalseβ–Ί
β—„output_formatsameβ–Ί
β—„width_override512β–Ί
β—„height_override512β–Ί
β—„background_color#000000β–Ί

Resizing sounds like it shouldn't need a dedicated node, and then you try to feed a 2:3 reference photo into an SDXL img2img workflow and discover the stock tools only do half the job. πŸ™ Kraken Image Resize is the Kraken Tools answer: one node that covers "shrink to the longest side," "pad to a target with a background color," "stretch to fill," and everything between, with a choice of interpolation and a guarantee that your output dimensions come out as numbers you can wire onward.

It sits in the middle of the pack's upscale chain - resize the source to working size, let Kraken Image Processor clean it, then upscale. And because it's built for pipeline use, it hands you the final width, height, and a text info summary as outputs, so the graph never has to guess what size something ended up at.

How it works

The inputs break into two groups: where the image comes from and what you want done to it.

Source: source_mode = upload (use the file picker) or upstream (accept image_input from a node). In any real workflow you want upstream; the upload option with image_upload is for testing the node standalone.

The sizing logic, which is where this node earns its keep:

  • resize_mode - longest_side (fit the longest edge to longest_side, keep aspect), width, height, fit (contain within both bounds), fill (cover a target, cropping the overflow), or stretch (distort to exact dimensions).
  • longest_side - the anchor number, default 1024, which is the sweet spot for SDXL-scale generation.
  • width_override / height_override - used by fit and fill as the second bound, and by width/height modes as the target.
  • maintain_aspect - on by default; turn it off and stretch/fill stop trying to preserve ratio.
  • upscale_smaller - off by default, which means the node refuses to upscale a small source past its natural size. Flip it on only if you genuinely want a 512px image blown up to 2048 (hint: you don't - let an AI upscaler do that instead).
  • interpolation - lanczos (default; best quality for downscale and mild upscale), bicubic, bilinear, nearest (pixel-art, don't use for photos), area (good for aggressive downscales).
  • background_color - hex like #000000, used by fill when padding to a target.
  • output_format - same (keep the source format), or force PNG/JPEG/WEBP.

Outputs

  • image β†’ the resized batch, straight into your img2img, ControlNet preprocessor, or upscaler.
  • width / height (INT) β†’ the final dimensions, for resolution-aware nodes.
  • info (STRING) β†’ a processing summary ("resized 3024x4032 β†’ 1024x1365, lanczos") you can drop on a text display.

Install

Standard Kraken Tools install. ComfyUI Manager β†’ search "Kraken Tools" β†’ Install β†’ restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/krakenunbound/comfyui-kraken-tools
cd comfyui-kraken-tools
pip install -r requirements.txt

No model files. The resizing is done with Pillow (via the pack's deps), so nothing heavy to download.

Where people get burned

  • stretch is lying to you if you care about ratio. It's the mode you want for exact canvas fill, and the mode that quietly ruins a face otherwise. If a character's head looks wrong after an img2img pass, check whether a stretch resize flattened the source first.
  • upscale_smaller off means no output change. The node isn't broken; it's refusing to upscale. This is a common "it did nothing" moment - read the info output before assuming a bug.
  • longest_side doesn't snap. Unlike the pack's latent node, this one doesn't force dimensions to a multiple. If you're feeding its output into something that wants 8/16-divisible sizes (latent encode, video VAEs), the sizes it hands back may be off by a pixel or two. Pair it with a divisible_by snap if your downstream cares.

The stock ImageScale does one mode and no bookkeeping. If you've ever found yourself stacking three scale nodes and a paste node just to get a padded 1024x1024, this is the node that replaces all four.

CategoryKraken/Image

Inputs (12)

NameTypeDefaultDescription
source_modeCOMBOupload2 options: upload, upstream
image_uploadCOMBO1 options: example.png
longest_sideINT102464–8192β€”
interpolationCOMBOlanczos5 options: lanczos, bicubic, bilinear, nearest, area
maintain_aspectBOOLEANtrueβ€”
resize_modeCOMBOlongest_side6 options: longest_side, width, height, fit, fill, stretch
upscale_smallerBOOLEANfalseβ€”
output_formatCOMBOsame4 options: same, PNG, JPEG, WEBP
image_inputoptIMAGEβ€”
width_overrideoptINT51264–8192β€”
height_overrideoptINT51264–8192β€”
background_coloroptSTRING#000000β€”

Outputs (4)

NameTypeDescription
imageIMAGEβ€”
widthINTβ€”
heightINTβ€”
infoSTRINGβ€”