Repolode
scraed

scraed/LanPaint

A training-free inpainting and outpainting sampler for ComfyUI that works with many diffusion and rectified-flow image and video models.

Open-source alternative to:Photoshop Generative Fill

Stars
1,466
Forks
55
Open issues
22
Last commit
24 days ago

What is it?

LanPaint is a sampler for ComfyUI that performs mask-constrained inpainting and outpainting on top of existing pretrained diffusion and rectified-flow models. It requires no fine-tuning or backpropagation. Its distinguishing feature is a "thinking" mode: the sampler runs several iterations on each denoising step, and the user can trade extra computation time for better inpainting quality.

The project's nodes are designed to slot into a standard ComfyUI workflow in place of the default KSampler. The repository lists support for a wide range of image models, including Flux, SD 3.5, SDXL, Qwen Image and Edit, Wan 2.2, Z-Image, and others. It also covers video inpainting and outpainting with Wan 2.2, plus a video mask editor and an audio-video pipeline for MiniMax H3.

The repository includes a paper published at TMLR 2025, a Diffusers implementation maintained separately, and example workflows for each supported model. Note that the project warns about degraded results on distilled models such as Flux.dev and recommends keeping mask values binary.

Key features

  • 01Training-free inpainting and outpainting that works with existing diffusion and rectified-flow models.
  • 02"Thinking" iterations per denoising step let users trade compute time for quality.
  • 03Drop-in replacement for the default ComfyUI KSampler, with basic and advanced variants.
  • 04Video inpainting and outpainting with Wan 2.2, plus a per-frame video mask editor.
  • 05Joint video and audio inpainting for the MiniMax H3 model.

Use cases

  • Removing or replacing objects and regions in generated or photographed images.
  • Extending the canvas of an image or video with outpainting.
  • Making targeted edits to a video across frames while keeping motion consistent.
  • Generating consistent character views by inpainting regions of an existing image.

Quick start

  1. 1

    Install ComfyUI following the official guide

  2. 2

    Install ComfyUI-Manager for extension management

  3. 3

    Install LanPaint nodes via ComfyUI-Manager by searching for LanPaint

  4. 4

    Restart ComfyUI to load the LanPaint nodes

Things to know

  • Runs only inside ComfyUI, so it is not a standalone tool.
  • Performance is degraded on distillation models such as Flux.dev, and low Flux guidance is recommended.
  • Licensed under GPL-3.0, a copyleft license that requires derivative works to be open source.

Topics

FAQ

What is LanPaint?
A training-free inpainting and outpainting sampler for ComfyUI that works with many diffusion and rectified-flow image and video models. LanPaint is a sampler for ComfyUI that performs mask-constrained inpainting and outpainting on top of existing pretrained diffusion and rectified-flow models. It requires no fine-tuning or backpropagation. Its distinguishing feature is a "thinking" mode: the sampler runs several iterations on each denoising step, and the user can trade extra computation time for better inpainting quality.
Is LanPaint free to use? What license does it have?
LanPaint is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is LanPaint still maintained?
Actively maintained. The last commit to LanPaint was on Sep 28, 2026.
What can I use LanPaint for?
Removing or replacing objects and regions in generated or photographed images. Extending the canvas of an image or video with outpainting. Making targeted edits to a video across frames while keeping motion consistent. Generating consistent character views by inpainting regions of an existing image.
How do I install LanPaint?
Install ComfyUI following the official guide Install ComfyUI-Manager for extension management Install LanPaint nodes via ComfyUI-Manager by searching for LanPaint Restart ComfyUI to load the LanPaint nodes
Where can I get LanPaint?
The source code and installation instructions are on GitHub: https://github.com/scraed/LanPaint

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects