ComfyUI’s ImageCrop uses x and y for the crop rectangle’s top-left corner, then uses width and height to define its size. Its lower-right boundary is therefore (x + width, y + height). The ImageCrop documentation does not specify what happens when that rectangle extends beyond the image. ImageCropV2, by contrast, explicitly says it adjusts an out-of-bounds crop_region to fit. Do not assume that V2 rule applies to ImageCrop or other crop nodes.
Read the rectangle before running the node
Treat x as the horizontal start and y as the vertical start, measured from the image’s top-left. The crop covers the specified width and height from that point. For boundary checks, write down both edges: left x, top y, right x + width, and bottom y + height.
For example, suppose an image is 640 by 480 pixels and you enter x=100, y=60, width=200, height=150. The rectangle’s right edge is 300 and its bottom edge is 210, so it lies within the image dimensions. This is a hypothetical calculation, not a claim about an executed workflow.
Check the node’s contract
Before relying on behavior, identify which node is in the graph. The ImageCrop documentation defines x and y as the crop area’s top-left coordinates and lists width and height as the requested output dimensions. It does not document automatic clamping or describe an out-of-bounds result.
The ImageCropV2 documentation defines a crop_region with the same rectangle components, but adds an explicit boundary rule: regions extending past the image are adjusted to fit. It also says coordinates beyond the image dimensions are moved to a valid position and the resulting width or height is reduced as needed. That is a documented distinction between these node contracts, not a universal ComfyUI crop rule.
Make and verify a crop in four steps
- Read the input image dimensions from the image or upstream workflow information. Record width first, then height; do not infer them from a resized preview.
- Select the actual crop node in the graph. Note whether its inputs are separate
x,y,width, andheightfields (ImageCrop) or acrop_region(ImageCropV2). - Choose the intended top-left point and crop size. Calculate
right = x + widthandbottom = y + height. Compare right with image width and bottom with image height; also ensure the starting coordinates are not outside the image. - Run the workflow and inspect the output dimensions and visible region. For a crop entirely inside the image, compare its edges with the input. For an out-of-bounds request, record the actual node and values rather than assuming a particular result for
ImageCrop.
Use a boundary worksheet
The following values are hypothetical. They illustrate what to calculate and what the documentation does or does not promise; they are not test results.
| Case | Input and requested rectangle | Boundary check | Documented expectation and check |
|---|---|---|---|
| Interior | 640 × 480; x=100, y=60, width=200, height=150 | Right 300; bottom 210 | Both nodes’ definitions describe this rectangle; inspect for a 200 × 150 crop at the intended location. |
| Geometric edge at right and bottom | 640 × 480; x=440, y=330, width=200, height=150 | Half-open rectangle [440, 640) × [330, 480); right edge 640; bottom edge 480 | As a geometric rectangle, its edges coincide with the image dimensions. This arithmetic does not establish how every node implementation handles edge coordinates; inspect the selected node’s output dimensions and corner content. |
| Exceeds right edge | 640 × 480; x=580, y=60, width=120, height=100 | Right 700; bottom 160 | V2 documents adjustment to fit; ImageCrop documentation does not state the result. |
| Start beyond image | 640 × 480; x=700, y=500, width=80, height=80 | Start is beyond both dimensions | V2 documents moving out-of-range coordinates to a valid position and adjusting the crop; do not infer ImageCrop behavior. |
Diagnose unexpected results and limits
If the output is smaller than requested, shifted, or fails to match the intended region, first confirm the node name and input dimensions. Recalculate the right and bottom edges, then check whether the requested rectangle crosses the image boundary. If it does, use the V2 documentation only when the graph actually uses ImageCropV2; for ImageCrop, consult the installed node’s behavior or keep the requested rectangle within bounds. The cited documentation does not establish the exact out-of-bounds result for ImageCrop, nor does it specify a universal coordinate convention for every other crop node.
Does `x=0, y=0` start at the image’s top-left? Yes. Those values identify the rectangle’s top-left at the image origin described in the node documentation.
Does a crop ending exactly at the image width exceed the boundary? No. If x + width equals the image width, its right edge reaches the boundary; it does not go past it. Apply the same check to y + height and image height.
Will `ImageCrop` automatically shrink an oversized crop? Its cited documentation does not say. Automatic adjustment is explicitly documented for ImageCropV2, so verify the node in use instead of transferring that rule.
Sources and next step
This guide interprets public documentation and uses explicitly hypothetical acceptance examples, not application tests. Controls and availability can change; verify the cited manual against your installed version.
For work created in Imagild, carry the input requirements and acceptance checklist into the photo editor. The external software controls discussed above belong to their respective products.