DIGIT Drag Crop
Stop typing pixel offsets — drag a crop box right on the image
- image
- mask
- IMAGE
- MASK
- CROP_JSON
Cropping in ComfyUI is usually the least visual thing you can do: type four numbers into a crop node, run it, squint at the result, type four more numbers. DIGIT Drag Crop throws all that out - you drag a crop box directly on the node's image preview, with resize handles, aspect-ratio locking, and pixel snapping. What you see is what you get, in real time.
It's the node you reach for any time a workflow needs "a region of this image" - prepping a face for inpainting, isolating a subject for a reference-to-video model, cropping a plate before it goes into the Drift QC gate. Anywhere you'd otherwise be guessing coordinates, this is the honest way to do it.
How it works
You run the graph once to load the image into the preview - that's a hard requirement, since the node needs image data from upstream before it can draw anything. Then the interactive UI takes over: click-drag to create a crop region, drag inside to move it, pull the corner and edge handles to resize. You can lock an aspect ratio by entering something like 16:9, snap the crop to a pixel grid (2/4/8/16/32/64), and toggle an info overlay showing dimensions.
The inputs behind the scenes: crop_left/right/top/bottom and crop_width/height are the numeric state that the UI writes (and that you can still type directly), and dest_width/dest_height with fit_mode (none, crop, fit_h, fit_v) let you resize the output to a target. round_to snaps output dimensions to a multiple - 8 for most models, 64 for SDXL - which quietly saves you from feeding a non-multiple-of-8 crop into a latent. There's an optional mask input that gets cropped to match, keeping your mask aligned with the image.
Outputs: the cropped IMAGE, the cropped MASK (zero if none connected), and CROP_JSON - a JSON string with all coordinates and dimensions, which you feed into DIGIT Crop Info to get the numbers as separate outputs.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/thedepartmentofexternalservices/comfyui-digit.git
cd comfyui-digit
pip install -r requirements.txt
Or ComfyUI Manager → search comfyui-digit → install → restart. Fully local, no credentials.
Where people get confused
The one real gotcha is the "run once first" behavior - people drag on an empty preview, nothing happens, and assume it's broken. It isn't: the node has to receive the image before it can display it, so queue the graph, let it run, and the interactive overlay appears on the re-render. Everything else is the usual ComfyUI weirdness of widgets vs. inputs - the crop values are graph inputs, so changing them re-runs downstream nodes, which is exactly what you want when the crop drives an inpaint or a video model.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| drawing_version | STRING | init | — |
| image | IMAGE | — | |
| crop_left | INT | 00–8192 | — |
| crop_right | INT | 00–8192 | — |
| crop_top | INT | 00–8192 | — |
| crop_bottom | INT | 00–8192 | — |
| crop_width | INT | 5121–8192 | — |
| crop_height | INT | 5121–8192 | — |
| last_width | INT | 0 | — |
| last_height | INT | 0 | — |
| maskopt | MASK | — | |
| dest_widthopt | INT | 00–8192 | Destination width. 0 = use crop size as-is. |
| dest_heightopt | INT | 00–8192 | Destination height. 0 = use crop size as-is. |
| fit_modeopt | COMBO | none | none=no resize, crop=fill and crop, fit_h=match height, fit_v=match width |
| round_toopt | COMBO | off | Round output dimensions to nearest multiple. 8 works for most models, 64 for SDXL. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| CROP_JSON | STRING | — |