ComfyUI-Inpaint-CropAndStitch  by lquesada

ComfyUI nodes for optimized inpainting workflows

created 1 year ago
769 stars

Top 46.3% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides ComfyUI nodes for efficient inpainting by cropping the masked area, processing it, and then stitching the result back into the original image. It targets users of ComfyUI who want to speed up inpainting workflows, improve prompt accuracy, and control resolution for detailed generation or artifact avoidance.

How It Works

The core functionality is split between two nodes: 'Inpaint Crop' and 'Inpaint Stitch'. 'Inpaint Crop' intelligently extracts the masked region, optionally expanding it for context, resizing it to a target resolution (including downscaling to prevent artifacts or upscaling for detail), and handling mask adjustments like filling holes or expanding boundaries. The 'Inpaint Stitch' node then seamlessly integrates the processed inpainted region back into the original image, preserving unmasked areas and automatically blending the seams. This approach optimizes processing by focusing only on the relevant area, unlike full-image sampling.

Quick Start & Requirements

  • Install via ComfyUI-Manager or git clone https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch.git into custom_nodes/.
  • Requires ComfyUI.
  • Example workflows are provided for Stable Diffusion, Flux, and high-resolution inpainting.

Highlighted Details

  • Significantly faster than full-image inpainting.
  • Allows precise context control for improved prompt adherence.
  • Enables upscaling before sampling for enhanced detail.
  • Supports downscaling to mitigate common artifacts like double heads.
  • Facilitates forcing specific resolutions (e.g., 1024x1024 for SDXL).
  • Preserves unmasked image areas and handles seamless blending.
  • Recent improvements include more precise stitching, optimized cropping order, and better handling of image extensions.

Maintenance & Community

  • Actively maintained with frequent updates and improvements noted in the changelog.
  • Uses code from other ComfyUI custom nodes, also under GPLv3.

Licensing & Compatibility

  • Licensed under GNU GENERAL PUBLIC LICENSE Version 3.
  • As a derivative work of GPLv3-licensed code, this project is also GPLv3. This license may impose copyleft restrictions on derivative works, potentially requiring them to also be open-sourced under GPLv3 if distributed.

Limitations & Caveats

The project relies on ComfyUI and its ecosystem. While the nodes are designed for precision, complex mask manipulations or extreme resizing factors might still require careful parameter tuning.

Health Check
Last commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
4
Star History
116 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.