LanPaint Sampler Custom (Advanced)
Full LanPaint control in the most modular sampling graph
- noise
- guider
- sampler
- sigmas
- latent_image
- output
- denoised_output
This is the power-user corner of LanPaint. It mirrors ComfyUI's SamplerCustomAdvanced - the most decomposed sampling node in the whole app, where noise, guidance, sampler, and schedule are all separate inputs - and layers LanPaint's masked-inpainting "think mode" on top, with every LanPaint dial exposed. If the plain LanPaint Sampler Custom felt too locked-down and the KSampler felt too monolithic, this is the one that gives you both maximum sampling flexibility and the full tuning trio.
You'd reach for it when you're already living in the custom-sampling world - building guiders by hand, feeding in RES4LYF samplers, doing something the KSampler's fixed layout can't express - and you want LanPaint inpainting without giving any of that up. It's the node the pack's Ideogram 4 example is built on, and it's genuinely obscure (essentially no search traffic yet), which usually just means it's new and aimed at people who already know what a GUIDER is.
How it works
Mechanism is unchanged from the rest of the pack: a few Langevin-dynamics "thinking" iterations before each denoise step reconcile the masked region with the fixed unmasked context. What changes is how much of the sampling pipeline you assemble yourself. Instead of model + positive + negative + cfg living on the sampler, the guidance is baked into a separate GUIDER object you build upstream. That's the SamplerCustomAdvanced philosophy - every stage is a swappable input - and LanPaint here is just the inpainting reasoning wrapped around it.
The inputs and outputs that matter
The four custom-sampling inputs are the part that trips people up, because they come from other nodes rather than being widgets:
noise(aNOISE) - from RandomNoise (or DisableNoise). This is where your seed lives now.guider(aGUIDER) - from BasicGuider, CFGGuider, or DualCFGGuider. Your model and your positive/negative conditioning live in here, which is why you won't find them on this node. Set your CFG inside the guider.sampler(aSAMPLER) andsigmas(aSIGMAS) - the algorithm and the noise schedule, same as any custom-sampling graph. Plus alatent_imagecarrying the image and its mask.
Then, unlike the basic Custom node, the full LanPaint control set is here: LanPaint_NumSteps (thinking depth, default 5 - the main dial), LanPaint_Lambda (alignment strength, ships at 16), LanPaint_StepSize (default 0.2), LanPaint_Beta (default 1), LanPaint_Friction (default 15), LanPaint_EarlyStop (default 1), and LanPaint_PromptMode. For a beginner the honest advice is: move NumSteps and Lambda first, leave the rest at defaults until something specifically misbehaves.
Two outputs: output (the sampled LATENT for VAE Decode) and denoised_output (the clean fully-denoised LATENT).
How to install it
ComfyUI Manager → search "LanPaint" → install → restart, or "Install via Git URL" with https://github.com/scraed/LanPaint.git. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/scraed/LanPaint, then restart (ComfyUI newer than 0.3.11). No model downloads or heavy dependencies for the node itself; the base model you're inpainting into is your responsibility, and if you're plugging in third-party samplers like RES4LYF, install that pack too. It appears under "sampling/custom_sampling".
Common issues & troubleshooting
- "There's no CFG / prompt input." Correct - they're inside the
GUIDER. Build a CFGGuider (or BasicGuider) with your model and conditioning, set CFG there, and feed it in. This is the number-one confusion with SamplerCustomAdvanced-style nodes. - Karras or exponential on a flow-matching base. Your
sigmascome from a scheduler node, and Karras/exponential fail on Flux, Z-Image and similar - use beta or simple. Wrong schedule here breaks the whole inpaint. - Too many knobs, results getting worse. Fix the seed (in RandomNoise), change one LanPaint dial at a time, and judge on a small batch. That's the pack's own tuning discipline, and it's the only sane way through this many parameters.
- Pack-wide gotchas still apply. Binary masks (max hardness), prompt-driven fills, slow runtime from
NumSteps, degraded quality on distilled models (low Flux guidance 1.0–2.0), and z-image-base wanting a smallStepSizeand few thinking steps or it diverges. And if the unmasked area shifts, composite with LanPaint Mask Blend.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| noise | NOISE | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| latent_image | LATENT | — | |
| LanPaint_NumSteps | INT | 50–100 | Number of steps for Langevin dynamics, representing turns of thinking per step. |
| LanPaint_Lambda | FLOAT | 16.00.1–50 | Bidirectional guidance scale. Higher values align with known regions but may cause instability. |
| LanPaint_StepSize | FLOAT | 0.200.0001–1 | Step size for Langevin dynamics. Higher values speed convergence but may be unstable. |
| LanPaint_Beta | FLOAT | 1.00.0001–5 | Step size ratio between masked/unmasked regions. Lower values balance high Lambda. |
| LanPaint_Friction | FLOAT | 15.00–50 | Friction parameter for fast Langevin. Lower values speed convergence but may be unstable. |
| LanPaint_PromptMode | COMBO | Image First: prioritizes image quality; Prompt First: prioritizes prompt adherence. | |
| LanPaint_EarlyStop | INT | 10–10000 | Steps to stop LanPaint early, preventing irregular patterns. |
| LanPaint_Info | STRING | LanPaint Custom Sampler Adv. | For more info, visit https://github.com/scraed/LanPaint. If you find it useful, please give a star ⭐️! |
| LanPaint_InnerThreshold | FLOAT | 0.00000–1 | Early stop threshold for Langevin iterations based on semantic distance. 0.0 to disable. (Contributed by godnight10061) |
| LanPaint_InnerPatience | INT | 11–100 | Number of consecutive steps below threshold required to stop. (Contributed by godnight10061) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| denoised_output | LATENT | — |