Image Crop Upload (Purz)
The crop that survives a refresh
- image
The frustrating thing about most "visual crop" nodes is that your crop disappears when you close the browser. PurzImageCropUpload is the version that doesn't: the image is uploaded to ComfyUI's input/ directory the moment you pick it, and the workflow serializes the filename plus every crop parameter - so reload the page, and your crop is still sitting there exactly where you left it. It's the persistent sibling of the client-side Image Crop node, and for anyone doing serious workflow iteration it's the one you actually want.
From ComfyUI-Purz's Purz/Interactive family, by PurzBeats (a Comfy Org staffer).
How it works
Unlike the client-side variant, the file goes to the server immediately and is processed there. The upload node exposes the crop controls as real, workflow-serializable inputs - image (the filename, picked from a dropdown of everything in input/), width, height, and the geometry settings - so saving your workflow saves your crop. Resizing happens server-side with Pillow (Image.LANCZOS), which is fast and deterministic.
The fit modes are the same four as the client-side version:
- stretch - squish the source to the output size, distorting as needed.
- cover - scale to fill the output, cropping the overflow, positioned by
anchor. - contain - scale to fit inside the output, letterboxing with
background_color(default#000000). - crop - like cover, but adds
zoomandoffset_x/offset_yon top so you can punch in further.
The inputs that matter
- image - the filename from your
input/directory. This is the one input everyone sets; everything else is optional tweaking. - width / height - output size, 16 to 16384.
- fit_mode -
stretch,cover,contain, orcrop. Default iscover, which is the right default for "fill the frame." - anchor -
center,top,bottom,left,right, plus the four corners. Where the crop window sits within the source. - zoom - 0.1–10, only meaningful in
cropmode. This is your "punch in" knob. - offset_x / offset_y - −1 to 1, fine positional nudges (in crop mode). These are what the draggable overlay of the client-side node updates for you.
Output is image, type IMAGE, at exactly the size you asked for.
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 - all standard, no model downloads.
Where people get burned
Remember which mode you're in. zoom and offset_x/offset_y do nothing in stretch, cover, or contain - they only apply in crop mode, so people drag those sliders, see no change, and assume the node is broken. Also, since the file now lives in input/, it counts against your ComfyUI storage and gets picked up by any node that scans that directory - nothing to clean up, but worth knowing where your disk space went. And if you're on the client-side Image Crop for a quick one-off, the same UX is there - this node just adds persistence and a slightly less drag-friendly interface.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | example.png | 1 options: example.png |
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| fit_mode | COMBO | cover | 4 options: stretch, cover, contain, crop |
| anchor | COMBO | center | 9 options: center, top, bottom, left, right, top-left, +3 |
| background_color | STRING | #000000 | — |
| zoom | FLOAT | 1.000.1–10 | — |
| offset_x | FLOAT | 0.00-1–1 | — |
| offset_y | FLOAT | 0.00-1–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |