Image Crop (Soze)
Trim pixels off the edge — the crop node that plays nice with batches
- image
- image
- width
- height
- status
Every serious ComfyUI workflow ends up needing the unglamorous one: strip the letterbox bars off a video frame, cut a watermark out of the bottom corner, or shave a few stray pixels before a node that insists on exact dimensions. That's what Image Crop (Soze) is for. No cleverness, no models, no downloads - you give it pixel counts and it removes that many pixels from each edge.
What makes it worth reaching for over the built-in crop nodes is that it works on a whole batch at once. Feed it an IMAGE with 24 frames and it applies the same top/bottom/left/right cut to every frame, so the batch stays aligned. That matters more than it sounds: a lot of crop helpers in the wild only handle one image, and if you're cropping frames before feeding them to a video upscaler or a ControlNet preprocessor, having every frame land at the same resolution is the difference between a clean run and a weird resize artifact half-way through.
How it works
The node is deliberately dumb in the best way. It takes your four crop amounts, clamps anything negative to zero, and makes sure opposing crops never eat the whole axis (it leaves at least a 1x1 pixel image, and tells you in the status string when it clamped). Then it slices [y0:y1, x0:x1] on every frame. Because it's a plain tensor slice, the batch dimension passes through untouched.
One thing to be clear about: this is crop, not resize. If you need a specific output dimension you'll still have to scale after - this node just removes pixels. And it takes pixel counts, not percentages, so "half the top bar" means actually working out the number first.
Inputs and outputs
The inputs that matter:
- image - an IMAGE or image batch. Handles both; a single image gets promoted to a batch internally and comes back as one.
- top / bottom / left / right - integers, pixels to remove from each edge. Default 0 on all four, so an unconfigured node passes the image through unchanged.
Outputs are image (the cropped batch), width and height (the new dimensions - handy if you want to feed them into a size node downstream), and status, a string like OK: 1024x1024 -> 1024x960 (T0 B64 L0 R0, batch=24). If it had to clamp the crop to keep at least one pixel, that shows up too. That status port is genuinely useful for debugging batch pipelines without adding Preview nodes everywhere.
Installing it
It ships in the Soze pack, so there's no separate install:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
Restart ComfyUI after. Or just search ComfyUI_Soze in ComfyUI Manager and click Install. No model files, no API keys - this one is pure torch slicing.
Where people get burned
The classic mistake is treating it as a center-crop or aspect-ratio tool. It's not - it only trims edges, and it does so asymmetrically if you feed it asymmetric numbers. Also remember the crop is fixed per run: if your images come in at different sizes, the same pixel count removes proportionally different amounts. And if you try to crop more pixels than the image has on both sides, it doesn't error - it clamps to 1px and flags it in the status string. That's actually the good kind of behavior for batch runs; the run finishes and you notice the odd frame in the log rather than the whole queue dying.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image or image batch to crop. | |
| top | INT | 00–8192 | Pixels to remove from the top edge. |
| bottom | INT | 00–8192 | Pixels to remove from the bottom edge. |
| left | INT | 00–8192 | Pixels to remove from the left edge. |
| right | INT | 00–8192 | Pixels to remove from the right edge. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |
| status | STRING | — |