Image Crop (Purz)
Drag a green box, stop doing math
- image
Every crop in ComfyUI is the same grind: find the pixel coordinates, type them into a crop node, run, squint, adjust, rerun. PurzImageCrop kills that loop. You load an image straight into the node, and a live preview shows it with a draggable green overlay - you click and drag the crop window to where you want it, and the node figures out the coordinates for you. It's the "see what you're cropping" node, and once you've used it, the old way feels silly.
It's part of ComfyUI-Purz's Purz/Interactive family by PurzBeats (a Comfy Org staffer) - a set of nodes that load their own media and handle the fiddly UI so you don't have to.
How it works
This is the client-side flavor: the image file lives in your browser as a blob URL and never touches the server until you queue the workflow. The preview canvas (capped at 720px on its longest side for smoothness) shows the full source with the green crop rectangle overlaid. Drag the box to reposition; the anchor and offset_x/offset_y values update automatically so the workflow always knows exactly what region is being cropped. When you queue, the node bakes the crop in the browser and ships the finished PNG up once.
Beyond freehand dragging you get:
- 14 aspect-ratio presets - 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21, 3:2, 2:3, 5:4, 4:5, 2:1, 1:2, and Free. Choosing a preset anchors the output's longest side to the source's longest side, so you don't get a 9:21 crop turning into a bizarre 1920×4480 on a 1080p source.
- Four fit modes - Stretch (squish), Cover (anchor-positioned crop), Contain (letterbox with a background color), and Crop (Cover plus manual zoom and offset).
What you set
The node takes no graph inputs - all controls live in the widget UI, tied to the node's unique_id. The things you'll actually touch: output width/height, the aspect-ratio presets, the fit mode dropdown, the draggable green overlay, and background_color for letterboxed contain output.
The single output is image, type IMAGE, ready to feed a sampler, an img2img pass, or a save node.
Installing it
ComfyUI Manager - search ComfyUI-Purz - or:
cd ComfyUI/custom_nodes/
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
Restart ComfyUI. Requirements are OpenCV, Pillow, torch, numpy - nothing heavy, no models.
Where people get burned
Because the source file lives in the browser, state doesn't survive a page refresh - reload and you're re-picking the file. If you're going to leave a workflow and come back, use Image Crop Upload (Purz) instead, which stores the file in ComfyUI's input/ directory and persists across reloads. Also, the crop is baked at queue time, so every time you nudge the green box you're committing to a re-run - tweak first, queue last. It's a workflow-discipline thing more than a bug, but it's the one that trips people up.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |