Stable diffusion up to 50% faster? I’ll show you.

Hey hey guys! What if I told you that you can 
speed up your renders by about 50%. Would you   believe me? Well what if I told you that after 
I show you how you'll be able to do it in about   three seconds. And the only requirement for this 
is that you have an Nvidia card that is either   in the 1000 series 2000 the 3000 or the 4000 
series so basically it's the the Pascal Turing,   Ampere, Lovelace or the Hopper which are the 
H100 or the special ones.

But if you have an   Nvidia card that's not older than say about 
2016 this is most likely going to work for   you. Why don't I just show it and you can do 
it for yourself. Alright so I'm inside Stable   Diffusion now and I've prepared a prompt that 
I just took from one of the prompt libraries.   I'm going to set the sampling steps to 50 
just so we can get up to speed properly.   I'm going to leave the rest the default 
except the batch count which I'm going   to set to 4 and I'm going to set the seed just 
so we're getting the same results in both our   tests.

Now we're going to run this without 
the fix I'm going to show you the speed. So I have about five on our first 
and then we're gonna get up to 8.28 on our second one and this should be around 
this value is where we're going to be with 8.24   on our third. And 8.28. So my 3080 gets me about 
8.28, 8.3 iterations per second which is I mean   that's good it's great. It's a good card but we 
can do even better.

So what we're going to do   is we're gonna go into our stable diffusion 
folder. You're going to open a notepad then   you're going to take this Webui-user drag that 
into here drop. And then at this line set command   line arguments we can add a space — and write 
xformers then you're going to save this. Close,   we're going to close this one and we're going 
to restart our stable diffusion. Now if you're   doing this for the first time you're going 
to get the message here that says installing   xformers and when that's done you can see 
here launching web UI with arguments xformers. And here again apply xformers cross 
attention optimization. So what this is, is   basically a library that helps stable 
diffusion with some of the rendering.   Let's see if we can just run this back without 
refreshing.

Now remember we had 8.3 as our highest   number if you round it up. 8.28 actually but let's 
round up let's go with 8.3 let's press generate. We can see already our first one 
is reaching 5.48. The second one   we can see the 10 here so we have 10.16, 
probably gonna get about 10 again. 10.12. And again 10.17 so from 8.3 up to 10.17 or 10.2 
if you round up again. Just by changing that   which is again basically a three second fix, 
you can increase your stable diffusion render   speed. And the speed is a little dependent 
on what card you got, you can get a like a   five percent increase a 10 or up to 50 percent 
increase depending on your card.

But either way   activate it. I hope this little trick is going 
to help speed up your renders. If you're testing   this out please check your results and put it 
in a comments how much faster your renders are,   and what graphics card you're on and we 
can compare how much of an upgrade each   card gets. If you like this little tidbit of 
information and want more of this stuff you're   gonna need to like and subscribe, so the 
algorithm knows what you want to see. Then   my videos are going to get shown more to you. 
Thanks for tuning in. Have a good one, see ya!.