ComfyUI Node

Crop

Crop in the browser, instantly, with no queue

By jtydhr88·Created 3 months ago·Updated about 15 hours ago· 725
Crop
  • image
  • image
force_run_token0
project_id
parent_output_id0
crop_x0
crop_y0
crop_w0
crop_h0

Crop is the kind of operation that shouldn't need a node graph at all, and ComfyTV agrees: Crop is an instant node. All the processing happens in your browser - you see a preview with a draggable crop box, and moving or resizing it updates the result immediately. No ▶ Run, no ComfyUI queue, no models loaded. It's for reframing after generation, exporting at a fixed ratio (1:1, 16:9, 9:16), or trimming edges before heavier edits - and it's one of the tools auto-inserted from the Image Picker's ✏️ Edit toolbar, which is where most people meet it first.

The mental model that makes ComfyTV click: lightweight edits like Crop are stages that never touch the queue, while generative stages (Upscale, Inpaint) have a Run. Crop just writes crop_x / crop_y / crop_w / crop_h and hands a cropped preview URL downstream.

How it works

The Python side is a pass-through - the node stores the crop rectangle and passes the image snapshot along; the actual cut happens in the browser via canvas. Input is image (COMFYTV_IMAGE), output is image (COMFYTV_IMAGE). The four rectangle fields - crop_x, crop_y, crop_w, crop_h (each 0–8192) - are hidden, written by the UI as you drag. A W or H of 0 means no valid crop yet, which is how you'll know you haven't actually set one.

One thing to internalize: because downstream stages consume the last snapshot, changing the crop box does not automatically re-run whatever comes after. If you crop then Upscale, you run the Upscale again to pick up the new framing.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyTV

Restart the ComfyUI backend (a real restart, not a tab refresh); nodes appear under the ComfyTV category. ComfyUI Manager finds the pack by searching "ComfyTV". The README's two recurring gotchas: on Desktop/macOS/multi-install setups the relative cd can clone into the wrong instance - read the startup log for the base path it loaded and clone into that absolute path, quoted - and the first level of custom_nodes/ComfyTV/ must contain __init__.py, not a nested ComfyTV/ComfyTV/ folder. No Python dependencies to install; the crop runs on your browser's canvas.

Troubleshooting and tips

  • "No valid crop" downstream. W or H is still 0 - drag the box into a real rectangle.
  • I changed the crop but Upscale looks identical. It's reading the last Run snapshot. Run the downstream generative stage again. This trips up everyone once.
  • Can't wire Save Image to it? Type mismatch - Crop speaks COMFYTV_IMAGE, not native IMAGE. Add → ComfyTV Image first, run it, then crop.
  • Output resolution? Exactly the crop box's W×H. There's no automatic upscaling, so if you crop deep, plan to run Upscale after.
  • Need to reframe after the box is set? Just drag again - no Run needed for the crop itself, only for the generative stages that follow.
CategoryComfyTV/Image

Inputs (8)

NameTypeDefaultDescription
force_run_tokenINT00–2147483647Internal — bumped on Run to invalidate ComfyUI's input cache.
project_idSTRINGInternal — populated by the projectStore on the frontend.
parent_output_idINT00–2147483647Internal — lineage parent set by spawn handlers on the frontend.
crop_xINT00–8192
crop_yINT00–8192
crop_wINT00–8192
crop_hINT00–8192
imageoptCOMFYTV_IMAGE

Outputs (1)

NameTypeDescription
imageCOMFYTV_IMAGE