Replicate fofr/latent-consistency-model
Fast LCM generation with ControlNet
- image
- control_image
- IMAGE
LCM - Latent Consistency Models - was the first distillation approach cheap enough for the whole community to adopt, the thing that made real-time and near-instant generation normal. It jumps to a result in a handful of steps instead of the usual 20-50. This node, from fofr, wraps an LCM model that also takes an input image (img2img) and a ControlNet control image, and runs it on Replicate's cloud via ComfyUI-Replicate.
It's more than a bare text-to-image node - the img2img and Canny-ControlNet inputs make it a small pipeline in one box: generate from scratch, transform an existing image, or guide the output with edges.
How it works
LCM learns to predict the final image directly by solving the diffusion ODE in latent space, collapsing many steps into a few. That's why it defaults to 8 steps and low guidance - the same distilled-model rules as Lightning and Hyper-SD: keep steps low and CFG modest or you'll fight the baked-in guidance. This node adds optional img2img (image + prompt_strength) and a Canny ControlNet path (control_image + conditioning scales) on top. The node calls Replicate and returns an IMAGE.
Inputs and outputs that matter
Output is an IMAGE.
prompt- your text.num_inference_steps(8) - LCM's sweet spot is roughly 4–8. Don't push it high.guidance_scale(8 here) - LCM tolerates a bit more than a 0-CFG Lightning model, but keep it moderate.image+prompt_strength(0.8) - for img2img: wire in a source image and letprompt_strengthset how far it moves from it (higher = more change).control_image+controlnet_conditioning_scale(2) - for ControlNet: feed a Canny-friendly image and control how strongly its edges steer the result.canny_low_threshold/canny_high_thresholdtune the edge detection.sizing_strategy- whether output size followswidth/height, the input image, or the control image.
num_images batches up to 50 (LCM is cheap enough that big batches make sense), seed fixes the roll, and force_rerun forces a fresh generation.
How to install it
ComfyUI Manager: search ComfyUI-Replicate, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/replicate/comfyui-replicate
cd comfyui-replicate
pip install -r requirements.txt
Restart, and set your token first:
export REPLICATE_API_TOKEN="r8_************"; python main.py
Token: replicate.com/account/api-tokens.
Common issues
Image output, cleanly supported - no pack caveats.
The distillation rules bite here as everywhere: if results look muddy or artifacted, check you haven't cranked num_inference_steps or guidance_scale - LCM is a rapid-preview tool, and the community is honest that it doesn't maintain or improve quality the way a full model does. It's for finding good compositions fast, not for the final render. If the img2img output ignores your source, prompt_strength is too high; if it barely changes anything, it's too low. If ControlNet isn't biting, raise controlnet_conditioning_scale or check your control image actually has clean edges for Canny to find.
Standard pack reminder: a missing REPLICATE_API_TOKEN is the first-run error, and every call bills on Replicate.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | Self-portrait oil painting, a beautiful cyborg with golden hair, 8k | — |
| widthopt | INT | 768 | — |
| heightopt | INT | 768 | — |
| sizing_strategyopt | COMBO | width/height | 3 options: width/height, input_image, control_image |
| imageopt | IMAGE | — | |
| prompt_strengthopt | FLOAT | 0.800–1 | — |
| num_imagesopt | INT | 11–50 | — |
| num_inference_stepsopt | INT | 81–50 | — |
| guidance_scaleopt | FLOAT | 8.001–20 | — |
| lcm_origin_stepsopt | INT | 50 | — |
| seedopt | INT | — | |
| control_imageopt | IMAGE | — | |
| controlnet_conditioning_scaleopt | FLOAT | 2.000.1–4 | — |
| control_guidance_startopt | FLOAT | 0.000–1 | — |
| control_guidance_endopt | FLOAT | 1.000–1 | — |
| canny_low_thresholdopt | FLOAT | 100.001–255 | — |
| canny_high_thresholdopt | FLOAT | 200.001–255 | — |
| archive_outputsopt | BOOLEAN | false | — |
| disable_safety_checkeropt | BOOLEAN | false | — |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |