Nodes/LCM_Inpaint_Outpaint_Comfy/LCMLoraLoader_inpaint
ComfyUI Node

LCMLoraLoader_inpaint

Turns any diffusers SD 1.5 model into a fast LCM inpaint rig

By taabata·Created 3 years ago·Updated 2 years ago· 259
LCMLoraLoader_inpaint
    • class
    device
    tomesd_value0.60
    ip_adapter
    reference_only
    ip_adapter_model
    model_name
    controlnet_model

    The LCMLora line of this pack is where the author caught up with the LCM-LoRA breakthrough, and this is the loader half of it. Instead of forcing the dedicated LCM_Dreamshaper_v7 checkpoint, LCMLoraLoader_inpaint takes any SD 1.5 model you've stored as a diffusers folder and makes it an LCM inpaint machine: it loads your base model, a ControlNet, an optional IP-Adapter, and the shared LCM-LoRA (pytorch_lora_weights.safetensors), fuses the LoRA into the model, and hands the finished pipeline to LCMLora_inpaint / LCMLora_inpaintV2 on a class wire.

    That's the idea that won in the real world, by the way. The dedicated LCM checkpoint approach of the older loaders is fine but limits you to one model. Here, whatever you like to generate with can suddenly run at 4 steps. There is a quality trade - distillation always costs a bit of fidelity - but for iteration speed it's the right deal.

    How it works

    At load time it does five things: pick the base model from the model_name dropdown (subfolders of models/diffusers/), load a ControlNetModel from the folder you pick in controlnet_model, optionally load_ip_adapter from models/controlnet/IPAdapter/models/, load and fuse_lora the LCM-LoRA from models/loras/, then patch ToMe and enable CPU offload on GPU. It also looks for an AutoencoderTiny (models/vae/taesd) and uses it for fast preview decode when present.

    Two pipeline classes are used depending on toggles: reference_only enabled picks LCM_inpaint_final, otherwise LCM_lora_inpaint_ipadapter. That's why the two toggles below change what the generate node can do.

    The inputs that matter

    • model_name - dropdown of diffusers folders in models/diffusers/. Your base model.
    • controlnet_model - dropdown of folders in models/controlnet/. Required - it's always loaded, there's no "none".
    • ip_adapter - disable/enable. Enable requires an ip_adapter_model selected from the dropdown of files in models/controlnet/IPAdapter/models/.
    • reference_only - disable/enable. Picks which pipeline class gets built.
    • device - GPU/CPU. GPU gets sequential CPU offload; use CPU if you want the generate node's Compel prompt weighting.
    • tomesd_value - ToMe ratio, 0.6 default.

    Output: the class pipeline wire for LCMLora_inpaint or LCMLora_inpaintV2.

    How to install it

    One pack install covers it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/taabata/LCM_Inpaint-Outpaint_Comfy
    cd LCM_Inpaint-Outpaint_Comfy
    pip install -r requirements.txt
    

    Or ComfyUI Manager → "LCM_Inpaint_Outpaint_Comfy" → restart. Then the model stack: your base SD 1.5 model as a diffusers folder in models/diffusers/, the LCM-LoRA file pytorch_lora_weights.safetensors in models/loras/ (from the latent-consistency/lcm-lora-sdv1-5 repo), a ControlNet folder in models/controlnet/, optional IP-Adapter model in models/controlnet/IPAdapter/models/, optional TAESD in models/vae/taesd.

    Common issues

    The single most common failure across the whole Lora line: the loader hardcodes the path models/loras/pytorch_lora_weights.safetensors. If that file isn't there, load fails with a file-not-found that can look cryptic. Download it before anything else.

    Second: controlnet_model always loads a ControlNet - with an empty models/controlnet/, the dropdown has no "none" option and the node can't even configure cleanly. Keep at least one model folder around.

    And as always in this pack: Windows path issues lurk, and the IP-Adapter dropdown only populates if the file lives in exactly models/controlnet/IPAdapter/models/.

    CategoryLCM_Nodes/nodes

    Inputs (7)

    NameTypeDefaultDescription
    deviceCOMBO2 options: GPU, CPU
    tomesd_valueFLOAT0.600–1
    ip_adapterCOMBO2 options: disable, enable
    reference_onlyCOMBO2 options: disable, enable
    ip_adapter_modelCOMBO0 options:
    model_nameCOMBO0 options:
    controlnet_modelCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    classclass