← all repositories
scraed/LanPaint

Inpainting Sampler That Thinks Before It Paints

LanPaint gives any diffusion model a training-free inpainting upgrade by running extra "thinking" iterations before it commits to pixels.

LanPaint
Not currently ranked — collecting fresh signals.
star history

What it does

LanPaint is a ComfyUI extension that replaces the standard KSampler for inpainting and outpainting tasks. It works across dozens of base models—Flux, SDXL, Wan 2.2, HiDream, Qwen, and others—without retraining or LoRAs. Instead of blending existing pixels, it generates entirely new content inside the masked region by spending extra compute on iterative preconditioning steps.

The interesting bit

The sampler runs multiple “thinking” iterations before denoising, which the authors call asymptotically exact conditional sampling. In practice, this treats inpainting as a proper inference problem rather than relying on the usual VAE-encode or latent-noise-mask workarounds.

Key highlights

  • Drop-in node for ComfyUI; same workflow shape as the default KSampler
  • Supports image and video inpainting/outpainting, including recent additions for Wan 2.2, Z-Image, and Anima
  • Generates 100% new masked content instead of smoothing or partially denoising
  • Also works for character-consistency tasks beyond standard hole-filling
  • No training required; works with custom LoRAs and ControlNet stacks

Caveats

  • Distilled models like Flux.dev suffer degraded performance; the README recommends unusually low guidance (1.0–2.0) to compensate
  • Video inpainting beyond 40 frames is explicitly marked beta and gets unstable, with processing time increasing significantly
  • A bug fixed in v1.5.0 had been quietly blurring outputs, so older community comparisons may not reflect current quality

Verdict

Try it if you do heavy inpainting in ComfyUI and would rather burn GPU cycles than manage training pipelines. Look elsewhere if your workflow depends on distilled models or if you need reliable long-form video inpainting out of the box.

Frequently asked

What is scraed/LanPaint?
LanPaint gives any diffusion model a training-free inpainting upgrade by running extra "thinking" iterations before it commits to pixels.
Is LanPaint open source?
Yes — scraed/LanPaint is open source, released under the GPL-3.0 license.
What language is LanPaint written in?
scraed/LanPaint is primarily written in Python.
How popular is LanPaint?
scraed/LanPaint has 1.3k stars on GitHub.
Where can I find LanPaint?
scraed/LanPaint is on GitHub at https://github.com/scraed/LanPaint.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.