ComfyUI Node

EZ Crop

Inpaint a region without the mask gymnastics

By Pauan·Created 8 months ago·Updated 5 months ago· 3
EZ Crop
  • image_settings
  • crop_region
  • IMAGE

EZ Crop is the regional editing tool of the Prompt Helpers pack. It takes your image settings, stamps a rectangular crop region onto them, and EZ Generate then does all its work inside that box - generating only what's in the region and compositing the result back onto the original. It's the pack's way of doing regional inpaint without you touching ImageCompositeMasked by hand.

Two inputs:

  • image_settings (EZ_IMAGE_SETTINGS) - the image side of the pipeline, typically from EZ img2img (which is what carries the source image and mask).
  • crop_region (BOUNDING_BOX, default 0,0,512,512) - x, y, width, height of the region to work in.

The output is IMAGE (EZ_IMAGE_SETTINGS), the settings bundle with the crop attached, wired onward into EZ Generate.

How it works

EZ Crop stores a crop rectangle on the settings. At generation time, EZ Generate crops the source image (and mask, if present) to that box, resizes it to a clean multiple of 8 (the latent-size requirement), runs the sampler on the crop, then pastes the result back onto the original at the right offset with ImageCompositeMasked. It even snaps your crop's dimensions to the nearest valid size so you don't get a weird latent edge.

That's why EZ Generate has two image outputs:

  • FULL - the complete image, crop composited back in place. This is the one you save.
  • PARTIAL - just the cropped, regenerated region on a transparent background. Perfect for previewing what actually changed without studying the whole frame.

The classic setup

The can't-miss combination is EZ img2img (with a mask) → EZ CropEZ Generate. The mask says "only this shape is fair game," and the crop says "and focus your compute on this box." Give it a small image_weight so the region gets regenerated rather than preserved, and you've got regional inpainting - a background fix, an object swap, whatever. Add EZ Detail after the crop and you've built the classic "fix the face" pass: crop tight around the face, upscale, low denoise.

A note on the mask: EZ Crop works with or without one. Without a mask it's plain region regeneration (the whole crop gets replaced). With a mask from EZ img2img, only the masked part inside the crop changes - that's the difference between "regenerate this box" and "repaint this scribble."

Installing it

It ships with the Prompt Helpers pack. In ComfyUI Manager search "Prompt Helpers" (Pauan/comfyui-prompt-helpers), install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Pauan/comfyui-prompt-helpers

Restart ComfyUI. No model downloads; the pack depends on PyYAML and desktop-notifier and needs ComfyUI 0.8.0+.

One gotcha: a crop region with width or height of 0 is silently ignored - the node passes your settings through untouched, and your "crop" mysteriously does nothing. If a crop stops working, check the bounding box values before blaming the sampler.

Categoryprompt_helpers/image

Inputs (2)

NameTypeDefaultDescription
image_settingsEZ_IMAGE_SETTINGS
crop_regionBOUNDING_BOX[object Object]

Outputs (1)

NameTypeDescription
IMAGEEZ_IMAGE_SETTINGS