π° Paste Inpainting Tile by mask - McInpainty [2/2] - v1 /i
Paste a fixed tile back without seams β the McInpainty [2/2] finishing move
- ms_pipe
- image_tile
- mask_tile
- output_image_refined
- output_image
- image_inpainted
- image
- tile_output
- tile_inpainted
- tile_mask
- tile_source
- text_pos_image_inpainted
- text_neg_image_inpainted
The McInpainty set is the MaraScott pack's answer to a problem every inpaint workflow hits: you fixed a region in a cropped, upscaled tile, and now you have to put it back into the original image without the result looking pasted on. That's this node's whole job. It's the [2/2] half of a two-node set - it doesn't do the inpainting itself, it makes the inpainting stick.
The two-node flow
McInpainty splits the classic crop-and-inpaint-and-paste pattern across two nodes:
- [1/2] Set Inpainting Tile by mask - takes your full image, a painted version, and the mask, crops and upscales the masked region into a tile, runs the sampler on it, and hands you an
ms_pipecarrying the tile, its mask, the inpainted result, and the source geometry. - [2/2] Paste Inpainting Tile by mask - this node - takes that pipe, re-applies a refinement pass to the tile if you want, composites it back into the source at a controlled opacity, and optionally runs one final polish pass over the whole image.
This is the "only-masked detail at full resolution" pattern the inpainting world converged on: a small region gets 1024px of generation budget, then gets pasted back so the rest of the frame never moved a pixel. If you've used the crop-and-stitch approach, this is the same idea with the seam-fixing built in.
The inputs that matter
ms_pipe- from the [1/2] node. Non-negotiable.image_tile/mask_tile- the tile and its mask, also passed through from [1/2]. If the mask is all zeros, the node short-circuits and passes everything through unchanged - handy when a detection found nothing.text_pos_inpaint/text_neg_inpaint- optional prompt text for the refine pass. The node carries its own prompts rather than reusing the [1/2] ones.subject_opacity(default 95) - how strongly the inpainted tile is composited over the original. 95 keeps a touch of the source showing through, which softens the boundary; 100 is a hard paste.sampler_refiner_tile(on) +steps/cfg/denoise/denoise_refine- the tile-refine stage. Defaults are 20 steps, CFG 8, initial denoise 0.51, then a gentledenoise_refineof 0.25 on the tile.sampler_refiner_image(on) +steps_refiner/cfg_refiner/denoise_refiner- the final whole-image polish: 10 steps atdenoise_refiner0.35. This is what knits the pasted tile's texture into the surrounding image so the boundary disappears.
Outputs
Ten outputs, but you'll live in two of them:
output_image- the composited image right after pasting.output_image_refined- after the final polish pass. This is the one you save.
The rest are diagnostics: image_inpainted, image (source), tile_output, tile_inpainted, tile_mask, tile_source, plus the text_pos_image_inpainted / text_neg_image_inpainted strings if you want to echo what was used.
Honest notes on the approach
The KB's inpainting guidance is the right mental model here: mask inpainting's remaining superpower is bit-identical unmasked pixels and a controllable denoise dial, and this node leans on both. The workflow's own defaults (denoise 0.51 β 0.25 tile β 0.35 final) are the classic "coarse fix, then blend-in" ladder. If you see a seam after a run, the fix is usually in denoise_refine (bump it slightly) or subject_opacity (drop toward 90 so the boundary feathers), not in redoing the whole pass.
Where people get burned: the tile and mask you feed must actually correspond to what [1/2] produced - swapping in a mismatched mask is the fastest way to a garbage paste. And remember the README credits this set's blend work to LayerStyle's approach, so the paste quality is real, but it's also the part that depends on the mask being honest.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes
Restart, or ComfyUI Manager β "MaraScott". The pack's requirements (including the image-blending deps) come with it; no models to fetch beyond what your inpainting checkpoint already needs. It's a two-node commitment - grab both halves of McInpainty, because this one does nothing without its [1/2] partner.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| ms_pipe | MS_INPAINTINGTILEBYMASK_PIPE | β | |
| image_tile | IMAGE | β | |
| mask_tile | MASK | β | |
| text_pos_inpaint | STRING | β | |
| text_neg_inpaint | STRING | β | |
| subject_opacity | INT | 950β100 | β |
| seed | INT | 40β18446744073709550000 | β |
| sampler_name | COMBO | 34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28 | |
| basic_scheduler | COMBO | 9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3 | |
| sampler_refiner_tile | BOOLEAN | true | β |
| steps | INT | 201β10000 | β |
| cfg | FLOAT | 8.00β100 | β |
| denoise | FLOAT | 0.510β1 | β |
| denoise_refine | FLOAT | 0.250β1 | β |
| sampler_refiner_image | BOOLEAN | true | β |
| steps_refiner | INT | 101β10000 | β |
| cfg_refiner | FLOAT | 8.00β100 | β |
| denoise_refiner | FLOAT | 0.350β1 | β |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| output_image_refined | IMAGE | β |
| output_image | IMAGE | β |
| image_inpainted | IMAGE | β |
| image | IMAGE | β |
| tile_output | IMAGE | β |
| tile_inpainted | IMAGE | β |
| tile_mask | MASK | β |
| tile_source | IMAGE | β |
| text_pos_image_inpainted | STRING | β |
| text_neg_image_inpainted | STRING | β |