{"id":23233353,"url":"https://github.com/Acly/comfyui-inpaint-nodes","last_synced_at":"2025-08-19T18:31:42.657Z","repository":{"id":218922114,"uuid":"747648993","full_name":"Acly/comfyui-inpaint-nodes","owner":"Acly","description":"Nodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT, and various other tools for pre-filling inpaint \u0026 outpaint areas.","archived":false,"fork":false,"pushed_at":"2024-11-20T08:54:22.000Z","size":3206,"stargazers_count":720,"open_issues_count":19,"forks_count":45,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-13T23:53:30.755Z","etag":null,"topics":["comfyui","comfyui-nodes","inpainting","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Acly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T11:12:52.000Z","updated_at":"2024-12-13T21:32:48.000Z","dependencies_parsed_at":"2024-02-25T11:30:48.019Z","dependency_job_id":"c8c96926-36b4-4e55-95ea-43c2bc9d7774","html_url":"https://github.com/Acly/comfyui-inpaint-nodes","commit_stats":null,"previous_names":["acly/comfyui-inpaint-nodes"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acly%2Fcomfyui-inpaint-nodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acly%2Fcomfyui-inpaint-nodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acly%2Fcomfyui-inpaint-nodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Acly%2Fcomfyui-inpaint-nodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Acly","download_url":"https://codeload.github.com/Acly/comfyui-inpaint-nodes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230367780,"owners_count":18215325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comfyui","comfyui-nodes","inpainting","stable-diffusion"],"created_at":"2024-12-19T03:01:24.475Z","updated_at":"2024-12-19T03:01:44.633Z","avatar_url":"https://github.com/Acly.png","language":"Python","funding_links":[],"categories":["All Workflows Sorted by GitHub Stars","⭐ Community Favorites \u0026 Top Repos","Workflows (3395) sorted by GitHub Stars","Python"],"sub_categories":["🎭 Specialized Extensions"],"readme":"# ComfyUI Inpaint Nodes\n\nNodes for better inpainting with ComfyUI: Fooocus inpaint model for SDXL, LaMa, MAT,\nand various other tools for pre-filling inpaint \u0026 outpaint areas.\n\n\n## Fooocus Inpaint\n\nAdds two nodes which allow using [Fooocus](https://github.com/lllyasviel/Fooocus) inpaint model.\nIt's a small and flexible patch which can be applied to your _**SDXL** checkpoints_ and\nwill transform them into an inpaint model. This model can then be used like other inpaint\nmodels to seamlessly fill and expand areas in an image.\n\nDownload models from [lllyasviel/fooocus_inpaint](https://huggingface.co/lllyasviel/fooocus_inpaint/tree/main) and place them into `ComfyUI/models/inpaint`.\n\n![Inpaint workflow](media/inpaint.png)\n\n\u003e [!NOTE]\n\u003e \n\u003e Make sure to use the regular version of a checkpoint to create an inpaint model - distilled merges (Turbo, Lightning, Hyper) do not work.\n\n\n## Inpaint Conditioning\n\nFooocus inpaint can be used with ComfyUI's _VAE Encode (for Inpainting)_ directly. However this does\nnot allow existing content in the masked area, denoise strength must be 1.0.\n\n_InpaintModelConditioning_ can be used to combine inpaint models with existing content. The resulting\nlatent can however _not_ be used directly to patch the model using _Apply Fooocus Inpaint_. This repository\nadds a new node **VAE Encode \u0026 Inpaint Conditioning** which provides two outputs: `latent_inpaint` (connect\nthis to _Apply Fooocus Inpaint_) and `latent_samples` (connect this to _KSampler_).\n\nIt's the same as using both _VAE Encode (for Inpainting)_ and _InpaintModelConditioning_, but less overhead\nbecause it avoids VAE-encoding the image twice. [Example workflow](workflows/inpaint-refine.json)\n\n\n## Inpaint Pre-processing\n\nSeveral nodes are available to fill the masked area prior to inpainting. They avoid seams as long as the\ninput mask is large enough.\n\n### Expand Mask\n\nExpands (grow) the mask area by a certain number of pixels, and blurs (feather) the mask for a smoother transition at the edges.\n\n### Fill Masked\n\nThis fills the masked area, with a smooth transition at the border. It has 3 modes:\n* `neutral`: fills with grey, good for adding entirely new content\n* `telea`: fills with colors from surrounding border (based on algorithm by Alexandru Telea)\n* `navier-stokes`: fills with colors from surrounding border (based on fluid dynamics described by Navier-Stokes)\n\n| Input | Neutral | Telea | Navier-Stokes |\n|-|-|-|-|\n| ![input](media/preprocess-input.png) | ![neutral](media/preprocess-neutral.png) | ![telea](media/preprocess-telea.png) | ![ns](media/preprocess-navier-stokes.png)\n\n### Blur Masked\n\nThis blurs the image into the masked area. The blur is less strong at the borders of the mask.\nGood for keeping the general colors the same.\n\n| Input | Blur radius 17 | Blur radius 65 |\n|-|-|-|\n| ![input](media/preprocess-input.png) | ![blur-17](media/preprocess-blur-17.png) | ![blur-65](media/preprocess-blur-65.png) |\n\n### Inpaint Models (LaMA, MAT)\n\nThis runs a small, fast inpaint model on the masked area. Models can be loaded with **Load Inpaint Model**\nand are applied with the **Inpaint (using Model)** node. This works well for outpainting or object removal.\n\nThe following inpaint models are supported, place them in `ComfyUI/models/inpaint`:\n- [LaMa](https://github.com/advimman/lama) | [Model download](https://github.com/Sanster/models/releases/download/add_big_lama/big-lama.pt)\n- [MAT](https://github.com/fenglinglwb/MAT) | [Model download](https://github.com/Sanster/models/releases/download/add_mat/Places_512_FullData_G.pth) | [Model download (fp16 safetensors)](https://huggingface.co/Acly/MAT/resolve/main/MAT_Places512_G_fp16.safetensors)\n\n| Input | LaMa | MAT |\n|-|-|-|\n| ![input](media/preprocess-input.png) | ![lama](media/preprocess-lama.png) | ![mat](media/preprocess-mat.png) |\n\n\n## Inpaint Post-processing\n\n### Denoise to Compositing Mask\n\nTakes a _mask_, an _offset_ (default 0.1) and a _threshold_ (default 0.2).\nMaps mask values in the range of \\[_offset_ → _threshold_\\] to \\[0 → 1\\].\nValues below offset are clamped to 0, values above threshold to 1.\n\nThis is particularly useful in combination with ComfyUI's \"Differential Diffusion\" node, which allows to use a mask as per-pixel denoise strength.\nUsing the same mask for compositing (alpha blending) defeats the purpose, but no blending at all degrades quality in regions with zero or very low strength. This node creates a mask suitable for blending from the denoise-mask.\n\n\n## Example Workflows\n\nExample workflows can be found in [workflows](workflows).\n\n* **[Simple](https://raw.githubusercontent.com/Acly/comfyui-inpaint-nodes/main/workflows/inpaint-simple.json):** basic workflow, ignore previous content, 100% replacement\n* **[Refine](https://raw.githubusercontent.com/Acly/comfyui-inpaint-nodes/main/workflows/inpaint-refine.json):** advanced workflow, refine existing content, 1-100% denoise strength\n* **[Outpaint](https://raw.githubusercontent.com/Acly/comfyui-inpaint-nodes/main/workflows/outpaint.json):** workflow for outpainting with pre-processing\n* **[Pre-process](https://raw.githubusercontent.com/Acly/comfyui-inpaint-nodes/main/workflows/inpaint-preprocess.json):** complex workflow for experimenting with pre-processors\n* **[Promptless](https://raw.githubusercontent.com/Acly/comfyui-inpaint-nodes/main/workflows/inpaint-promptless.json):** same as above but without text prompt, requires [IP-Adapter](https://github.com/cubiq/ComfyUI_IPAdapter_plus)\n\n\n## Installation\n\nUse [ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager) and search for \"ComfyUI Inpaint Nodes\".\n\n_**or**_ download the repository and put the folder into `ComfyUI/custom_nodes`.\n\n_**or**_ use GIT:\n```\ncd ComfyUI/custom_nodes\ngit clone https://github.com/Acly/comfyui-inpaint-nodes.git\n```\n\nRestart ComfyUI after installing!\n\n---\n\nOpenCV is required for _telea_ and _navier-stokes_ fill mode:\n```\npip install opencv-python\n```\n\n## Acknowledgements\n\n* Fooocus Inpaint: [lllyasviel/Fooocus](https://github.com/lllyasviel/Fooocus)\n* LaMa: [advimman/lama](https://github.com/advimman/lama)\n* MAT: [fenglinglwb/MAT](https://github.com/fenglinglwb/MAT)\n* LaMa/MAT implementation: [chaiNNer-org/spandrel](https://github.com/chaiNNer-org/spandrel)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAcly%2Fcomfyui-inpaint-nodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAcly%2Fcomfyui-inpaint-nodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAcly%2Fcomfyui-inpaint-nodes/lists"}