Nodes/Kraken Tools/πŸ™ Kraken Preset From Image
ComfyUI Node

πŸ™ Kraken Preset From Image

Turn any image into a resolution preset for your upscale chain

By krakenunboundΒ·Created 8 months agoΒ·Updated 8 months agoΒ· 2
πŸ™ Kraken Preset From Image
  • image
  • preset_out
β—„modefactorβ–Ί
β—„factor2.00β–Ί
β—„target_long_side2048β–Ί
β—„target_short_side1024β–Ί
β—„target_megapixels4.0β–Ί
β—„align_multiple8β–Ί
β—„max_width0β–Ί
β—„max_height0β–Ί

Upscaling has a planning problem: you look at an image and you have to decide the target - how big should the final output be, in what ratio, and should it be a multiple of 8? Most upscale workflows make you type that answer by hand and keep it in sync with the rest of the graph. πŸ™ Kraken Preset From Image is the Kraken Tools node that derives the target for you: it reads an image's dimensions, applies a sizing rule you pick, and emits the result as a "WxH" string that the rest of the pack's upscale chain accepts directly.

It's part of Kraken Tools (krakenunbound/comfyui-kraken-tools), and it's the "read the source, compute the target" node in the pack's resolution family. Where Kraken Empty Latent Image computes a canvas from a desired ratio and megapixel budget, this one computes a target from an actual image - the classic "I want this photo to come out at 2x" workflow.

How it works

Everything is driven by the mode dropdown plus one number:

  • factor - multiply the image by a scale factor (factor, default 2). A 1024x1024 source becomes a 2048x2048 target. The most common mode, and the least surprising.
  • long_side - set the longest edge to target_long_side (default 2048) and keep the ratio. Use this when you want "everything comes out with a 2048 long edge" regardless of source size.
  • short_side - same idea on the short edge via target_short_side.
  • megapixels - hit a total pixel budget (target_megapixels, default 4.0), again keeping ratio. This is the "I want a 4MP image" mode, handy for hitting print-ish resolutions.

After the rule computes a size, the node does two cleanup passes:

  • align_multiple (default 8) rounds the dimensions down to a multiple of 8. That's the classic model-friendly alignment - latent encoding and most upscale networks expect divisible sizes, and a 2053px target would have quietly broken downstream. Bump it to 16 or 64 for video/VAN pipelines that want stricter alignment.
  • max_width / max_height (default 0 = off) clamp the result. Set them if you want to cap the output - "2x, but never bigger than 2048" - which is the polite way to use this node when you don't actually have the VRAM for a 6x of a 4K photo.

Outputs

Exactly one, and that's the point:

  • preset_out (STRING) - the target as "2048x1536". It's designed to plug into the rest of the Kraken pack: Kraken Resolution Helper and Kraken Upscale & Tile Calc accept these strings and convert them into actual upscale parameters for Ultimate SD Upscale. Because the string is the contract, you can also drop it into any text input that expects a "WxH" resolution.

The typical chain: load image β†’ Kraken Preset From Image (factor 2, align 8) β†’ Kraken Upscale & Tile Calc β†’ Ultimate SD Upscale β†’ Kraken Resolution Helper β†’ Kraken Image Processor β†’ Save. The preset string is what keeps every stage agreeing on the target without you typing a number twice.

Install

Standard pack 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 models, no special deps - it reads tensor shape and does arithmetic.

Where people get burned

  • Alignment rounds down, silently. A computed 2053 becomes 2048. Usually fine; sometimes the loss of ~5px annoys you if you're matching a specific canvas. Read the output string before blaming the node.
  • max_width / max_height use 0 = off. Forget that and leave them at their defaults (0) and you're fine; set one to 1024 and the other to 0 and you get a lopsided clamp. Set both or neither.
  • megapixels mode keeps ratio, so it's not a literal megapixel box. A 4MP target in 16:9 and a 4MP target in 1:1 are different width/height pairs with the same total. That's the feature; it just surprises people who expected exact 4000x1000-style math.
  • It's a target, not an upscaler. This node outputs a string. Nothing here actually enlarges the image - if you wire preset_out to a Save node you'll save a number. The enlargement happens downstream in USDU or whatever upscaler reads the string.

The upscaling-planning part of a workflow is where beginners get lost and veterans get sloppy. This node formalizes the math into one string, and once you're feeding that string into the rest of the pack, you'll wonder how you survived retyping resolutions into four different nodes.

CategoryπŸ¦‘ Kraken Tools/Upscaling

Inputs (9)

NameTypeDefaultDescription
imageIMAGEβ€”
modeCOMBOfactor4 options: factor, long_side, short_side, megapixels
factorFLOAT2.001–16β€”
target_long_sideINT204864–65536β€”
target_short_sideINT102464–65536β€”
target_megapixelsFLOAT4.00.1–4096β€”
align_multipleINT81–256β€”
max_widthINT00–65536β€”
max_heightINT00–65536β€”

Outputs (1)

NameTypeDescription
preset_outSTRINGβ€”