Sign In

Getting "LCM" Samplers and Models to Work

Getting "LCM" Samplers and Models to Work

You're probably seeing a lot of models coming out with "LCM" versions lately. I won't get into a lot of technical things about them, but wanted a place to link to for folks needing help getting them running.

What Is It All About

Again, without getting technical - LCM is a new sampling method which, for all intents and purposes, allows you to cut the number of iterations needed in half (or more) in order to produce similar results to what you'd get without it. The big trick is that you first need that new sampler, and you also either need a model that's set up to work with LCM, or a LoRa to use alongside a regular checkpoint. Either way works.

LCM Checkpoints and Other Samplers?

Sure! But... you do seem to need to turn your CFG Scales down (see below) or the images are dark and black (or red?). And you can often get away with lower iterations using Euler or DPM and so on - but not always. (More testing needed).

But generally - yeah. If you want to use an LCM Checkpoint on another sampler, it will work. Just don't try to use the LCM sampler on checkpoints that are not LCM ready.

Getting the LCM Sampler

If you use ComfyUI, it comes standard with it.

If you have A111, the only way to get it currently is to install the AnimateDiff Extension which can be found on the "Available Extensions" list or installed directly from here.
https://github.com/continue-revolution/sd-webui-animatediff

Important Settings

Once you you have AnimateDiff (or if you're in Comfy) select "LCM" as your sampling method AND...

IMPORTANT: Set your CFG Scale to between 1 and 2. Anything higher than that and you'll get black generations

Also - of course - YOU NEED AN LCM Enabled Checkpoint or The LCM LoRa for a regular checkpoint. See below.

Further Settings

I haven't had a ton of time to experiment, but with the two setting changes above, everything else works about the same except that you can reduce the iteration count by at least half of what you usually use.

I typically go 20 steps Euler A and 10 Steps Upscale - so for this I went between 8 and 12 main steps and 5 or 6 in the upscale and they all looked pretty good. On more complex generations, more steps means more details added, but I'm not sure to what point it becomes redundant. More steps can also clean up hands and other oddities a bit - to a certain point. Again - I haven't explored a lot yet, so I'm not sure how high to go. Experiment.

Please do share your own experiences and findings below and I'll update this.

LCM LoRa

If you have a favorite checkpoint without an LCM version and want to cut down your generation times - you can try the LCM Lora - just add it to the prompt like a normal LoRa and follow the instructions above.

https://civitai.com/models/195519/lcm-lora-weights-stable-diffusion-acceleration-module

Comparisons & Examples

NOTE: I have my Xeno Detailer on and set to 0.8 in all of these. Things work fine without it, but I found that with the LCM Sampler, I could go down an extra 2-3 steps and still get the background details I was getting without it.

This is the LCM version of XenoGASM at 10 steps + 4 steps upscale + ADetailer

Euler seems to let us go with lower steps pretty well. DPM++ looks like it needs some more. Euler A actually got a bit more detail in the background than even the LCM sampler.


These are Euler A Sampler - XenoGASM vs XenoGASM LCM and 10 steps vs. 20 w/ 4 Steps upscale - no ADetailer (but Restore Faces is ON)

NOTE: The LCM Module requires CFG Scale to be set between 1 and 2 (notice how much darker the LCM version of my checkpoint is - a higher CFG on that would make it generate black - so the Non LCM versions that look faded and washed out are as much about the CFG scale as anything else).

I'll need to do more testing over the next few days and weeks to figure out everything here, but one thing we CAN tell from this image is that TOO MANY iterations on an LCM-Ready checkpoint can be just as bad as too few on another. Optimal output here (for the Euler sampler, anyway) seems to be the LCM-Enabled Checkpoint, 1 CFG, and 10(+4) Steps.


There are a zillion different settings and possible combinations of things to test out here - so many that I couldn't possibly find "the best" scenario or even begin to see everything that works or doesn't work in less than a week (or more). So I'm going to release XenoGASM-LCM as a fork from the original XenoGASM and hope that others will help with some various comparisons.

My LCM-Ready Checkpoints

42

Comments