ComfyUI Node

LCMT2IAdapter

Drop a T2I-Adapter into the LCM pipeline

By taabata·Created 3 years ago·Updated 2 years ago· 259
LCMT2IAdapter
    • class
    T2Iadapter

    LCMT2IAdapter is a tiny loader that pulls a T2I-Adapter out of your models/controlnet folder and hands it to the generation nodes as a class output. It's the adapter counterpart to the pack's ControlNet path - think of T2I-Adapter as ControlNet's lightweight sibling: a small model that conditions generation on a reference's structure (edges, depth, sketch) without the heavier ControlNet stack. The README credits Michael Poutre's T2IAdapter work here, which is a nice touch.

    What it does

    One input, one output. The T2Iadapter dropdown is built from the subfolders of ComfyUI/models/controlnet - same convention as LCMLoader_controlnet's mode dropdown, so your adapter files need to live in their own folder there. The loader then does T2IAdapter.from_pretrained(model_id) and, notably, forces it onto CUDA regardless of what your main pipeline is doing. The output class wires into the adapter input on LCMGenerate_img2img, LCMGenerate_inpaintv2, or the img2img variants that take an adapter.

    Where it fits

    This loader exists to feed LCMGenerate_img2img's adapter/adapter_image/adapter_weight inputs. So the flow is: LCMLoader builds the pipe → LCMT2IAdapter loads the adapter → the generation node takes both, plus an adapter_image to condition on and an adapter_weight (default 1.0) to scale its influence. For inpaint specifically, LCMGenerate_inpaintv2 accepts the same adapter inputs alongside reference-only and ControlNet, so this is the node you use when you want structure guidance and the fast LCM 4-step sampling in one graph.

    Setup

    Same pack-level install as the rest:

    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 use ComfyUI Manager and search LCM_Inpaint-Outpaint_Comfy. Then make sure your T2I-Adapter is a diffusers-format folder inside ComfyUI/models/controlnet - if it's a loose .safetensors it won't show up in the dropdown at all.

    Two honest warnings

    First, the CUDA hardcoding: the loader calls .to(torch.device('cuda')) with no fallback. On a CPU-only box this node will just fail, so don't add this node to a CPU pipeline expecting it to degrade gracefully. Second, the usual pack caveats apply - Windows path quirks, and the fact that this is early-LCM-era code from late 2023. The author was one of the first people putting reference-only and adapter workflows around LCM out there, and this pack is where those ideas live. It works and it's a legitimately interesting way to do structural conditioning at 4 steps. Just know the modern, better-maintained route is native ComfyUI ControlNet with an LCM checkpoint - this node is for when you specifically want this pack's pipeline.

    CategoryLCM_Nodes/nodes

    Inputs (1)

    NameTypeDefaultDescription
    T2IadapterCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    classclass