Nodes/ComfyUI-ArchiGraph/Image Resize To πŸ¦β€πŸ”₯
ComfyUI Node

Image Resize To πŸ¦β€πŸ”₯

Size your images by the long edge, not the square

By vincentfsΒ·Created 2 years agoΒ·Updated 8 months agoΒ· 3
Image Resize To πŸ¦β€πŸ”₯
  • image
  • IMAGE
  • prev_width
  • prev_height
  • log
β—„target_size720Pβ–Ί
β—„bbox_edge11024β–Ί
β—„bbox_edge21024β–Ί
β—„upscale_methodβ–Ύβ–Ί
β—„onlyEnlargetrueβ–Ί

Most resizing nodes in ComfyUI make you pick a fixed width and height, which means you're deciding the aspect ratio too - often by accident, and always by squishing. This node takes the opposite approach: you tell it a target scale tier or two edge sizes, and it computes the other dimension automatically so the proportion is preserved. It's the "resize to 1080p" node, not the "resize to 1920Γ—1080 even if that distorts" node.

How the presets work

The target_size dropdown offers 720P, 1080P, 2K, 4K, or custom. The presets aren't random - they're built around a 16:9 reference (720Γ—1280, then scaled Γ—1.5, Γ—2, Γ—3), but the node then fits your image's own aspect ratio inside that box: whichever edge is longer drives the scale, and the short edge follows. A square image resized to "1080P" gets 1920Γ—1920-ish behavior via the long-edge rule, not a forced 16:9 crop. That's the "proportion is kept by default" promise in the description.

Choose custom and the bbox_edge1 / bbox_edge2 inputs wake up - you specify two edge sizes (16–8192) and the orientation is picked automatically, with the same fit-inside-bounding-box logic. You don't have to say "which is the long edge"; it figures that out.

The other inputs that matter

  • upscale_method: lanczos / nearest-exact / bilinear / area / bicubic. For upscaling, lanczos is the sharp default; area is notably good when downscaling. This is the same family of choices the core ComfyUI upscale nodes offer, because it calls ComfyUI's own common_upscale under the hood.
  • onlyEnlarge (default true): the safety toggle. On (default), images larger than the target are left untouched - it will only ever upscale, never downscale. Turn it off if you genuinely want everything forced to the target size. This is the input that stops a batch job from shrinking your 4K masters by accident.

Outputs

Four of them, and the last two are the sleeper features: IMAGE (resized), prev_width / prev_height (the original dimensions, useful for logging or for a later restore), and log (a STRING that tells you whether it resized or skipped, and from what to what). In a batch pipeline, feeding that log into a print/save node gives you a free run log of what each image became.

Install

ComfyUI Manager β†’ search ComfyUI-ArchiGraph, or:

cd ComfyUI/custom_nodes
git clone https://github.com/vincentfs/ComfyUI-ArchiGraph

Restart and run the pack's install script once. This node is pure torch/ComfyUI utilities - no OpenCV needed.

Gotchas

  • Presets are 16:9-referenced. If you feed it an extreme panorama, "720P" won't give you a "720p video" frame - it gives a 720-long-edge image with your own ratio. Read it as a scale tier, not a literal resolution.
  • onlyEnlarge defaults on. If your resizes "aren't working," that's usually why - the image was already bigger than the target.
  • It upscales via common_upscale, which is a one-shot resample, not an AI upscaler. It'll make images bigger; it won't invent detail. For that you'd chain a real upscale model - this node is the geometry step.

The resize node you want when "keep my aspect ratio, make it 2K" is the whole requirement. Set the tier, leave onlyEnlarge on, done.

CategoryπŸ¦β€πŸ”₯ ArchiGraph/πŸ“· PhotoEdit

Inputs (6)

NameTypeDefaultDescription
imageIMAGEβ€”
target_sizeCOMBO720PPreset target sizes. Select 'custom' to specify edge size manually.
bbox_edge1INT102416–8192Only valid for custom target type. Edge size for the boundingbox. Orientation will be calculated automatically.
bbox_edge2INT102416–8192Only valid for custom target type. Edge size for the boundingbox. Orientation will be calculated automatically.
upscale_methodCOMBO5 options: lanczos, nearest-exact, bilinear, area, bicubic
onlyEnlargeBOOLEANtrueIf true, only enlarge images. Large images will be kept at original size.

Outputs (4)

NameTypeDescription
IMAGEIMAGEβ€”
prev_widthINTβ€”
prev_heightINTβ€”
logSTRINGβ€”