Multi Crop
A ComfyUI node in Zuellni/Multi with 5 inputs and 3 outputs.
- images
- latents
- masks
- IMAGES
- LATENTS
- MASKS
Half the time you fight with a batch in ComfyUI, it's because images, latents, and masks refuse to be the same size. Multi Crop is the "make everything exactly this size" node - it center-crops (or pads) images, latents, and masks to the width and height you specify, all in one pass, keeping the batch aligned. It's the first node of the pack's "Multi" family, which exists for one reason: ComfyUI has separate upscale/crop nodes per tensor type, and this pack thinks that's busywork.
What it is
Give it a target width and height (8–8192, step 8, default 512×512) and connect whatever combination of images, latents, and masks you have. It returns the same three socket types, all cropped to your target. Connect one, two, or all three - unconnected inputs just come back untouched. That's the whole API, and it's the whole point: one node, every tensor type, matching sizes.
How the cropping works
The mechanism is center_crop from torchvision, applied per type with the right units:
- Images and masks get center-cropped to
height/widthdirectly (snapped to multiples of 8). - Latents get center-cropped to
height/8bywidth/8- because a latent is a downscaled representation, and cropping it by the full pixel size would over-crop. The 8× factor keeps the latent crop consistent with the image crop.
And "crops" is doing double duty: torchvision's center_crop pads with zeros when your target is bigger than the source. So the same node either trims or extends, depending on which way your sizes are mismatched. The README calls it "crops/pads," and it's accurate - one node handles both directions.
Why you'd reach for it
The most common case is before a sampler or an img2img pass that demands a fixed resolution: you generated a batch at 512×512, you want everything at 640×640, and rather than wiring three different core nodes for images and latents, one Multi Crop does it. It also shines for standardizing batches from Image Batch - if your folder's images came in at inconsistent sizes (that node already normalizes them, but still), crop to a uniform size before feeding anything resolution-sensitive.
The zero-padding behavior is the one thing to keep in mind: if you crop up, the excess is black (zero) padding, which can introduce black borders into your generation. For image work that's usually fine after a sampler pass; for latents, padding up with zeros is the standard approach anyway.
Install
Part of Zuellni/ComfyUI-Custom-Nodes. Via ComfyUI Manager (search "Zuellni") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Zuellni/ComfyUI-Custom-Nodes
No extra dependencies beyond torch and torchvision, both of which ComfyUI ships. No model downloads, nothing to configure on first run. The pack is archived, but this node is a thin wrapper over stable torchvision functions - it'll keep working indefinitely.
If you're already on core ComfyUI and want this without the pack, the behavior is easy to replicate with ImageCrop + LatentCrop + MaskCrop - but that's three nodes and three clicks where this is one. That's the whole pitch.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5128–8192 | — |
| height | INT | 5128–8192 | — |
| imagesopt | IMAGE | — | |
| latentsopt | LATENT | — | |
| masksopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGES | IMAGE | — |
| LATENTS | LATENT | — |
| MASKS | MASK | — |