How to Speed Up Image Generation with LCM LoRA's (A1111)

Updated
How to Speed Up Image Generation with LCM LoRA's (A1111)
Unleash the speed revolution in image generation with Latent Consistency Models (LCM) and Stable Diffusion (SDXL). Discover the simplicity of downloading and using the right LCM LoRA for quick and high-quality results.

1. Introduction Latent Consistency Models (LCM) LoRA's

Revolutionize your image generation speed by up to 1000%! Welcome to the cutting edge of image synthesis innovation. In this tutorial, we explore the transformative realm of Latent Consistency Models (LCMs), inspired by the success of Latent Diffusion models (LDMs). Fueled by the quest for swifter and more efficient image generation, LCMs bring about a revolution, allowing rapid, high-fidelity sampling with minimal steps on pre-trained LDMs. Dive in with us as we turbocharge your stable diffusion image creation for unparalleled speed and quality.

2. Downloading LCM LoRA's

To speed up your image generation in Stable Diffusion, a single LCM LoRA is all you need, implementable directly within the prompt, just like regular LoRAs. Visit the official Latent Consistency Models Hugging Face Page for access.

LCM LoRA File Pages (Hugging Face)

Both LCM SDXL and LCM SD 1.5 LoRA's are at your disposal:

From there you can download the "pytorch_lora_weight.safetensors" file

how-to-speed-up-image-generation-with-lcm-loras-a1111-files-nextdiffusion.webp

I suggest personalizing the name of the LCM LoRA to match your version. For example, after downloading the LCM SD 1.5 LoRa mentioned above, I changed the file name to "LCM_SD1.5.safetensors," and for the LCM SDXL LoRa, I used "LCM_SDXL.safetensors".

Downloaded LCM LoRA File Location

Similar to downloading regular LoRAs, you'll want to relocate the downloaded file to the LoRa models folder, located at: "stable-diffusion-webui\models\Lora".

how-to-speed-up-image-generation-with-lcm-loras-a1111-file-location-sdxl-sd15-nextdiffusion.webp

Now that our downloads have more personalized names than a secret agent, we're on the express lane to lightning-fast image generation! Let's roll up our sleeves and dive into incorporating these LCM LoRAs into our Stable Diffusion workflow. As we proceed, we'll need to fine-tune certain settings and configurations to ensure our speed approaches lightning-fast levels.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds
20% bonus on first deposit

3. Adding LCM LoRA's in Stable Diffusion

Let's open the stable diffusion web UI and let's see how we can implement our LCM LoRA for blazing fast image generation speeds. Now we need to make sure we select our LoRA, this can be done by:

Adding a LCM LoRA

  • Go to the "txt2img" tab within stable diffusion
  • Below the prompt section select the "Lora" subtab

how-to-speed-up-image-generation-with-lcm-loras-a1111-lora-subtab-sd-nextdiffusion.webp

  • From there select the LCM LoRA you want to use (We will use the LCM_SD1.5 LoRA)

After selecting it it will add the LoRA to your prompt with a weight of 1 like so:

how-to-speed-up-image-generation-with-lcm-loras-a1111-lora-add-to-prompt-nextdiffusion.webp

LoRA Models Tutorial Video

Not sure how LoRA's work? Checkout out our Video Tutorial about LoRA Models.

4. Adjusting Sampling Steps & CFG Scale

For the LoRA to effectively enhance image generation speed, it's crucial to establish specific settings. Let's kick off with the settings, ensuring strict adherence for optimal generation speed:

Stable Diffusion Settings for Optimal Speed

  • Sampling Steps: Set between 2-8 (8 yields the highest quality results).
  • CFG Scale: Choose between 1-2 (Opting for 2 includes the negative prompt; CFG Scale of 1 will exclude the negative prompt).

Official LCM LoRA Article

For further details, refer to the official LCM LoRA Article.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

5. Prompting Tips & Examples

As the CFG scale is set lower than usual (around 7), prompts are likely to carry less weight during image generation. To ensure your prompt still influences the generation, consider the following:

  • Keep your prompt brief and concise.
  • Assign more weight to keywords in your prompt.

As an illustration, the subsequent prompt was employed to generate the examples: how-to-speed-up-image-generation-with-lcm-loras-a1111-prompting-example-keywords-nextdiffusion-positive.webp

Examples

how-to-speed-up-image-generation-with-lcm-loras-a1111-examples_rocket-nextdiffusion.webp

Let's now explore some recommendations if you encounter challenges in obtaining high-quality images with the LCM LoRAs.

6. Tips for Better Quality Images

Diverse sampling methods may not always yield optimal image quality. It's recommended to experiment with various methods at each checkpoint for superior image results. In my opinion, Euler, Euler A, or DDIM prove to be the most effective and practical choices.

Poor Quality Images? XYZ Plot!

Before raising concerns about image quality, consider exploring these options or employing an XYZ plot for comparison. Interested in learning how to utilize the XYZ plot to assess checkpoints against sampling methods?

XY Plotting in Stable Diffusion

I hope you're pleased with your selected checkpoint and the swift image generation speeds it provides.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

7. Conclusion LCM LoRA's

In summary, our exploration into Latent Consistency Models (LCMs) reveals a paradigm shift in image synthesis. Focused on speed and efficiency, LCMs offer a revolutionary approach, enabling swift, high-quality sampling with minimal steps. As we integrate LCM LoRAs into our Stable Diffusion workflow, personalization, setting adjustments, and strategic sampling methods like Euler, Euler A, or DDIM emerge as key factors. Armed with this knowledge, we unlock not just speed but a transformative experience in image generation. Embrace the era of LCMs and elevate your creative journey to new heights.

Frequently Asked Questions

Latent Consistency Models (LCMs) represent a groundbreaking advancement inspired by successful Latent Diffusion models (LDMs). They revolutionize image generation by enabling rapid, high-fidelity sampling with minimal steps on pre-trained LDMs, such as Stable Diffusion. This innovation aims to enhance speed and efficiency in image creation.

Setting Adjustments:

  • Sampling Steps: Set between 2-8 for optimal results. While 8 yields the highest quality, lower values offer faster generation.
  • CFG Scale: Choose between 1-2. A CFG Scale of 1 ignores the negative prompt, offering the fastest option, while 2 includes the negative prompt.