๐ฆ RS Crop Image
Crop by drawing on the image, and never fight a VAE size-multiple error again
- image
- mask
- CROPPED_IMAGE
- CROP_DATA
The stock crop nodes in ComfyUI make you type coordinates, which is exactly the wrong way to find a face. ๐ฆ RS Crop Image (RSCropImage) shows you the actual image, lets you draw the rectangle with your mouse, and then - the part that matters - can snap that rectangle to a size multiple of 4, 8, 16, 32, or 64. That snap is the whole game: SD 1.5 and SDXL want multiples of 8, Flux wants 16 or 64, and a crop that ignores this gets rejected or silently mangled by the VAE. This node guarantees the cropped output is VAE-clean before you ever touch a sampler.
How it works
Wire an image in, run the queue, and the workflow pauses with the image shown inside the node. You drag the rectangle or its corner handles, the node reports the live dimensions, and when you hit โ๏ธ ACCEPT it continues. Two details make it more than a pretty crop:
- Multiple mode. With
multiple_modeon, the crop box snaps so the final size is a multiple of whatever you set inmultiple_of. There's also a mask path: connect aMASKand it auto-detects the crop region from the bounding box of all non-zero pixels (using a 0.5 threshold), then aligns that box to your chosen multiple. - CROP_DATA. The node outputs a string of precise crop coordinates alongside the
CROPPED_IMAGE. Save that, run the same crop through a dozen models or seeds, and you get bit-identical regions every time.
Inputs that matter
image- what you're cropping.multiple_mode- toggle the size snapping on.multiple_of-4,8,16,32, or64. Pick 8 for SD-family, 16/64 for Flux.mask(optional) - auto-crop to the mask's bounding box.crop_data(optional) - feed a saved crop string back in to reproduce a region exactly.
Outputs: CROPPED_IMAGE and CROP_DATA (the string that RS Insert Crop - RSInsertCropImage - consumes to paste the edited fragment back, pixel-perfect).
How to install
Part of ComfyUI_RaykoStudio:
cd ComfyUI/custom_nodes
git clone https://github.com/Raykosan/ComfyUI_RaykoStudio.git
Restart ComfyUI, or use ComfyUI Manager and search "ComfyUI_RaykoStudio". No model downloads; it's all local image math.
Common issues
- It pauses forever. That's by design - the queue waits until you hit โ๏ธ ACCEPT, โ CANCEL, or close the workflow. Don't panic; click ACCEPT.
- Cropped output rejected by your model. You turned off
multiple_mode. If you're cropping for a Flux pipeline, enable it and setmultiple_ofto 16 or 64.
The author demoed this node on r/comfyui and the "why do I need this" answer is the multiple-snapping plus the reverse-paste story: crop โ inpaint or upscale the fragment โ stitch it back with the matching Insert node. That's the crop-and-stitch pattern the inpainting community converged on, and this pair implements it with a much nicer UI than raw coordinates.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| multiple_mode | BOOLEAN | false | โ |
| multiple_of | COMBO | 8 | 5 options: 4, 8, 16, 32, 64 |
| maskopt | MASK | โ | |
| crop_dataopt | STRING | {} | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| CROPPED_IMAGE | IMAGE | โ |
| CROP_DATA | STRING | โ |