Bounded Image Crop with Mask
Crop to whatever your mask covers
This node crops an image down to the region a mask covers. Feed it a picture and a mask, and it finds the bounding box around the white part of the mask and cuts the image to that box. The WAS README sums it up as "Crop a bounds image by mask." It's the automatic version of eyeballing a crop - instead of typing coordinates, you let the mask define where the interesting stuff is.
Why this matters: detail work loves crops. If you want to inpaint a face, refine a hand, or upscale just one object, doing it on the full image wastes resolution and compute on pixels you don't care about. Crop to the masked region, process at full quality on just that patch, then paste it back. This node is the "crop to the region" step of that classic detail-pass pattern, and it plays with the rest of WAS's Bounds family (Image Bounds, Inset Image Bounds, Bounded Image Blend with Mask) that handle the paste-back side.
How it works
A mask marks a region in white. This node computes the tightest rectangle that contains that white region and crops the image to it. So a mask that's a blob in the corner yields a small corner crop; a mask spanning the frame yields a near-full crop. The output is a smaller image containing just the bounded area - higher effective resolution for whatever you do next, because all your pixels are now spent on the part you care about.
The inputs and outputs that matter
- The image in - the full picture.
- The mask in - defines the region; its white area sets the crop bounds.
- The cropped image out - just the bounded region, ready for an inpaint, an upscale, or a detailer pass.
I'm describing this from the README's stated behavior rather than a formal schema, so I won't invent exact padding-widget names or every output port - but the image-plus-mask-in, cropped-region-out shape is the node's whole job.
How to install it
Part of the WAS Node Suite:
- ComfyUI Manager: search was-node-suite-comfyui, install, restart.
- Manually:
cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui/, thenpip install -r requirements.txtagainst your ComfyUI Python, and restart.
Pure geometry - no model download.
Common issues
The thing to plan for is the round trip. Cropping is easy; pasting the processed crop back into the original at the exact right spot is where people get stuck. Keep track of the bounds so you can composite the result back - WAS's bounded-blend nodes exist precisely for this, and they blend rather than hard-paste so the seam doesn't show. If you crop, process, and then can't line the patch back up, you skipped the bookkeeping the Bounds family is designed to carry.
Second: a messy mask makes a messy crop. If your mask has stray white specks far from the main region, the bounding box balloons to include them and your crop is way bigger than you wanted. Clean the mask first (dominant-region or a threshold pass) so the bounds hug the real target. And a mask smaller than you think can crop too tight and clip the edges of your subject - pad the region a little if the important content is right at the mask boundary.
And the pack caveat: WAS Node Suite has been retired since December 2023, still everywhere but unmaintained. If a ComfyUI update makes every WAS node vanish with an "Import Failed", that's suite-level dependency drift - re-run requirements.txt against the correct Python environment (or the bundled install.bat) and restart.
Inputs (0)
No inputs
Outputs (0)
No outputs