RC Image Crop
Cropping without leaving the graph
- image
- IMAGE
Crop is the boring utility node you think you don't need until a workflow hands you a 1024×1024 image and the next step wants a 512×512 square, or you're generating tiles and need a centered 16:9 slice. RC_ImageCrop does exactly that inside the graph - no external editor, no re-load, just a crop that stays reproducible in your workflow. It's part of the RC Image Compositor pack (category RC/Utilities), and it's about as simple as a node gets while still having modes.
How it works
You pick a crop_method and the node slices the tensor with NumPy, clamping coordinates so you can't run off the edge. Three modes:
- manual - exact coordinates.
x/yare the top-left corner,width/heightare the box. This is the mode for precision crops. - center - centered crop to
width/height, ignoring x/y. If your target is bigger than the image, it clamps to the image size rather than erroring. - aspect_ratio - centered crop to a ratio, using
aspect_width/aspect_height(default 16/9). It looks at which dimension is "too wide" and trims the other one to match. This is the one for thumbnails and video frames.
The inputs you'll actually set are crop_method plus the handful of numbers for whichever mode you chose. Everything else in the schema is the mode's spare parts.
Output is a single IMAGE at whatever size the crop produced. It processes batches frame-by-frame, so cropping a whole video sequence to the same region works without a loop node.
Installing it
Same as every node in this pack. ComfyUI Manager → search "RC Image Compositor" → install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kj863257/ComfyUI_RC_Image_Compositor
cd ComfyUI_RC_Image_Compositor
pip install -r requirements.txt
Dependencies are just pillow, numpy, and opencv-python. Nothing to download.
Where people get burned
aspect_ratioignores everything except the ratio. If you setaspect_width/aspect_heightand leavewidth/heightat 512, they're dead inputs in this mode. Confusion here is the #1 complaint, so read the mode's tooltip before touching the numbers.- Manual crop coordinates start at top-left, and 0,0 is top-left in ComfyUI. Sounds obvious, but if you're coming from a convention where y grows downward in another app, double-check before you batch.
- Output size changes. Cropping is the rare node that changes dimensions mid-graph, and downstream nodes that assume a fixed size will complain or silently reshape. Crop as late as you can.
- It doesn't resize. If you crop a 1024 image to 512 you get exactly 512 - no upscaling, no aspect preservation beyond what you asked for. Pair it with an image scale node if you need the output padded back up.
Honest take: this is the node you install for the workflow, not for joy. But the aspect_ratio mode is genuinely handy - it's the "fit to ratio, centered" behavior that most crop nodes make you do arithmetic for.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| crop_method | COMBO | manual | Crop method: - manual: Manual coordinates - center: Center crop to size - aspect_ratio: Crop by ratio (centered) |
| x | INT | 00–8192 | Crop start X coordinate (manual mode) |
| y | INT | 00–8192 | Crop start Y coordinate (manual mode) |
| width | INT | 5121–8192 | Crop width |
| height | INT | 5121–8192 | Crop height |
| aspect_width | FLOAT | 16.00.1–100 | Width part of aspect ratio (ratio mode) |
| aspect_height | FLOAT | 9.00.1–100 | Height part of aspect ratio (ratio mode) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |