Playing around with Latent Consistency LoRAs [LCM]

Make it faster

Playing around with Latent Consistency LoRAs [LCM]

After reading through the HuggingFace blog article on LCMs I wanted to test it out on my M1 MacBook Pro 💻.

The original script in the blog post assumes you have a nVidia device to run Cuda against, but with a Mac we need to update the code just slightly as we send the Torch job to an MPS device versus the Cuda device. I updated and extended their script so that all I need to do it change out the prompt.

In my testing, the text to image generation is extremely fast compared to my usual SDXL generations in Automatic1111.

The images in this post were generated with the prompt below, and took between 80 and 90 seconds from start to finish. Compare this to 10-30 minutes on your regularly timed SDXL generation in Automatic1111 and this is a game changer.

I am extremely excited for this to get implemented in Automatic1111 as I love tweaking the dials and finding out what pops out of my little magic image maker machine. For now I will use this as a testing bed for prompts and then once I find a prompt I love, switch over to A1111 to fine tune it.

Prompt

Photo of a transparent sphere,
containing a 3D realistic element
of Godzilla destroying Tokyo.
Realistic textures and colors.
fires, explosions, helicopters in the background.
The sphere is set against a white Christmas themed
background to enhance its visibility.

Images

Code Repo

GitHub - ephergent/lcm_testing
Contribute to ephergent/lcm_testing development by creating an account on GitHub.

References:

SDXL in 4 steps with Latent Consistency LoRAs
We’re on a journey to advance and democratize artificial intelligence through open source and open science.
latent-consistency/lcm-lora-sdxl · Hugging Face
We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Thanks Pierrick for the nifty source of inspiration for the prompt: