LCMLoader_RefInpaint
Restyle a masked region by example, at LCM speed
- class
LCMLoader_RefInpaint is the combination node: reference-only conditioning and inpainting in one pipeline. Where LCMLoader_ReferenceOnly restyles a whole image and LCMLoader just inpaints, this one lets you say "keep everything except this masked patch, and make that patch look like the reference image" - which is the workflow you want for outfit swaps on a fixed scene, matching a new object's lighting to a reference, or extending a painting's style into a newly masked area. All of it still runs in the pack's usual 4-ish steps.
It builds a LatentConsistencyModelPipeline_refinpaint - the pack's custom reference+inpaint pipeline - and hands it to the LCMGenerate_inpaintv2 node, which accepts both the mask_image and a ref_image at generation time.
How it works
Same skeleton as every loader in this pack: it pulls the VAE, text encoder, tokenizer and UNet out of a diffusers-format base model, swaps in the LCMScheduler_X, applies ToMe, and on GPU enables xformers plus sequential CPU offload. The difference is entirely in which pipeline class it instantiates - refinpaint - which routes both the reference-image attention and the masked-region logic through the same forward pass. That's why the reference and the mask are handled together rather than as two separate passes: you can restyle a specific region without touching the rest of the frame.
Because it doesn't load a ControlNet, the INPUT_TYPES are just the three you already know from the other loaders.
The inputs that matter
device-GPUorCPU. GPU gets xformers + sequential CPU offload; pick CPU only for the pack's prompt-weighting feature, which is GPU-broken.model_path- leave empty for the defaultmodels/diffusers/LCM_Dreamshaper_v7, or point it at another diffusers-format model folder. Safetensors checkpoints don't work here.tomesd_value- ToMe token-merging ratio, default 0.6, 0 = off.
The single class output is the pipeline; wire it into LCMGenerate_inpaintv2, where you set the actual generation fields (prompt, mask, reference image, reference_style_fidelity, strength, steps, CFG).
How to install it
It's part of taabata/LCM_Inpaint-Outpaint_Comfy, so one install covers every node in the pack. ComfyUI Manager → search "LCM_Inpaint_Outpaint_Comfy", or:
cd ComfyUI/custom_nodes
git clone https://github.com/taabata/LCM_Inpaint-Outpaint_Comfy
cd LCM_Inpaint-Outpaint_Comfy
pip install -r requirements.txt
Restart ComfyUI. Then put the diffusers-format LCM_Dreamshaper_v7 folder in ComfyUI/models/diffusers/. No ControlNet or extra files needed for this one.
Common issues
The usual suspects apply: the "not the path to a directory containing a config.json" error means the model folder isn't in place or isn't the diffusers build, and the README's Windows path warning is worth heeding - the code normalizes / vs \ in most but not all spots.
For quality, the two knobs that matter live on the generate side: reference_style_fidelity (how hard the output copies the reference's look, 0–1) and strength (how much of the original image survives under the mask). Start around 0.5 fidelity and tune from there - and keep CFG low (~1.8) and steps in the 4–8 range, because that's what the LCM scheduler is tuned for.
Worth saying plainly: mask-based inpainting is a much smaller corner of the hobby in 2026 than it was in 2023, and most people reaching for an edit now use instruction models. But for the thing this node does - regenerate a masked patch by example while leaving the rest of the frame bit-identical - it's still a legitimate tool, and it's the one this pack's workflow files expect.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| device | COMBO | 2 options: GPU, CPU | |
| model_path | STRING | — | |
| tomesd_value | FLOAT | 0.60–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| class | class | — |