Nodes/ComfyUI Ino Nodes/Ino Resize Crop Image
ComfyUI Node

Ino Resize Crop Image

Cover a target box and crop to it — for when you need exact W×H, not just 'smaller'

By nobandegani·Created about a year ago·Updated 2 months ago· 6
Ino Resize Crop Image
  • image
  • image
width512
height512
crop_positioncenter
interpolationlanczos

Sometimes "fit the longer side" isn't good enough. When you need every image to come out exactly 1024×1024 - for a batch tensor, a video model's fixed resolution, or a dataset - aspect-ratio-preserving resize won't cut it. Ino Resize Crop Image is the answer: it scales the image up to cover your target width and height, then crops it down to the exact box at a position you choose. The description says it all: "Resizes an image to cover the target width/height, then crops to the exact size at the selected position."

That "cover, then crop" order is the key difference from plain resize. It guarantees the output is always precisely width×height, and it never stretches - anything that doesn't fit the box gets cut off instead.

How it works

It computes the scale needed so the image fully covers the target box (the larger of width-scale and height-scale), resizes with your chosen interpolation, then slices out the exact target region. Where it slices from is your call: the crop_position combo offers the full 3×3 grid - top/center/bottom across left/center/right. Center is the default and usually right; top-left is handy when your subject is at the top of a portrait; bottom-center when it's a person's head that must stay in frame.

The inputs that matter

  • image - the IMAGE tensor.
  • width / height - the exact output dimensions (default 512, up to 16384).
  • crop_position - the nine-position grid for where to crop.
  • interpolation - lanczos (default, sharpest for downsizing), bicubic, bilinear, area, or nearest-exact.

Output: image - exactly width×height.

Where it wires in

Any place that demands a fixed resolution: normalizing a batch before it hits a sampler, prepping frames for video models with hard resolution requirements, building dataset inputs, or matching a ControlNet preprocessor's expected size. It's the complement to InoImageResizeByLongerSideV1: that node keeps every pixel, this one guarantees the box.

Installing it

Part of ComfyUI-InoNodes. ComfyUI Manager → search "ComfyUI Ino Nodes" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/ComfyUI-InoNodes
cd comfyui_ino_nodes
pip install -r requirements.txt

Restart after. No keys, no models.

Common issues

Two things to keep in mind. First, cover-and-crop discards pixels - a 2:1 landscape forced to a 1:1 square loses ~half the image. If the subject is centered you're fine; if it's off to one side, that's what crop_position is for. Second, the output is a straight resize, not a generative upscale: stretching a tiny image to 16384 will look soft, and the KB's upscaling notes apply - for real detail you'd resize-then-upscale with a model, not ask a crop node to invent detail. For the common "make everything exactly this size" job, though, this is the right tool.

CategoryInoImageHelper

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
widthINT5121–16384
heightINT5121–16384
crop_positionCOMBOcenter9 options: top-left, top-center, top-right, center-left, center, center-right, +3
interpolationCOMBOlanczos5 options: lanczos, bicubic, bilinear, area, nearest-exact

Outputs (1)

NameTypeDescription
imageIMAGE