Superside Cut By Mask
Crop an image to its mask's bounding box — the handiest little utility in the pack
- image
- mask
- IMAGE
Sometimes the most useful node is the most boring one. This takes an image and a mask, finds the mask's bounding box, and crops the image to exactly that region - discarding everything outside it. No API, no model, no key. It's the in-house equivalent of Masquerade's Cut By Mask, and it's the kind of utility that quietly unlocks whole workflows once you know it exists.
The classic use case is the region-detail loop the KB calls out: a face occupies 70 pixels of a 1024px frame and comes out a smear, because the latent has no budget to spend there. Instead of feeding the whole image to an inpaint or a detailer, you cut the region out, process it at a resolution the model can actually work with, then paste it back. This node is the "cut" half of that. Pair it with an upscale and an inpaint on the crop, then composite the result back onto the original - the pack even has Crop By Region + Stitch Region for the fancier coordinate-tracked version, but for a quick bounding-box cut, this is the node.
Inputs: image, mask (an IMAGE-type mask input, so if you have a native MASK type handy you'll want to convert it first), plus force_resize_width and force_resize_height, both defaulting to 0. The two force-resize values are the entire configuration surface: leave them at 0 and the crop comes out at the mask's bounding-box size; set them and every crop is resized to exactly that size instead. Output is a single IMAGE.
Two behaviors worth knowing, both visible in the source. First, everything outside the mask is zeroed via the alpha channel before cropping, so the cutout doesn't drag along background you didn't ask for - you get a masked crop, not a plain rectangle. Second, when the mask is empty for a frame in a batch, the node returns a black crop of the target size rather than erroring out, which keeps batch runs alive instead of dying on a single bad mask. If your force_resize_width/force_resize_height are set, note that the crop is bicubic-resampled to that size - set them to a diffusion-friendly multiple if you're feeding the result straight into a sampler.
It's part of the pack's deliberate "no external dependencies" philosophy: the pack reimplements a handful of small third-party utilities (this one, GrowMaskWithBlur, Combine Prompt) so a workflow built entirely from Superside nodes needs nothing else installed. If you already have masquerade-nodes-comfyui, this is redundant - but it's free, and it means one fewer pack to maintain on a locked-down machine.
Install - ComfyUI Manager (search "comfyui-superside-nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes
pip install -r requirements.txt
Restart ComfyUI, look under Superside. No key, no model files, nothing new to download - the pack's dependencies are just fal-client, pillow, numpy, torch, requests, and this node uses only the last four.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | IMAGE | — | |
| force_resize_width | INT | 00–1048576 | — |
| force_resize_height | INT | 00–1048576 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |