Cropped Image (CCN)
Stop guessing crop coordinates, drag them on a canvas
- image
- image
- raw_image
- mask
- crop_x
- crop_y
- crop_width
- crop_height
- source_image
Crop boxes are the fiddliest part of a workflow to set by hand - you type four pixel coordinates, run, look at the result, adjust, run again. Cropped Image (CCN) replaces that loop with a canvas: the image is drawn right inside the node with a dimmed overlay outside the crop region, and you drag the corner handles to define exactly what you want. It's the difference between programming a crop and drawing one.
How it works
The node shows your source image on a canvas. Drag the four corners to resize (the opposite corner stays pinned), drag inside the rectangle to move it, and a live readout shows the crop's pixel size and aspect ratio. lock_ratio keeps the aspect fixed while you drag and re-applies it if a differently-sized image loads. The crop rectangle is stored as normalized 0–1 coordinates, so it serializes with the workflow - reload it later and the crop is still there.
The outputs are the useful part, because you rarely want just one thing:
image- the model-friendly crop: resized so width and height are multiples ofsnap_to(default 8). This is the one that feeds your sampler or inpaint region.raw_image- the exact pixel crop, no resampling. For pixel-fidelity work.mask- a full-source-size mask,1.0inside the crop and0.0outside. Wire it to a ControlNet or mask input.crop_x,crop_y,crop_width,crop_height- the crop geometry as ints.source_image- the original uncropped image, passed through.
It doubles as a standalone image loader: with nothing wired to image, the loaded_image picker loads a file from your input directory. And wired inputs take priority - the README's key rule is that a wired image overrides any loaded file.
Install
ComfyUI Manager → search ComfyCollectorNodes → Install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes
Restart, no pip step. Under the (CCN) suffix.
Gotchas worth knowing
Two things from the README that save you a scare. First, cropped images are stored in ComfyUI's temp folder, which is cleared on restart - the node output isn't persisted as a file, so don't go hunting for the crop on disk later. Second, when you wire an image in, the node can show a "Load Preview" button to pull a preview from upstream without executing; if that upstream is a video scrubber, the preview pixel size may read smaller than the real output - an info bug only, the actual output is correct. If you're chaining Cropped Image with the pack's Video Scrubber to grab a frame and crop the exact subject for a re-inpaint, that's the flagship use case, and it works well. The one habit to build: check snap_to before you queue - a crop that isn't a multiple of 8 can produce odd-dimension latents downstream.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| lock_ratio | BOOLEAN | false | — |
| snap_to | INT | 81–64 | Model-friendly output dimensions are floored to this multiple. |
| crop_x1 | FLOAT | 0.00000–1 | — |
| crop_y1 | FLOAT | 0.00000–1 | — |
| crop_x2 | FLOAT | 1.00000–1 | — |
| crop_y2 | FLOAT | 1.00000–1 | — |
| imageopt | IMAGE | — | |
| loaded_imageopt | COMBO | 2 options: none, example.png | |
| debugopt | BOOLEAN | false | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| raw_image | IMAGE | — |
| mask | MASK | — |
| crop_x | INT | — |
| crop_y | INT | — |
| crop_width | INT | — |
| crop_height | INT | — |
| source_image | IMAGE | — |