Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.
Profil du package
LIREMOI
Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint & outpaint areas.
Adds two nodes which allow using Fooocus inpaint model. It's a small and flexible patch which can be applied to your and will transform them into an inpaint model. This model can then be used like other inpaint models to seamlessly fill and expand areas in an image.
Ressources connexes
5 connexionsSources
3 sourcesExtraits de sources
1 extraitSource context: Repo Acly/comfyui-inpaint-nodes
Download models from lllyasviel/fooocus_inpaint and place them into ComfyUI/models/inpaint.
Inpaint workflow
[!NOTE]
Make sure to use the regular version of a checkpoint to create an inpaint model - distilled merges (Turbo, Lightning, Hyper) do not work.
Fooocus inpaint can be used with ComfyUI's VAE Encode (for Inpainting) directly. However this does not allow existing content in the masked area, denoise strength must be 1.0.
InpaintModelConditioning can be used to combine 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).
It's the same as using both VAE Encode (for Inpainting) and InpaintModelConditioning, but less overhead because it avoids VAE-encoding the image twice. Example workflow
Several nodes are available to fill the masked area prior to inpainting. They avoid seams as long as the input mask is large enough.
Expands (grow) a binary mask by a certain number of pixels, and optionally blurs (feather) the mask for a smoother transition at the edges.
Shrinks (erodes) a binary mask by a certain number of pixels, and optionally blurs (feather) the mask for a smoother transition at the edges.
Maps mask values very close to 1 to be exactly 1.0. This helps avoid numerical issues introduced by previous operations. ComfyUI in various steps only considers noise masks to be opaque when they are >= 1.0 (eg. via round), and values like 0.9999... can lead to masks not working at all.
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 contenttelea: 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)| Input | Neutral | Telea | Navier-Stokes |
|---|---|---|---|
| input | neutral | telea | ns |
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.
| Input | Blur radius 17 | Blur radius 65 |
|---|---|---|
| input | blur-17 | blur-65 |
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.
The following inpaint models are supported, place them in ComfyUI/models/inpaint:
Nœuds dans ce pack
Nœuds 13Vérifié 11 sept.
Vérifié 11 sept.