A training-free inpainting and outpainting sampler for ComfyUI that works with many diffusion and rectified-flow image and video models.
lquesada/ComfyUI-Inpaint-CropAndStitch
ComfyUI nodes that crop the masked area before sampling and stitch the inpainted result back, making inpainting faster and more controllable.
- Stars
- 1,209
- Forks
- 86
- Open issues
- 0
- Last commit
- yesterday
What is it?
ComfyUI-Inpaint-CropAndStitch is a pair of ComfyUI custom nodes: an Inpaint Crop node that cuts the image down to the masked region with optional context, and an Inpaint Stitch node that places the sampled result back into the original image. Only the masked area is sent through the sampler, so inpainting runs faster than processing the whole picture, and the unmasked pixels are left untouched, including no VAE round trip.
The crop node can also pre-resize the input, extend the canvas for outpainting, fill mask holes, grow or blur the mask, and resize the crop to a fixed target resolution such as 1024x1024 for SDXL or Flux. The stitch node blends the edges automatically. Crops can be upscaled with any model and then stitched back, and the node supports GPU processing for speed.
Key features
- 01Crops the image around the mask, with adjustable context area.
- 02Stitches the inpainted result back without altering unmasked pixels.
- 03Resizes the crop to a target resolution for models like SDXL or Flux.
- 04Fills mask holes, grows, and blurs masks, with automatic edge blending.
- 05Supports outpainting by extending the canvas and optional GPU processing.
Use cases
- Fixing faces or small details in large images without resampling the whole picture.
- Inpainting at a fixed model resolution while keeping the original image's full size.
- Upscaling a masked region with a hires fix and blending it back into the source.
- Outpainting by extending an image's borders before sampling.
Quick start
- 1
Install via ComfyUI-Manager, or clone the repo into ComfyUI's custom_nodes directory
git clone https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch.git - 2
Restart ComfyUI and add the Inpaint Crop and Inpaint Stitch nodes to your workflow
Things to know
- Licensed under GPL-3.0, a copyleft license that requires derivative works to be open-sourced under the same terms.
- Best results need an inpainting model, and the Flux example needs extra model files and the GGUF nodes.
In collections
Topics
FAQ
- What is ComfyUI-Inpaint-CropAndStitch?
- ComfyUI nodes that crop the masked area before sampling and stitch the inpainted result back, making inpainting faster and more controllable. ComfyUI-Inpaint-CropAndStitch is a pair of ComfyUI custom nodes: an Inpaint Crop node that cuts the image down to the masked region with optional context, and an Inpaint Stitch node that places the sampled result back into the original image. Only the masked area is sent through the sampler, so inpainting runs faster than processing the whole picture, and the unmasked pixels are left untouched, including no VAE round trip.
- Is ComfyUI-Inpaint-CropAndStitch free to use? What license does it have?
- ComfyUI-Inpaint-CropAndStitch is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
- Is ComfyUI-Inpaint-CropAndStitch still maintained?
- Actively maintained. The last commit to ComfyUI-Inpaint-CropAndStitch was on Oct 21, 2026.
- What can I use ComfyUI-Inpaint-CropAndStitch for?
- Fixing faces or small details in large images without resampling the whole picture. Inpainting at a fixed model resolution while keeping the original image's full size. Upscaling a masked region with a hires fix and blending it back into the source. Outpainting by extending an image's borders before sampling.
- How do I install ComfyUI-Inpaint-CropAndStitch?
- Install via ComfyUI-Manager, or clone the repo into ComfyUI's custom_nodes directory: git clone https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch.git Restart ComfyUI and add the Inpaint Crop and Inpaint Stitch nodes to your workflow
- Where can I get ComfyUI-Inpaint-CropAndStitch?
- The source code and installation instructions are on GitHub: https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Krita plugin that brings generative AI image creation, inpainting and outpainting into your painting workflow, backed by a local or cloud ComfyUI server.
Offline, open-source image generator built on Stable Diffusion XL that lets you focus on prompts instead of manual parameter tuning.
A web-based creative engine for generating and editing images with Stable Diffusion and other AI models, featuring a unified canvas and node-based workflows.
Desktop package manager and inference UI that installs, updates and launches many Stable Diffusion web UIs such as ComfyUI, Forge and Fooocus.
A modular web UI for AI image, video and audio generation, built on Stable Diffusion, Flux, Wan and other models, with a ComfyUI workflow tab.