Nodes/was-node-suite-comfyui/Image Crop Square Location
ComfyUI Node Runs on cloud

Image Crop Square Location

Crop a perfect square around a center point

By WASasquatch·Created 3 years ago·Updated about 14 hours ago· 1,840
Image Crop Square Location
  • image
  • IMAGE
  • CROP_DATA
x0
y0
size256
divisible_by8

Per WAS's own description, this node crops "a location by X/Y center, creating a square crop around that point." You're not specifying four edges the way you would with the pack's plainer Image Crop Location, and you're not relying on face detection the way Image Crop Face does - you give it a single center coordinate and a size, and it builds a square outward from that point, evenly in every direction.

Why a square, specifically

Squares matter for a specific reason: they're the format most avatar systems, thumbnail grids, and a lot of training pipelines actually want. A generic rectangular crop needs a second decision - how do you fit a non-square image into a square slot - and this node skips that step entirely by only ever producing squares in the first place. If you know roughly where your subject sits (a face, a product, a focal point you calculated elsewhere in the graph) and you want a clean square around it without fussing over aspect ratio, this is the more direct tool than doing the math yourself with the plain crop node.

The inputs and outputs that matter

Conceptually: an image in, an X/Y center point, a size for the square, and a cropped square image out. The center point is what makes this different from edge-based cropping - get that point roughly right and the node handles making a symmetric square around it; get it wrong and the crop is centered on the wrong thing entirely, since there's no auto-detection here doing the centering for you.

How to install it

Bundled with the full WAS Node Suite pack:

  • ComfyUI Manager - search "WAS Node Suite", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui, then pip install -r requirements.txt from inside that folder (portable: python_embeded\python.exe -s -m pip install -r requirements.txt), restart ComfyUI.

Plain pixel math, no model download for this node.

Common issues & troubleshooting

The crop runs off the edge of the image. Center the square too close to a corner or an edge relative to its size, and part of the requested square simply doesn't exist in the source image. Depending on how the node handles that, you'll either get an image smaller than the size you asked for or padding filling the gap - either way, if your output size looks off, check whether your center point plus half your requested size actually fits inside the original image's dimensions.

Wrong subject entirely. Since there's no detection step, a center point that's stale - calculated for a differently-sized or differently-cropped upstream image - will center the square on the wrong spot. If you're feeding the coordinates in from another node rather than typing them by hand, make sure they're measured against the same image this node is actually cropping.

The pack-wide caveat still applies here too: WAS Node Suite has been unmaintained since December 2023, and the recurring gotcha is the whole suite throwing an "Import Failed" after a ComfyUI update from a dependency-version clash. Reinstall requirements.txt against the right Python environment if that happens - this node itself is a simple, stable crop.

CategoryWAS Suite/Image/Process

Inputs (5)

NameTypeDefaultDescription
imageIMAGEThe image to crop. A batch is cropped frame by frame to the same square and comes back the same length.
xINT00–24576Horizontal centre of the square, in pixels from the left of the image.
yINT00–24576Vertical centre of the square, in pixels from the top of the image. With x, 0/0 asks for a square centred on the top-left corner, which slides down and right until it fits.
sizeINT2565–4096Length of each side of the square, in pixels. A size larger than the image gives the whole image instead.
divisible_byINT81–64Rounds the crop down to a multiple of this on both axes, which resamples it. 8 suits most latent models; 1 takes the exact square away untouched.

Outputs (2)

NameTypeDescription
IMAGEIMAGEThe cropped square, its width and height rounded down to a multiple of divisible_by, with a side shorter than that taken up to one whole step instead. At a divisible_by of 1 it is the exact region asked for, carried through without resampling.
CROP_DATACROP_DATAThe crop window, for Image Paste Crop to put the result back in the right place at the right size.