d1504d803443e7795e54e0f957cc2188001ecccb
LanPaint
Powerful Training Free Inpainting Tool Works for Every SD Model. Official Implementation of "Lanpaint: Training-Free Diffusion Inpainting with Exact and Fast Conditional Inference".
Features
- 🎨 Zero-Training Inpainting - Works immediately with ANY SD model, even custom models you've trained yourself
- 🛠️ Simple Integration - Same workflow as standard ComfyUI KSampler
- 🚀 Quality Enhancements - High quality and seamless inpainting
Example Results
Example 1 (LanPaint K Sampler)
Example 2: (LanPaint K Sampler (Advanced))
Example 3: (LanPaint K Sampler (Advanced))
Each example includes:
- Original masked image
- Full ComfyUI workflow
Quickstart
- Install ComfyUI.
- Install ComfyUI-Manager
- Look up this extension in ComfyUI-Manager. If you are installing manually, clone this repository under
ComfyUI/custom_nodes. - Restart ComfyUI.
Installation
- Place
LanPaint_Nodes.pyin yourComfyUI/custom_nodesfolder - Restart ComfyUI
- Use like regular KSampler with inpainting workflows
Usage
Workflow Setup
Same as default ComfyUI KSampler - simply replace with LanPaint KSampler nodes. The inpainting workflow is the same as the SetLatentNoiseMask inpainting workflow.
Note LanPaint only support binary mask (0,1) with no smoothing. Any mask with smooting will be converted to binary mask during inpainting.
Advanced Options (Optional)
Fine-tune results with these key parameters:
| Parameter | Typical Range | Effect |
|---|---|---|
NumSteps |
1-10 | Thinking iterations per step |
Lambda |
4-8 | Content preservation strength |
StepSize |
0.05-0.2 | Detail refinement intensity |
Citation
If you use LanPaint in your research or projects, please cite our work:
@misc{zheng2025lanpainttrainingfreediffusioninpainting,
title={Lanpaint: Training-Free Diffusion Inpainting with Exact and Fast Conditional Inference},
author={Candi Zheng and Yuan Lan and Yang Wang},
year={2025},
eprint={2502.03491},
archivePrefix={arXiv},
primaryClass={eess.IV},
url={https://arxiv.org/abs/2502.03491},
}
Languages
Python
73.6%
JavaScript
26.4%


