ComfyUI Node

LCM Sampler

The original 4-step speed node, and it knows it's dated

By 0xbitches·Created 3 years ago·Updated 3 years ago· 263
LCM Sampler
    • IMAGE
    seed0
    steps4
    cfg8.0
    height512
    width512
    num_images1
    use_fp16true
    positive_prompt

    Before ComfyUI shipped native LCM scheduling, this was how you got Latent Consistency Model speed: one self-contained node that runs the whole diffusers LCM pipeline internally and hands back a finished image in four steps instead of the usual twenty-plus. It was a real event when it landed in October 2023 - the launch thread on r/StableDiffusion had people reporting startling numbers, one claiming around 10 images/sec on a 4090 using only about 4GB of VRAM, because the node skips ComfyUI's own checkpoint loading entirely and talks straight to HuggingFace's diffusers library.

    Worth knowing before you build around it: the author put an archival notice at the top of the README. ComfyUI has since added LCM scheduling natively, and the maintainer's own advice now is to use that instead. This repo still works, but it's frozen at its original 2023 implementation. Good reason to reach for it anyway - it's dead simple (no checkpoint loader, no separate VAE decode, type a prompt and get an image back) and it's genuinely fast. Bad reason - expecting current-gen quality or flexibility. This is LCM as it shipped in 2023, locked to one checkpoint.

    How it works

    LCM is a distilled model: trained to jump straight to a finished denoise in a handful of steps instead of iterating through 20-50 like a normal SD checkpoint. This node doesn't apply that trick to whatever checkpoint you have loaded - it loads one specific model, LCM_Dreamshaper_v7, through diffusers' own pipeline, and runs the entire txt2img loop (encode, sample, decode) inside itself. That's why it takes no MODEL or VAE input at all. You don't wire a checkpoint loader into this - you just give it a prompt.

    The inputs and outputs that matter

    positive_prompt is plain text - there's no negative prompt slot, since LCM's guidance is mostly baked into the model during distillation. Then the numbers: steps (default 4, designed for the 4-8 range - cranking it to 20 doesn't buy quality, it adds artifacts), cfg (default 8 in the widget, but don't trust that - LCM was distilled with the teacher's guidance already baked in, so it wants CFG around 1-2; leaving it at 8 oversaturates and over-contrasts the result), width/height (locked to 512-768, this is SD1.5-class), num_images (batch several at once - cheap to do when every image is this fast, good for farming seeds), and use_fp16 (leave it on; half precision is most of why VRAM stays low). The single output is IMAGE, a finished, decoded image ready for a Save or Preview node.

    Installing it

    Clone it into custom_nodes/: git clone https://github.com/0xbitches/ComfyUI-LCM, then restart ComfyUI. Or search "Latent Consistency Model for ComfyUI" in ComfyUI Manager if you'd rather skip the terminal. There's no model file to hunt down - the first run auto-downloads LCM_Dreamshaper_v7 into your HuggingFace cache (~/.cache/huggingface/hub/), so your first generation will pause to pull a few gigabytes.

    Common issues

    Two real ones worth knowing up front. The README documents a tokenizer error - Non-consecutive added token '<|startoftext|>' - caused by a mismatched cached tokenizer version; the fix is hand-editing added_tokens.json in the cached model folder to reorder the two token IDs (the README has the exact JSON to paste in). Second, and this came up repeatedly in the original launch thread: people, mostly on Windows, hitting FileNotFoundError/PermissionError around .../hub/models--SimianLuo--LCM_Dreamshaper_v7/refs/main on first download - usually a stale or locked cache folder. Deleting that specific model folder from the HF cache and letting it redownload clears it for most people. And since this node pulls in diffusers rather than reusing ComfyUI's own model stack, if you've got other diffusers-based custom nodes installed, keep an eye out for the classic ComfyUI dependency fight - every custom node shares one Python environment, and a stray pip install for one package can quietly break another node's pinned version.

    Categorysampling

    Inputs (8)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000
    stepsINT41–10000
    cfgFLOAT8.00–100
    heightINT512512–768
    widthINT512512–768
    num_imagesINT11–64
    use_fp16BOOLEANtrue
    positive_promptSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE