Super Fast Image Generation in stable diffusion using LCM LoRA

Ғылым және технология

#lcm #stablediffusion #aiimages #a1111 #aiupdates #LoRA #art
Update: LCM sampler is available in A1111 now.
00:00:00 Introduction and sample results
LCM Latent Consistency Models,This new LoRA Model requires only 4 to 8 sampling steps instead of the usual 25 to 50 steps, to produce complete detailed images.
00:00:43 Downloading LCM LoRAs
where to download them from
00:01:31 using LCM in A1111
00:02:55 LCM Settings for CFG and Sampling steps
LCM is used at 4-8 sampling steps, and 1-2 CFG scale, can be used with Euler a, but best with LCM Sampler (manual installation can be done for this, but it is not yet official in A1111)
00:04:53 example for using LCM with after detailer and controlnets test
00:05:32 LCM Dreamshaper_v7 checkpoint
00:06:12 conclusion message
Computer Specs:
Laptop: Legion 5 Pro
Processor :AMD Ryzen 7 5800H , 3201 Mhz
System RAM: 16.0 GB
Graphics GPU: NVIDIA GeForce RTX 3070 Laptop GPU 8GB
LCM LoRA doesn’t require a special plugin or installation, it can be used like a normal LoRA model, The Latent Consistency Models or LCM are trained in a different way than normal LoRA models, which allows to infer images faster.
for model downloads and more reading please check the links bellow.
Hugging face page
huggingface.co/latent-consist...
SD 1.5 LoRA model
huggingface.co/latent-consist...
SDXL LoRA model
huggingface.co/latent-consist...
Dreamshaper v7 LCM
huggingface.co/SimianLuo/LCM_...
More reading
huggingface.co/blog/lcm_lora
Note: for Hires fix, I found it to work best at higher denoising strength such as 0.7, producing very reliable results with hires steps of 5 for example when using LCM LoRA.
Note: for img2img, you should double check the actual number of steps being used, for instance, if you didnt enable an option in the User Interface settings that allows using same number of steps for img2img then 15 steps would only render 5 actual steps at 0.35 denoising strength (0.35 * 15) so you should take this into account to make sure that img2img will process images at at least 4 steps in the console window.

Пікірлер: 69

  • @nodewizard
    @nodewizard6 ай бұрын

    Very good video! Thank you

  • @BenjyDale
    @BenjyDale2 ай бұрын

    I have followed a few LCM tutorials on KZread and this was the clearest one for me, so a big *thumbs up*. The most important step is to name the 2 safetensors files differently like this dude did in his video. I made the mistake of keeping them both as "pytorch_lora_weights" in 2 sub-folders and only 1 of them showed up in the Lora browser oops!

  • @AI-HowTo

    @AI-HowTo

    2 ай бұрын

    Gald it was helpful.

  • @lennoyl
    @lennoyl6 ай бұрын

    Thanks for your video. It's very useful to render much more images with my 8GB VRAM GPU. I use it also with Ultimate SD Upscale and it's really awesome to have hires images so fast. I'll certainly try to render some videos now

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    Glad it helped, indeed, quality will even get better in the future if newer sampler dedicated to these types of LCM LoRAs was implemented in A1111.

  • @Beka613
    @Beka6137 ай бұрын

    What kind of web application are you using in this demo? Is this self-built or some open source project? Looks pretty cool!

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    called Automatic 1111 or A1111 primarly used for Stable diffusion AI image generation, it is open source and free to use, but requires proper Graphics card to run smoothly, you can check more information about it here kzread.info/dash/bejne/hKieptWwkrardbw.html which is a beginners guide.... if your graphics card however is not strong enough, i suggest sticking with Bing Chat which gives you amazing AI Images as in kzread.info/dash/bejne/k3l-1MailK7dfc4.html

  • @vignesh_waran
    @vignesh_waran7 ай бұрын

    Great Tut. Like wise can you make a video for animediff? With LCM?

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    I will probably do.

  • @aliyilmaz852
    @aliyilmaz8523 ай бұрын

    thanks for the video, especially for the cfg vs weight trick. I just started to learn SD with my old machine and it helped me a lot. I think to upscale images after first fast generations, but could not decide to select either SDXL-Lightning or LCM-XDSL Did you compare the quality SDXL-Lightning vs LCM-SDXL?

  • @AI-HowTo

    @AI-HowTo

    3 ай бұрын

    You are welcome, currently in A1111 1.8 verision, LCM is officially supported one can try instead of Eular a for sampling... unfortunately i didnt do any real comparision, however, some people reported lighting to provide slighly better quality than LCM, but requires slighly more steps, you have to test for your work and see which option is better.

  • @duskairable
    @duskairable6 ай бұрын

    Automatic 1111 UI doesn't have the LCM sampler yet and still gives a good result. Tried this with LCM sampler + the LORA in comfy UI and produced better results

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    true, hopefully soon with LCM sampler, the quality of the images would be even higher than with Eular a.

  • @93aristar

    @93aristar

    6 ай бұрын

    There is an extension that adds an lcm sampler

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    true, i saw couple on github, but hopefully soon we get this as part of official A1111 samplers so that everyone feels safer using them.

  • @SithlordSigma
    @SithlordSigma2 ай бұрын

    This is completely insane, it dropped my normal 1min20sec gen time with a particular image i'm trying to make, down to 22 seconds. but it follows the prompt really terribly lol

  • @nobit1604
    @nobit16047 ай бұрын

    Have you tried this lora in Hires. Fix function? I tried it, but the result looks not well.

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    Yes, it produces good results , however not at lower denoising, with 0.7 denosing strength for instance, the results are super...but kind of blurry at 0.3 for instance.

  • @PivotMasterGer
    @PivotMasterGer6 ай бұрын

    Are there special settings that must be done so the SDXL can work? I added it with a weight of 1 but no matter what I do, when I click generate image it tries to start but always instantly stops.

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    no, it works out of the box, but not as fast as i hope with SDXL... best used in ComfyUI. now there is LCM sampler in A1111 which gives better image quality. note that LCM results are not of equal quality to the standard 25+ sampling steps without LCM, but still LCM has its applications

  • @PivotMasterGer

    @PivotMasterGer

    6 ай бұрын

    @@AI-HowTo ok. Tanks a lot

  • @hairy7653
    @hairy76537 ай бұрын

    man, idk what's going wrong but I cannot get decent images from it, I've tried on 2 different installs and followed all the steps!

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    this is new, so bugs might happen, i get problems sometimes when switching between checkpoints, so i restart A1111 and it works again....but while I am using a certain checkpoint such as Majicmixv4 or Aniverse or any other, it works perfectly and produces decent quality images without any bugs or issues and very quickly too. please double check the settings again, there must be something missing. CGG Scale = 1 or 2 maximum... Sample steps = 5 or max of 8 ... LoRA at weight 1 ... it works perfectly with me yesterday my A1111 automatically downloaded a new model, I think it is related to LCM which make generation of LCM faster than it appears in this video... so an update might be useful to A1111.

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    i tried using other LoRAs with it too, it works better than i expected, even for character LoRAs, the Character LoRAs produce decent results, not as pure and accurate as the normal 25+ steps though, but it is decent enough... i Just didnt like its results with AnimateDiff, but its results with img2img and controlnet are very reliable and good.

  • @hairy7653

    @hairy7653

    7 ай бұрын

    @@AI-HowTo I got them working, thanks for the advice, i downloaded Aniverse and it got things working

  • @ParvathyKapoor
    @ParvathyKapoor6 ай бұрын

    i am always getting blurry images why?

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    possible reasons could be that CGG scale is larger than 2...usually this is the main reason. currently Euler a produces clear images, some other samplers dont. there is a small chance that some check points produce better results than others with this LoRA.

  • @ParvathyKapoor

    @ParvathyKapoor

    6 ай бұрын

    @@AI-HowTo i manually added lcm sampler in SD and now kinda ok with output. Also i switch to another model and got fixed. Thanks btw

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    You are welcome, great to hear, A1111 seems to be having more bugs over time, thanks for the tip, i just looked up how to install LCM Sampler for A1111, will do more testing for this sampler, because the link i found may not be very reliable... I am not sure, in my case, things just worked out by themselves, I even saw A1111 download some model automatically when i restarted, was not sure if it had to do with it, but after it downloaded automatically, LCM started rendering very quickly and dispalying images very quickly even without LCM Sampler, I should have recorded that to get more details about what is actually going on, but didnt.

  • @ParvathyKapoor

    @ParvathyKapoor

    6 ай бұрын

    @@AI-HowTo oh yes Lcm is good. 🙏

  • @bunici1996
    @bunici19966 ай бұрын

    Whenever I have an SDXL checkpoint loaded, I cant find the LCM LoRA in the LCM tab :( i can only spot it when a DS1.5 checkpoint is loaded instead

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    if you downloaded the SD 1.5 and SDXL LCM loras, you should give them different names otherwise, the file will be overwritten, because in their huggingface they both have the same name...I think that's why.

  • @bunici1996

    @bunici1996

    6 ай бұрын

    @@AI-HowTo thanks for the quick reply! A weird work around I found was to first load a sd1.5 checkpoint, apply the prompt and LoRA I want to use, then switch back to a SDXL checkpoint xD. It’s silly but it works! Great vid btw

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    Yes i think i have encoutered something similar too, it seems A1111 is somewhat buggy, like the LoRA remained stuck somewhere...I remember in one trials yesterday, i removed the image from controlnet and results continued to generated based on the IP Adapter Controlnet image that i provided despite disabling it. hopefully A1111 will get some decent updates soon, because its bugs are increasing, and this is not healthy, otherwise people will start looking for alternative tools.

  • @bunici1996

    @bunici1996

    6 ай бұрын

    @@AI-HowTo speaking of alternative tools, have you tried ComfyUI? It’s supposed to be less resource intensive but the idea of learning a new UI all over again?! ;_;

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    Yes, ComfyUI is more powerful and often faster , but less user friently and operates very differently than User interfacce apps that most people are used to.

  • @arhamahmedkhan7060
    @arhamahmedkhan70604 ай бұрын

    Why is lcm ssd1b lora giving better results for sdxl models than sdxl lora?

  • @AI-HowTo

    @AI-HowTo

    4 ай бұрын

    not sure, I have not done enough tests to confirm this , usually, standard LoRAs should produce slighly more detailed images than any LCM based LoRAs despite its type (ssd1b, or other).

  • @TentationAI
    @TentationAI7 ай бұрын

    hi, we not supposed to wait that a1111 release the LCM sampler for using this ?

  • @yeezythabest

    @yeezythabest

    7 ай бұрын

    You can use it right now as any other LoRa

  • @TheKamrenB

    @TheKamrenB

    7 ай бұрын

    I believe the LCM sampler coming soon to A1111 will have much better results

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    this is working perfectly without any updates to A1111, the LoRA does the job ... updates to A1111 may help in improving results and speed soon, possibly.

  • @AI-HowTo

    @AI-HowTo

    7 ай бұрын

    I tested it, working just like any other LoRA and produces very useful results even at 4-8 sampling steps on A1111.... and works with any check point.

  • @goodlux777

    @goodlux777

    7 ай бұрын

    I tried the SDXL version, didn't show up in LoRA tab after restarting server, like any other LoRA would. Does something need to be done to the safetensors file first? @@AI-HowTo

  • @BrogramFilmss
    @BrogramFilmss6 ай бұрын

    mines very slow? i have a 8gb 2080

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    not sure, the first time i ran it with LCM, it gets the steps quickly, but when it tries to put the image in the image panel(final render from latent to image space), it takes a while for some reason, i updated the extensions and A1111 just in case, on my second run, when i tested with LCM LoRA it downloaded some model, i could see it in the console but could not tell what it is exactly, but it started Rendering immediately and quickly, so it fixed itself by itself, A1111 looks buggy to be honest. if things continue being slow, considering switching to ComfyUI, hopefully soon they implement LCM Sampler and remove any bugs that causes slowdown glitches.

  • @KDD0063
    @KDD00636 ай бұрын

    There is no lora section or setting in the menu like you have

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    Your A1111 is probably not upto date, you can update it using Git Pull ... or just write the manually, all the same.

  • @KDD0063

    @KDD0063

    6 ай бұрын

    thanks @@AI-HowTo

  • @carolineito9312

    @carolineito9312

    6 ай бұрын

    Did it work? I had the same problem and mine is up to date.@@KDD0063

  • @nermal93
    @nermal936 ай бұрын

    Is this working img2img?

  • @AI-HowTo

    @AI-HowTo

    6 ай бұрын

    yes, pretty effectively, i will post some videos today i made in img2img with LCM LoRA in A1111 kzread.info/dash/bejne/nWiOuax9ZrqelJM.html

  • @apa_channel_
    @apa_channel_3 ай бұрын

    Can I use other lora while using lora lcm?

  • @AI-HowTo

    @AI-HowTo

    3 ай бұрын

    yes, but quality will not equal to normal generations.

  • @apa_channel_

    @apa_channel_

    3 ай бұрын

    @@AI-HowTo simply the results are not as good as normal ones because of the step and cfg restrictions for lcm will affect other lora that require normal settings?

  • @AI-HowTo

    @AI-HowTo

    3 ай бұрын

    it affects them a little but not by a big degree, in general, i prefer normal generation because it gives highest level of details, and gives the diffusion model more time to create finer details, but for video generation, LCM remains a great option and quality is good enough.

  • @apa_channel_

    @apa_channel_

    3 ай бұрын

    @@AI-HowTo so should I just use the normal way? because I mostly use it to find the best lora from the one I made using xyz plot. rather than making works/arts like in general. because I'm interested in lcm maybe it can speed up finding my best lora rather than normal hehe..

  • @AI-HowTo

    @AI-HowTo

    3 ай бұрын

    Yes, I think Normal rendering is the best for production level output and for stilled images... You can still test the LCM and see if you find it useful for your own use cases, I only found it useful for fast video rendering nothing else.

  • @netspike
    @netspike4 ай бұрын

    It does not work for me. The images come out very bad.

  • @AI-HowTo

    @AI-HowTo

    4 ай бұрын

    this often happens if CFG scale is larger than 2. LCM is used at 4-8 sampling steps, and 1-2 CFG scale, sampler such as Euler a works great, or LCM Sampler.... the quality of the picture generated from LCM is often not of equal quality to the standard 30 steps from normal generation though, we can say 90-95% as good as it is with the right settings/checkpoint.

  • @SonnyBurnett2012
    @SonnyBurnett20123 ай бұрын

    Where are you going with such hurry?

  • @technoprincess95

    @technoprincess95

    2 ай бұрын

    Haha true. Maybe his love is waiting him

  • @M--S
    @M--S5 ай бұрын

    Thank you for this great tutorial. But please, don't speak so fast!

  • @AI-HowTo

    @AI-HowTo

    5 ай бұрын

    You are welcome, thanks for the note, will take that into consideration in my future videos.

Келесі