ComfyUI: LCM LoRA - Gute Bilder in nur 5 Steps | Stable Diffusion | Deutsch | Englische Untertitel

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello and welcome to this video, in which I would like to exchange some life time for knowledge again. It will be a short video, I think, but even cooler for that. And I would like to show you LCM LoRAs. LCM, these are actually models. These are latent consistency models that are trained to produce good results with very few steps. And since the training and creation of these models is always a lot or very time-consuming and also sometimes costs a lot and so on, we have now got LoRAs for it. Which is our possible either for SD15 models or for SDXL models to add these techniques. So these LoRAs add the functionality, these attention layers to each model. I would like to show you that briefly. First of all, you do the whole thing here on this page, which I will of course link to you below. And you see here it says latent consistency models LoRAs. If you click on it, you have the SDXL to choose from, the stable diffusion 15 and the SSD 1B. That's another model, unfortunately I haven't gotten to try it out myself yet. But it's also a very fast model. Let's take a look at the SDXL and the SD15. Just click on it, then you come to this Hugging Face page, go to files and versions and here you see PyTorch_LoRA_Weights.safeTensors. You would have to download that. I've already done it in advance. It is best to make sure that you give the whole thing a different file name. I called it LCM 15 and LCM SDXL. As you can see, the whole thing also comes in the models LoRAs folder. Name that, because otherwise you overwrite that the two variants are called the same. If you have downloaded that, that was the SDXL variant, you can see it up here. Now go back to the SD15 variant. Also here files and versions and then download PyTorch_LoRA_Weights.safeTensors and rename it. And when you've done that, I'll show you what you can do with it. I'm just building a really, really basic setup. I also take the pipe loader nodes and pipe sampler nodes from the TinyTerraNodes pack. What did I want to have now? Sampler. So here I take the ref animated. We do ClipSkip-1, change the VAE, just say Cyberpunk Person. I want to let the model decide whether male or female. Cyberpunk Person in a Cyberpunk City. Clothes dressed, maybe leather jacket. And High Detail. I could load now, but I'll let it go. So from the pre-videos, load the presets or something. We just type that in. HDR cinematic quality and into the negative, of course, as had the two. Well, here I set a height of 712 so that we have a bit of a portrait picture. And the whole thing is a basic setup. Let's see how fast this is now. has gone through with the normal model. Now we have to load the model, of course. It takes a while, but then it goes quickly. So now we have created a base picture at the point. He has somehow taken a man, has become a bit punky. But we don't care. Well, now comes the LoRA into the game. We can put it in here. We have an SD 1.5 model. We take the moment now. I'll refresh. LCM 1.5 LoRA. Which we just downloaded. And what we have to do here is then we have to pay attention to this. Take the sampler once. We can now also put it on LCM. And with the scheduler you can always try a little bit. Sometimes the models don't work. So sometimes I take the SGM uniform. And what we have to pay attention to when using the LCM LoRAs is that they are best in a CFG scale. And work from 1 to 2. Depending on which sampler you take. I don't know if we can do 1.3 here either. We can also enter values. But we stay in the middle of 1 and 2. So 1.5. And let the whole thing run now. No, I said we can create good pictures with very few steps with these LoRAs. Let's do that now. I turn the whole thing down to 5 steps. And I put that together. Now we get it on a screen here. We start it. And the picture is created. In 5 steps. And that's the quality that comes out of it. And that's really amazing. If we take a look here. Front executed in 1.19 seconds. So that's just over a second. Where we have created a base picture. For comparison, I have a 3080Ti in my computer. Of course, depending on the card, it is even faster. But that's pretty crazy, isn't it? If I say here now. I even want to create 10 pictures in one batch. So 10 pictures at a time. Then of course it takes a little longer. But that's it. We have now created these 10 pictures here. In 7 seconds. 7.15 seconds, of course. But in 7 seconds just generates 10 pictures. And that's very, very amazing. This also works with SDX. This also works with SDXL models. Just remember that you have to load the LCM SDXL. And what is also very important. If you should use other LoRAS. The LoRAS are often trained with different techniques. This usually works. But in the ComfyUI itself. Under advanced model. There is the model sampling discrete node. And you can hang them in between. Or depending on your LoRA chain. If you just have a normal load LoRA. And you make a copy of it. Then you can just hang them on it. And from there go to the model. What we can do with this node is. We can say that the sampling should be LCM here. And specify different techniques for sampling. So that the sampler generally knows. How to process the whole thing. It even goes further. We can. Here, for example, a Hi-Res Fix Scale. And we can also use this. Here, for example, a Hi-Res Fix Scale. Let's take the standard. I was just wondering if I was doing something else. But no, we take the standard. I'll put it on Langsos. And I would like to have 1440 in the height. We copy the sampler once. We also meet with the connector. Say here denoise 0.5 is a normal upscaling. Or image to image or whatever. Let's just leave 5 steps in here. LCM SGM uniform. The batch I turned down again to 1. And send the latent in there. So we need the VAE at the point. You can have it very much. And now let's run the whole thing for a picture. The base picture has been created. The upscaling has gone through. And here Ratata now again with 5 steps only through. And we see that we are in. Under 10 seconds, so 8.7. My setup has now needed. A really. Yes, we have created such a large picture. As it is otherwise in. I don't even know how long he needs otherwise with me. In any case, not under 10 seconds. That's really, really blatant. The longest is really still this upscaling. With the model here. You can also use a latent upscale. Yes, but not the one. I would like to buy latent upscale. And I know. Excuse me, my cell phone just went. I know that to get to about the same size, we need 0.02 as a factor. Here. Because you can easily calculate that. If I say we need the pocket calculator. And we say 1440 by 712. What is our size, we come to about 2.02. Send the latent down here. We send the latent in there. We do that with control M off. Excuse me, I don't have my displays here right now, but that doesn't matter now either. Let's go through it again. And now he's just upscaled the latent. And we're done. And here, too, we just have great results in the whole. At the end. Oh, I wanted to look at the size again. And that has now been executed. In 5.31 seconds. So I can do it again here. I have this great feature here now. I'll just let a few pictures. Rattle through. And we'll take a look at the console. I'll let three pictures rattle through here. I'll put that on three. We can already see that. It's really, really fix. We now have 6.145 seconds. Again 5 seconds. And. So. What else can I say? That's just the madness. We can also try it again with SDXL. I'll take the juggernaut. We say here we want the corresponding. LCM SDXL need to have. Here at the point we can. Let's just make it convenient. I want to store the hate. I'm blind. Yes, I'm blind. I'll take one of the Comfy Rolls. There are a few cool things in it. A few not so cool, but a few cool ones. SDXL aspect ratio out. And can now here. Select a 4 to 3 portrait. Then we don't have to worry about the size anymore. And. We still have to change Lipskip and the VAI. Then we take the SDXL VAE once. I think everything is right here. Down to 1. Now you have to load the model again. Let the console turn on again. I hope you've seen everything. But in principle only. I did that here. This is from the Comfy Roll Extensions. There we can just specify what size we want. And now the sampler starts. Of course we have bigger pictures here now. That's why he needs a little longer. A larger base resolution that we already use here. 2.02. I probably should have changed the factor. I don't care. We'll let it run through now. What do we have for a height of 1152? 1152. 1440. 1152. 1.25 would be the factor. that we need here. 1.25. Now I start it again. It's amazing how fast the first picture rattles. Now it works better with the second one. And we used less than 10 seconds. to create the picture. Let's take a look at that now. And yes, it's also very good. I think with the SDXL model. you probably need a little more love. that you have to invest. I can do another one. Let's take a look at the dreamshaper. SDXL model. We'll have to load that again. Nevertheless, I would like to try it out again. I think the juggernaut makes some places a little blurry. and blurred. That can now also be due to the LoRA itself. Otherwise I always have very good results. I'll just check that out for a moment. So the sampler goes through again. Also here. Here we have. Oh, that was a little stupid. That was with loading. 36 seconds. But with loading the model. Yes, that's okay too. I think I need a little more love in general. Maybe also with the prompting. Just the base picture. But technically it works. You've seen it. So that's an amazing one. Technology that you can do here. Or can apply. Simply because we have the LoRAs. can apply to any model. And thus get the advantage. Very nice. And. Again the variant here. We delete. And of course we can also simply mix in other LoRAs. So we can say again here in front. We also want to have the Add Detail LoRA with us. for more details. Change an SD1.5 model. Animated we take again. Back here we can also say again. We want the overgrown. Do I have it? Yes, post apocalyptic. Not overgrown, post apocalyptic. Let's rattle that again. Stop. We just need the other nodes from the Comfy Rolls. That was in the other. SD1.5 aspect ratio. Let's just connect them with it. Say here we want 3 to 4 portraits. And off goes the post. Scaling factor, we don't have to worry about it anymore. Now the node is back in use here. Yes, it didn't get that nice. I think it doesn't seem to fit that well. Max on the node. No, apparently I have something else here. Something else wrong. Is that the Add Detail? Ah, I have the wrong one. Yes, sorry, if you are wondering. And of course we have to run in there ourselves. the LCM LoRA again. Use correctly. Now I can rebuild everything here again. Here the post apocalyptic. Now we get a real one. Result out of it. That can be seen, can't it? Yes, the question is whether you should use this LoRA constantly now. Maybe, maybe not. We have to see how the pictures behave with and without LoRA. To what extent this now affects the image generation. In any case, as you have seen, we can really create pictures super fast. It's just ... So if you look at it from before, it's really, really impressive. In less than 10 seconds, especially back here, the big variants of these pictures. Let's say 8 seconds here. 8 seconds again. Of course, it has become a little higher because I have mixed in two other LoRAs. Nevertheless, to reach WQHD in less than 10 seconds is impressive. Yes, just try it yourself. As you can see, you save time and computing power and above all the graphics card is much faster with calculating the pictures. And that may also be noticeable in the annual electricity bill when you pull these LoRAs to help. Have fun experimenting and trying out yourself. See you in the next video again. Take care until then. Bye!
Info
Channel: A Latent Place
Views: 2,022
Rating: undefined out of 5
Keywords: ComfyUI, Stable Diffusion, AI, Artificial Intelligence, KI, Künstliche Intelligenz, Image Generation, Bildgenerierung, LoRA, Textual Inversion, Control Net, Upscaling, Custom Nodes, Tutorial, How to, Prompting, LCM, Latent Consistency
Id: K5Kz3sGF9vo
Channel Id: undefined
Length: 19min 46sec (1186 seconds)
Published: Sat Nov 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.