Image and Mask Resize
Scale your image and mask together so they never drift apart
- image
- mask
- image
- mask
What it is
Anyone who's built an inpaint workflow by hand has hit this: you resize your image with one node and your mask with a separate one, and if the two aren't set up identically you end up with a mask that's a few pixels off from the image it's supposed to cover. Silent, annoying, and the kind of bug that wastes ten minutes before you notice the seam. Image and Mask Resize exists purely to make that impossible - one node, one set of numbers, image and mask scaled in lockstep, guaranteed to land at the exact same dimensions.
It's part of ComfyUI-InpaintEasy, a small MIT-licensed pack from a solo dev (CY-CHENYUE, who also ships a couple of other focused utility packs) built around the classic crop → process → merge inpainting pattern - the same idea behind the much bigger lquesada Inpaint-CropAndStitch that's become the community default. When InpaintEasy first showed up on r/comfyui, a commenter who'd been fighting exactly this image/mask mismatch problem with the older crop-and-stitch workflow called out this exact node as the improvement worth having. That's a fair read: this is the least flashy node in the pack and the one most people will use without thinking about it, which is the point.
How it works
It's a straight resize on two synced tensors, plus a blur pass baked in. Feed it an image and a mask; it scales both to your target width/height using whichever algorithm you pick, applies your chosen crop-to-fit mode, and - this is the nice extra - runs a blur pass on the mask edge before handing it back. Normally that blur is a separate node in your graph; here it rides along for free.
The inputs that matter
width/height- target dimensions, 64 to 8192 in steps of 8, default 512x512. Match these to whatever your sampler stage actually needs (1024 for SDXL/Flux-class models, 512-ish for SD1.5).resize_method-nearest-exact,bilinear,area,bicubic, orlanczos(default). Lanczos is the sane default for photographic content; leave it unless you have a reason not to.crop-disabled(default, straight stretch to target size), orcenter/top_left/top_right/bottom_left/bottom_rightif you need to crop-to-fit from a specific anchor instead of squashing the aspect ratio.mask_blur_radius- 0 to 64, default 10. This is the mask feathering step baked into the resize. Per the usual inpainting wisdom, too low leaves a hard seam at the mask edge; too high and the effect bleeds into pixels you didn't want touched. 4-12 is the range most people land on; 10 is a reasonable starting default.
Outputs are just image and mask, resized and blurred together, ready to feed into your inpaint sampler or into Inpaint Model from the same pack.
Installing it
ComfyUI Manager: search "ComfyUI-InpaintEasy" and install. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/CY-CHENYUE/ComfyUI-InpaintEasy
Restart ComfyUI. The pack ships a requirements.txt but nothing exotic - no model downloads, no external API keys, no extra services. It's pure Python image manipulation glued onto whatever checkpoint, VAE, and conditioning you already have wired up elsewhere in your graph.
Common issues
Output looks stretched or squashed. You're on crop: disabled with a target aspect ratio that doesn't match your source. Switch to center (or whichever anchor makes sense) if you want a proper crop-to-fit instead of a distort-to-fit.
Seam still visible after inpainting even with blur set. mask_blur_radius only softens the mask edge going into the sampler - it doesn't guarantee a clean composite coming back out. If you're pasting the result back with Image Crop Merge, that node does a straight rectangular paste with no mask involved, so any softness has to come from here or from your compositing step downstream.
Mask ends up a different size than the image anyway. Shouldn't happen - that's the entire reason this node exists over two separate resize calls. If you're still seeing a mismatch, check you're not accidentally resizing the mask again somewhere else in the graph after this node.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| width | INT | 51264–8192 | — |
| height | INT | 51264–8192 | — |
| resize_method | COMBO | lanczos | 5 options: nearest-exact, bilinear, area, bicubic, lanczos |
| crop | COMBO | disabled | 6 options: disabled, center, top_left, top_right, bottom_left, bottom_right |
| mask_blur_radius | INT | 100–64 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |