Nodes/ComfyUI illumorae/Image Resize Flux Kontext Scale Options
ComfyUI Node

Image Resize Flux Kontext Scale Options

The Flux Kontext resolution ladder, with a stretch option

By CorvaeOboro·Created 8 months ago·Updated 6 days ago· 1
Image Resize Flux Kontext Scale Options
  • image
  • IMAGE
resize_modecrop
interpolationlanczos
crop_anchorcenter

Flux Kontext (and its cousins in the Flux editing family) is picky about input resolution in a specific, documented way: it's trained on a ladder of 17 preferred resolutions, from 672×1568 up to 1568×672, through 1024×1024 in the middle. Feed it a resolution off that ladder and edits come back blurry, misaligned, or subtly wrong. ComfyUI's native Image Resize node already has a Kontext preset that snaps you onto that ladder - and Image Resize Flux Kontext Scale Options is a tweaked copy of that node that adds the option the original lacks: stretch instead of always cropping.

That's the whole pitch, and it's a real one. The native node's Kontext mode will happily crop away part of your subject to hit the right ratio. When you're feeding a character or a composed image into Kontext for an edit, cropping is often the wrong trade - you'd rather let the image stretch slightly (or accept it) than lose pixels. This node lets you choose.

How it works

It's a thin wrapper over ComfyUI's own common_upscale, so the mechanism is core ComfyUI with the Kontext resolution table baked in. Given an input image, it computes the aspect ratio and picks the closest entry from the PREFERED_KONTEXT_RESOLUTIONS ladder (all 17 of them - the same ladder BFL publishes), then resizes to those exact dimensions.

Inputs:

  • resize_mode - crop (default; matches native behavior, crops to fit) or stretch (resizes to the exact target, letting aspect ratio distort - ignore crop_anchor in this mode).
  • interpolation - lanczos (default, sharp), bilinear, or nearest.
  • crop_anchor - center, top, bottom, left, or right, used when cropping to decide which part of the image survives. If your subject sits at the top of frame and you must crop, anchor top.

Output is a single IMAGE at the snapped resolution. Nothing else - no metadata, no preset name. That's the one thing to know: if you want to know which resolution it picked, you have to look at the output dimensions yourself (or use the WAN adaptive framing node, which reports its choice).

Installing it

Part of CorvaeOboro's ComfyUI_illumorae (CC0, pure code, no models). ComfyUI Manager → search illumorae, or:

cd ComfyUI/custom_nodes
git clone https://github.com/CorvaeOboro/ComfyUI_illumorae

Common issues

  • "Why didn't it give me exactly my target ratio?" - because it snaps to the nearest Kontext resolution, not to whatever you asked. That's the point; don't fight it.
  • Stretch looks squished - of course it does; that's the nature of the trade. Use stretch when preserving full content matters more than proportions, and expect mild distortion on extreme ratio mismatches. For letterboxed padding instead, the pack's Image Resize w Matte is the better tool.
  • Edits still look off even after snapping - Kontext's resolution sensitivity is real but so are its other limits (small subjects, full-body anatomy). Snapping resolution is necessary, not sufficient - see the KB's Flux Kontext notes on anatomy degrading at full-body scale.
Categoryillumorae

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
resize_modeCOMBOcrop2 options: crop, stretch
interpolationCOMBOlanczos3 options: lanczos, bilinear, nearest
crop_anchorCOMBOcenter5 options: center, top, bottom, left, right

Outputs (1)

NameTypeDescription
IMAGEIMAGE