Crop
Trim to size without leaving the graph
- image
- image
IsekaiCrop cuts an image down to a rectangle. That's it - but in a ComfyUI workflow, cropping has more uses than you'd think: trimming letterbox bars from an upscale, slicing a head-and-shoulders portrait out of a full shot for a detailer pass, cutting out a watermark area, or prepping a consistent crop region for a batch of images. It's the sort of node you forget exists until you need it at three in the morning.
How it works
You give it x, y, width, and height (all integers, 0–8192), and it runs a PIL crop. x/y are the top-left corner of the crop box, width/height are the box size - unless you flip the from_center toggle, in which case x/y are treated as the center of the crop instead of the corner. The from_center option is the one that saves you math: when you know where the subject is, "center on this point, 512 wide" is a lot easier to think about than "top-left at this coordinate."
One thing to watch: the crop box can extend past the image edge, and PIL will just fill the out-of-bounds area with black. There's no clamping and no warning. If you get black bars appearing out of nowhere, your box is hanging off the edge - nudge x/y or shrink width/height.
The inputs
image- the image to crop.x,y- origin (or center, iffrom_centeris on). Default 0.width,height- crop size. Default 512 each.from_center- boolean, default off.
Output is a single image tensor at the cropped size. Wire it into whatever wants the smaller region - a save, an upscale, a second pass.
Installing it
Part of isekai-comfy-node:
ComfyUI Manager: search "isekai" → install isekai-comfy-node → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/isekai-sh/isekai-comfy-node
cd isekai-comfy-node
pip install -r requirements.txt
Restart and it's under Isekai → Image/Transform. Pillow and requests only; no models, no downloads.
Common issues
The pack-wide batch caveat applies - batched images only get their first frame cropped, so don't route an animation through this expecting per-frame crops. If your image is bigger than the 8192 max for any field, this node literally can't address it, but that's a corner case you won't hit with normal generations.
The real-world gotcha is coordinate bookkeeping. If you crop a 1024×1024 image to 512×512 and then want to crop the same region from the original later, remember the coordinates are relative to the original image, not to the last crop. People chase "why is my region shifted" for an embarrassing amount of time over that one detail.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| x | INT | 00–8192 | — |
| y | INT | 00–8192 | — |
| width | INT | 5121–8192 | — |
| height | INT | 5121–8192 | — |
| from_centeropt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |