About this project

LanPaint is a ComfyUI extension that provides a training-free partial conditional sampler for mask-constrained inpainting and local editing. It works with pretrained diffusion and rectified-flow models without fine-tuning or backpropagation. The project is based on the TMLR 2025 paper "LanPaint: Training-Free Diffusion Inpainting with Asymptotically Exact and Fast Conditional Sampling." Key capabilities include image inpainting, outpainting and generative fill, mask-constrained local editing, object or region replacement with text guidance, character-consistent local generation, video inpainting and local video editing, and video plus audio masked generation. The README lists compatibility with models such as Ideogram4, Krea2, Z-image, Z-image-base, Hunyuan, Wan 2.2, Qwen Image/Edit, Anima, HiDream, SD 3.5, Flux-series, SDXL, SD 1.5, and custom LoRAs. LanPaint adds ComfyUI nodes under the sampling category, including a basic sampler and an advanced sampler with tuning options. It also provides a video mask editor for painting per-frame masks on video with interpolation between keyframes, and a MiniMax H3 AV pipeline that encodes video and audio into a nested latent for combined inpainting. The editor can export masks into mp4 metadata without modifying the original file. The repository includes many example workflows with before/after comparisons, model download links, and resource consumption tables for video processing. Installation is available through ComfyUI-Manager or by cloning the repository into ComfyUI/custom_nodes. The README notes degraded performance on distillation models such as Flux.dev and recommends low flux guidance to mitigate this.