Nodes/ComfyUI/Crop Image (Center)
ComfyUI Node Runs on cloud

Crop Image (Center)

The boring, reliable way to square up a batch

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,964
Crop Image (Center)
  • images
  • images
width512
height512

Some nodes are glamorous. This one isn't, and that's fine - it's the node you reach for when every image in a batch needs to be the same size and you'd rather lose the edges than the subject. It crops from the middle out, which is the least-bad default when you have no idea what's important in the frame.

It's part of the newer generation of built-in image/transform nodes - core ComfyUI, nothing to install, though it's marked experimental and still finding its way into shared workflows.

How it works

You give it width and height (default 512 each). It works out the box of that size centered on the image, then crops. A 1920×1080 image at 512×512 gives you the exact middle 512 pixels - 704px shaved off the left and right, 284 off the top and bottom. If your requested crop is bigger than the image, it clamps to the image bounds rather than erroring, so you can't ask for something impossible.

Because it's batch-aware, a whole stack of frames gets the same center-crop treatment per frame - handy if you're normalizing video frames or a mixed batch of stills before some downstream step.

Inputs and output

Just three things: images, width, height. Output is the cropped images batch. There's no x/y, no feathering, no alignment knob. That's the entire appeal - a beginner can set it up blind.

What it's actually for

  • Batch normalization. Every image in a stack comes out exactly width×height, from the center. Feeding a model that wants uniform inputs, or building a comparison grid, this beats hand-cropping each one.
  • Training-data prep. Center crops are a classic augmentation/standardization move - every sample the same size, no aspect weirdness for the model to learn.
  • Removing distractors at the edges - photobombing, borders, UI chrome - when you trust the middle of the frame more than the edges.

It's also the "dumb sibling" of ImageCrop (the classic crop node), which lets you type explicit x/y coordinates. Center crop is for when you don't have coordinates and don't want to think.

Where it bites

The trade is obvious and it's the whole node: you are throwing away edges. If your subject isn't centered - a face at the side of a group shot, a product leaning left - the center crop cuts it off. There's no "look at the actual content" logic here; it crops geometry, not semantics.

Second, it doesn't upscale. Ask for 1024×1024 from a 512×512 and you get the whole image (clamped), not a blown-up version. If you need the output to fill the target exactly, chain a resize after it.

Third, remember the latent rule that bites every crop and resize node: if the output feeds a sampler, keep width/height on multiples of 8 (64 for video VAEs), or the encode step crops your canvas again and your careful crop shifts.

Boring, predictable, hard to misuse. Sometimes that's exactly the node you want.

Categoryimage/transform

Inputs (3)

NameTypeDefaultDescription
imagesIMAGEImage to process.
widthINT5121–8192Crop width.
heightINT5121–8192Crop height.

Outputs (1)

NameTypeDescription
imagesIMAGEProcessed images