ComfyUI Inpaint Nodes
Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.
Fooocus Inpaint
Adds two nodes which allow using Fooocus inpaint model. It's a small and flexible patch which can be applied to any SDXL checkpoint and will transform it into an inpaint model. This model can then be used like other inpaint models, and provides the same benefits.
Inpaint Conditioning
Fooocus inpaint can be used with ComfyUI's VAE Encode (for Inpainting) directly. However this does not allow using existing content in the masked area, denoise strength must be 1.0.
InpaintModelConditioning can be used to allow using inpaint models with existing content. The resulting latent can however not be used directly to patch the model using Apply Fooocus Inpaint. This repository adds a new node VAE Encode & Inpaint Conditioning which provides two outputs: latent_inpaint (connect this to Apply Fooocus Inpaint) and latent_samples (connect this to KSampler).
Inpaint Pre-processing
Several nodes are available to fill the masked area prior to inpainting. They avoid seams as long as the input mask is large enough.
Fill Masked
This fills the masked area, with a smooth transition at the border. It has 3 modes:
- neutral: fills with grey, good for adding entirely new content
- telea: fills with colors from surrounding border (based on algorithm by Alexandru Telea)
- navier-stokes: fills with colors from surrounding border (based on fluid dynamics described by Navier-Stokes)
Blur Masked
This blurs the image into the masked area. The blur is less strong at the borders of the mask. Good for keeping the general colors the same.
Inpaint Models (LaMA, MAT)
This runs a small, fast inpaint model on the masked area. Models can be loaded with Load Inpaint Model and are applied with the Inpaint (using Model) node. This works well for outpainting or object removal.
Comments
None