Mask-Crop | Post
Paste a crop back where it came from, exactly
- image
- context
- image
Mask-Crop | Post is the bookend to Mask-Crop | Pre: it takes the (possibly modified) crop and pastes it back onto the original image at exactly the bounding box where it was cut from. It's the simplest node in the inpaint family - two inputs, one output, no parameters - and it's the one that keeps your "crop → do something → paste back" pipelines from turning into manual pixel-arithmetic nightmares.
The inputs are image (the crop after whatever you did to it) and context (from Mask-Crop | Pre). The output is image - the original full-resolution image with your modified crop stamped in. Because the context carries the bounding box, Post knows precisely where the crop lives without you re-measuring anything.
The checks that keep you honest
This node is strict, and the strictness is a feature. Before it pastes, it verifies that:
- the crop matches the bounding box height/width exactly,
- the batch size matches the original image,
- the channel count matches.
If you resized the crop between Pre and Post, you'll get an error, not a silently misaligned paste. That's the intended contract: Mask-Crop | Post expects the crop at the same resolution it was cut at. If your intermediate step changed the size (an upscaler, a sampler at a different resolution), you need to resize it back to the original crop resolution first - Resample Image with a Scaler | Fixed set to the crop's dimensions, or the Inpaint pair if you'd rather the pack handle the resize and color math for you.
One thing it deliberately does not do: blend. This is a hard paste - the crop goes in at the box, full opacity, no feathering. If you want a soft transition at the boundary, blur your mask and composite manually (the pack's Blur Mask is a natural companion), or use the Inpaint pair, which does the mask-based composite in linear space.
When you'd use this over the Inpaint pair
If your workflow is "crop a region, regenerate it, paste it back" and you're handling the resize and the model call yourself - a custom inpainting model, an img2img pass on just the region, a ControlNet-guided fix - this pair is lighter and more predictable than the Inpaint variant. If you want the pack to also resize, color-shift, and composite, the Inpaint pair is the one.
Installing
Ships in comfyui-some-image-processing-stuff:
cd ComfyUI/custom_nodes
git clone https://github.com/wmpmiles/comfyui-some-image-processing-stuff
Restart, or ComfyUI Manager → "Some Image Processing Stuff". No models, no extra dependencies. It's useless without its Pre twin's context, so install the pack once and grab both.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| context | CONTEXT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |