Unlock precise inpainting without additional training. LanPaint lets the model "think" through multiple iterations before denoising, aiming for seamless and accurate results.
- 🎨 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

View Workflow & Masks
Model Used in This Example

View Workflow & Masks
Model Used in This Example

View Workflow & Masks
Model Used in This Example

View Workflow & Masks
Model Used in This Example
How to Use These Examples:
- Navigate to the example folder (i.e example_1) by clicking View Workflow & Masks, download all pictures.
- Drag InPainted_Drag_Me_to_ComfyUI.png into ComfyUI to load the workflow.
- Download the required model from Civitai by clicking Model Used in This Example.
- Load the model into the "Load Checkpoint" node.
- Upload Original_No_Mask.png to the "Load image" node in the "Original Image" group (far left).
- Upload Masked_Load_Me_in_Loader.png to the "Load image" node in the "Mask image for inpainting" group (second from left).
- Queue the task, you will get inpainted results from three methods:
- VAE Encode for Inpainting (middle),
- Set Latent Noise Mask (second from right),
- LanPaint (far right).
Compare and explore the results from each method!
- Install ComfyUI: Follow the official ComfyUI installation guide to set up ComfyUI on your system.
- Install ComfyUI-Manager: Add the ComfyUI-Manager for easy extension management.
- Install LanPaint Nodes:
- Via ComfyUI-Manager: Search for "LanPaint" in the manager and install it directly.
- Manually: Click "Install via Git URL" in ComfyUI-Manager and input the GitHub repository link:
Alternatively, clone this repository into the
https://github.com/scraed/LanPaint.gitComfyUI/custom_nodesfolder.
- Restart ComfyUI: Restart ComfyUI to load the LanPaint nodes.
Once installed, you'll find the LanPaint nodes under the "sampling" category in ComfyUI. Use them just like the default KSampler for high-quality inpainting!
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 requires binary masks (values of 0 or 1) without opacity or smoothing. To ensure compatibility, set the mask's opacity and hardness to maximum in your mask editor. During inpainting, any mask with smoothing or gradients will automatically be converted to a binary mask.
- LanPaint relies heavily on your text prompts to guide inpainting - explicitly describe the content you want generated in the masked area. If results show artifacts or mismatched elements, counteract them with targeted negative prompts.
LanPaint KSampler
Simplified interface with recommended defaults:
- Steps: 50+ recommended
- LanPaint NumSteps: 1-10 (complexity of edits)
- Built-in parameter presets
LanPaint KSampler (Advanced)
Full parameter control:
| Parameter | Range | Description |
|---|---|---|
Steps |
0-100 | Total steps of diffusion sampling. Higher means better inpainting. Recommend 50. |
LanPaint_NumSteps |
0-20 | Reasoning iterations per denoising step ("thinking depth"). Easy task: 1-2. Hard task: 5-10 |
LanPaint_Lambda |
0.1-50 | Content alignment strength (higher = stricter). Recommend 6.0 |
LanPaint_cfg_BIG |
0-20 | CFG scale used when aligning masked and unmasked region (higher = better alignment). Recommend 8 for seamless inpaint (i.e limbs, faces), 0-1 for character consistency (i.e multiple view) |
For detailed descriptions of each parameter, simply hover your mouse over the corresponding input field to view tooltips with additional information.
For challenging inpainting tasks:
1️⃣ Primary Adjustments:
- Increase steps, LanPaint_NumSteps (thinking iterations), and LanPaint_cfg_BIG (guidance scale).
2️⃣ Secondary Tweaks:
- Boost LanPaint_Lambda (spatial constraint strength) or LanPaint_StepSize (denoising aggressiveness).
3️⃣ Balance Speed vs Stability:
- Reduce LanPaint_Friction to prioritize faster results with fewer "thinking" steps (may risk instability).
- Increase LanPaint_Tamed (noise normalization onto a sphere) or LanPaint_Alpha (constraint the friction of underdamped Langevin dynamics) to suppress artifacts.
- Optimal parameters vary depending on the model and the size of the inpainting area.
- For effective tuning, fix the seed and adjust parameters incrementally while observing the results. This helps isolate the impact of each setting.
Help us improve LanPaint! 🚀 Report bugs, share example cases, or contribute your personal parameter settings to benefit the community.