ComfyUI Node

LCMLoader_img2img

The no-frills LCM img2img loader

By taabata·Created 3 years ago·Updated 2 years ago· 259
LCMLoader_img2img
    • class
    device
    model_path
    tomesd_value0.6

    LCMLoader_img2img is the plainest node in the whole LCM pack, and that's its appeal. No ControlNet, no reference image, no IP-Adapter - just a diffusers-format LCM model loaded into an img2img pipeline so you can feed an image in, push a prompt, and get a reinterpretation in 4 steps instead of 30. If you're trying to understand what the rest of the pack is doing, start here: everything else is this loader plus one more knob.

    It pairs with the pack's LCMGenerate_img2img node, which is the thing that actually runs the generation. The loader just hands it a ready-to-go pipeline on a single class wire.

    How it works

    Like the other LCMLoader_* nodes, it loads a diffusers-format model component by component - VAE, text encoder, tokenizer, UNet - from ComfyUI/models/diffusers/, defaults to the LCM_Dreamshaper_v7 folder if you leave model_path empty. It swaps in an LCMScheduler_X tuned for latent consistency inference (the reason this whole thing works in ~4 steps), applies ToMe at the ratio you set, and on GPU enables xformers attention plus sequential CPU offload so it fits in low VRAM.

    That's the whole story. It's a loader; the mechanism is "assemble the pipeline, apply the speed tricks, hand it over."

    The inputs that matter

    • device - GPU or CPU. GPU gets xformers + sequential offload; CPU runs float32. Only reach for CPU if you're using prompt weighting, which this pack only supports on CPU.
    • model_path - empty means models/diffusers/LCM_Dreamshaper_v7. This must point at a diffusers folder with unet/, vae/, text_encoder/ inside - a .safetensors checkpoint will not work, and that trips up people used to normal ComfyUI loaders.
    • tomesd_value - ToMe token-merging ratio, default 0.6. 0 disables it. It's the pack's built-in speed dial: a small quality trade for noticeably faster iteration.

    The output is a class-typed pipeline object. Wire it into LCMGenerate_img2img (the node that takes a pipe input plus your image, prompt, width/height, steps and CFG).

    How to install it

    Same as every node in this pack - install the pack once, get all of them:

    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 via ComfyUI Manager (search "LCM_Inpaint_Outpaint_Comfy"), then restart. Then download LCM_Dreamshaper_v7 in diffusers format from HuggingFace (SimianLuo/LCM_Dreamshaper_v7) and drop the folder - named exactly LCM_Dreamshaper_v7 - into ComfyUI/models/diffusers/.

    Common issues

    The standard failure is the "couldn't connect to huggingface.co … not the path to a directory containing a config.json" error, which means the model folder isn't where the loader expects it. Double-check the folder name and that it's the diffusers build, not a safetensors.

    Settings worth knowing: this pack's LCM generation likes a low CFG (around 1.8) and 4–8 steps - crank CFG to 8 like you would for a normal SD workflow and you'll get crunchy, overcooked results. That's an LCM thing, not a bug in the node.

    Honest note: if your only goal is fast img2img, modern ComfyUI can do LCM-LoRA with native loaders and KSampler with less setup. This node's job is to stay inside this pack's workflow files, where it's the reliable, boring backbone - and boring here is a compliment.

    CategoryLCM_Nodes/nodes

    Inputs (3)

    NameTypeDefaultDescription
    deviceCOMBO2 options: GPU, CPU
    model_pathSTRING
    tomesd_valueFLOAT0.60–1

    Outputs (1)

    NameTypeDescription
    classclass