Nodes/ComfyUI-Rennart/✂️ Rennart Image Crop
ComfyUI Node

✂️ Rennart Image Crop

Center-crop to any multiple — the latent-compatibility fixer

By Rennart2025·Created 4 days ago·Updated 4 days ago· 2
✂️ Rennart Image Crop
  • image
  • image
  • width
  • height
  • longest_side
  • shortest_side
multiple16

Rennart Image Crop is the quiet workhorse of the ComfyUI-Rennart pack: it takes an image and center-crops it so both dimensions are exact multiples of a number you choose. Default is 16, which matters because so much of the SD ecosystem - VAE latents, most model architectures, and a lot of samplers - wants image dimensions divisible by 8 or 16. Feed this node a 1003×721 photo from a random source and out comes a clean 992×720, cropped symmetrically from the center, with no black bars and no resampling.

This is a "fix your inputs" node rather than a "make art" node. It belongs right after a Load Image, before anything that's picky about dimensions, or anywhere you've had an image silently fail to encode because its size didn't divide cleanly.

How it works

The mechanism couldn't be simpler, and it's fully deterministic. It reads the image's height and width, floors each to the nearest multiple of multiple (new_width = (width // multiple) * multiple), then crops symmetrically from the center: left = (width - new_width) // 2, same for top. The cropped tensor comes out with the new dimensions, and you get them back as outputs.

That's also the honest tradeoff to internalize: cropping from the center means you lose pixels on all four sides equally. For a typical photo that's fine - you lose a sliver. For a composition with a subject right at the edge, center-cropping can clip it, and unlike an aspect-ratio crop node this one has no offset controls. You get centered, or you don't use it.

The inputs that matter

  • image - any IMAGE tensor.
  • multiple - the divisibility target, 1–512, default 16. Set 8 for the strict minimum most models need, 16 to be safe with standard VAE behavior, or 64/128 if you're aligning to a specific model's latent size.

Outputs: the cropped image, plus width, height, longest_side, and shortest_side as INTs. The dimension outputs are the sleeper value here - you can wire width and height straight into an Empty Latent or an image-size consumer downstream, guaranteeing the rest of the graph uses the cropped dimensions rather than the original ones.

Install and gotchas

Part of ComfyUI-Rennart, one install:

# ComfyUI Manager: search "ComfyUI-Rennart", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Rennart2025/ComfyUI-Rennart

Restart ComfyUI; it's under Rennart/Image. No models, deps are just torch/numpy.

The one real footgun is expectation-setting: if your image is already an exact multiple of multiple, the node is a pure passthrough - same pixels out, which is correct but might make you think it's broken if you were expecting a visible change. And remember there's no upscaling here; if your image is smaller than the model's minimum, cropping to a multiple won't make it bigger, it'll just make it compatible. For everything else - off-by-a-few-pixel dimensions from web downloads, awkward sizes from other nodes - this is the fastest fix in the pack.

CategoryRennart/Image

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
multipleINT161–512

Outputs (5)

NameTypeDescription
imageIMAGE
widthINT
heightINT
longest_sideINT
shortest_sideINT