Nodes/was-node-suite-comfyui/Mask Paste Region
ComfyUI Node Runs on cloud

Mask Paste Region

Paste a cropped mask region back where it came from

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Mask Paste Region

      WAS builds a whole crop-then-restore pattern around its mask tools: Mask Crop Region finds a mask's dominant or minority blob, crops to it, and - crucially - outputs crop_data, described by the pack itself as the record of where the crop came from "for pasting back." On the image side, WAS's Image Paste Crop node is the documented consumer of that data, putting a processed image crop back into its exact original spot. Mask Paste Region is the same idea applied to masks: it takes a cropped or processed mask region and composites it back into a full-size mask at the location it was cropped from, so a crop → edit → paste round-trip on mask data closes cleanly instead of you having to rebuild the full mask from scratch.

      Our source material this round doesn't carry a standalone README line or a schema for this specific node, so this framing is read directly off WAS's own documented crop/paste-back pattern rather than off exact field names - the shape of the job, not the literal widget list, is what's grounded here.

      Why you'd need to paste a mask region back

      If you've cropped a mask's region - with Mask Crop Region, Mask Crop Dominant Region, or Mask Crop Minority Region - and then done additional processing on just that smaller piece (blurring it, thresholding it, running it through Mask Erode or Gaussian Region for a cleaner edge), you're left holding a small, edited mask that no longer matches your canvas size. Mask Paste Region is what puts it back where it belongs, at full resolution, in its original position, so the rest of your graph can keep working with a normal full-size mask instead of a disconnected crop.

      How it works

      It takes the processed region and the geometry describing where it was cropped from - the location and size data a crop node like Mask Crop Region hands back - and composites that region into a base mask at the matching coordinates. The result is a full-size mask with your edited piece sitting exactly where the original crop came from.

      The inputs and outputs that matter

      Conceptually: the base/original mask, the processed region to paste back in, and the crop location/size data tying the two together. The output is a single composited MASK at the original canvas size. The critical detail, same as on the image side, is that the crop and the paste have to agree on the same geometry - mixing data from two different crop operations is the fastest way to get a misaligned result.

      Installing it

      ComfyUI Manager: search "WAS Node Suite," install, restart. Manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      install requirements.txt against your ComfyUI Python, restart. No model download.

      Common issues & troubleshooting

      Paste-back is misaligned. Almost always a mismatch between the crop_data or location/size values used to crop and the ones used to paste - use the exact same geometry output for both halves of the round-trip, not a re-derived or separately-computed one.

      The pasted region has a visible seam. If the processed piece has a hard edge where it meets the rest of the mask, that's an edge-softness problem, not a paste-position problem - run the cropped piece through Mask Gaussian Region before pasting, the same way you'd feather any inpaint mask.

      Whole pack won't import. Pack-level. WAS Node Suite has been unmaintained since the author marked it retired in December 2023; the recurring failure is the entire suite throwing "Import Failed" after a ComfyUI update from a pinned dependency clash. Reinstall requirements.txt against the correct, embedded Python interpreter and restart.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs