Stable Diffusion 09 How to Choose a Sampler

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to this video on how to choose a sampler in stable diffusion there are 22 Samplers available so yeah the question is which one to choose luckily they all render quite decent images and the differences are not even that big so you can just pick one and surprise yourself however there also is a more analytical way of going about and that's what I like to show in this video and mainly your workflow probably will have two steps where step one is to quickly find an image that we like and then we can in Step 2 improve that image using higher step counts and so forth so step one quickly find a nice image you need a low step count and a sampler that acts quick and then when you select one let's say we like this image and then we can of course pick the seed and then it is locked over there and then we can work on this image and improve the quality by using a higher number of steps and selecting an appropriate assembler and that is step two and this is the end result and I can already give away the conclusion of this video my personal preference in Eighty percent of the time would be to use good old Euler it renders this image or maybe go to DPM plus plus 2m covers that's around us this image almost similar just minor differences all the other Samplers do a fine job also but they may also surprise you more so use them for some variety okay let's have a look how I derived to this conclusion that's a quite analytical first I created a spreadsheet and listed all the 22 Samplers in the sequence that they are listed in stable diffusion and then I tried them all created images and well one of the things I did is this x i that will be a future video how to do that and what I found out and all of you already also found out that some Samplers like for instance Euler they convert to an image that does not change with increasing number of steps already after 9 or 12 steps you have a image and that image stays roughly the same this is what we call Convergence this is a converging sampler there is another category of Samplers that the ones with the a in the name ancestral and they keep changing the image with increasing number of steps the image does not change really dramatically but the girl yeah in every number of steps the girl is a little bit different or the background is a little bit different or both so this never seems to make up its mind and that is because the ancestral samples they keep adding a little bit of noise in between every step so the image stays never stays exactly the same and more or less a similar thing happens with the sde the stochastic differential equation Samplers there are a couple of them they also keep changing the image although at a very high step number the image May stabilize some but you never know exactly what comes out of that this can be a plus you can surprise yourself but in that first step where we want to use a small amount of steps say 9 or 12 and generate a lot of images yeah I like to have a converging sampler because then I know when I want to improve on this image further with more steps or whatever then the image does not change anymore so I wrote down in the next column the convergence does the image converge that is a one do does it converge but maybe give me another image that is two three four five or does it not converge those are the 99s and then I sorted that column so I now end up with 11. simplest that do converge although the ones with the little triangle in they give a slightly different image but it still has a good convergence why is that important well the next step is to have a look at the speed I want in my first phase a high speed sampler and so this is the speed column sorted out and now I end up with a smaller selection of samples that have a high speed a one means high speed a 2 means that takes twice as long time but speed in itself is not uh yeah quite important it is the number of steps that I need to get a decent image well luckily that all these converging samples but one you need only 12 steps maybe you can get away with nine so if I multiply this p is one with the minimum number of steps needed I end up with this column sorted for Speed and that means that these are the Samplers to choose in that first step to quickly generate as much images as you would like to select a good one alright so we generate a lot of images then we select a nice one that we like and we like to improve on it so now comes the uh yeah interesting work what sampler can we pick to get high quality and how many steps do we need well to analyze that I simply generated a lot of images with all the converging Samplers and using different numbers of steps and analyzed those images and I I use this castle and I use this secretary and I also used an anime image and another castle in the in the sunlight and then an interior all these images and what I did is find at what number of steps the image is already there and with higher steps it does not change as much anymore that is the convergence steps and and if I sort that column then we find out that a couple of the Samplers only need 16 steps and after that the image does not change or improve in quality anymore so is is there any use to uh to have a 80 or 140 steps well in my personal opinion there is not almost all the Samplers have reached there more or less final image after 32 steps you can of course still go higher go to 48 or 50 60 70 and see if you will really get some more detail but in many cases that is only minor very Minor Details so 30 steps is okay and 16 is even okay for some okay then multiply that again with the speed of the sampler that leads to this sorted column these five are the fastest so yeah why wait a long time if you can do it in 20 24 steps then it is okay but now comes the final point I had a very close look at the images and which of those do have the best quality yeah well this quality that is a personal opinion I had a look for amount of detail and crispness or softness or yeah for portraits you may like this and for busy anime you may like that it is a personal opinion these green ones were my personal favorites and that let me tell you the final conclusion which is that for me a personal preference maybe the DPM plus plus 2m Keras is a assembly that gives most of the time crisp and detailed and and Sharp Images and for portraits I tend to like Euler it is a little bit softer but still yeah very nice to look at all the other ones they they are good too but these are my personal preference based on speed in the beginning and quality in the end okay let's put this to the test I have created a prompt I put my step count online and a loan number to get high speed and batch count on 8 and Euler is one of the fast Samplers so and it converges very well so let's just turn generate eight pictures and quickly see what we get out and if in these eight there's no body I like to work on them we create eight again and eight again and again and so on well in this case maybe this girl looks nice in my eyes I want to create a highly detailed image so what I do now is Click over here to get the seat of this image my batch count goes to one and my sampling goes to 32 that is on my computer still quick enough and we generate this image and then see if the quality has improved well uh it it looks good to me so I like to do a high-res image right now and then upscale it and then in the extras upscale it again that is my standard upscale workflow and then the results are like this this is the image with Euler and well it looks highly detailed and just a little softness on it and this is the other preferred sampler of mine DPM plus plus 2 m chorus and a little bit more contrast and maybe some sharper details sometimes you like that sometimes you don't and well just for fun two other Samplers an ancestral one Euler a it renders a beautiful picture maybe even better than Euler itself it's another girl and that is because this was not a converging sampler it keeps changing the image with increased amount of steps so if you change the steps you get another image another girl in this case and then an sde sampler DPM colors sde the stochastic that also generates another girl not bad just it's my preference that I know when I have an image generated with 9 or 12 steps that if I increase the steps to increase the quality the image does not change that much anymore well this was it quite an analytical Story how to reach a choice for your simplest out of 22 I managed to get a short list of just two and then I use sometimes one of the others to surprise me maybe see you back in the next video and in the meantime have fun
Info
Channel: Rudy's Hobby Channel
Views: 6,905
Rating: undefined out of 5
Keywords: stable diffusion, sampler, converging, sde, euler, dpm
Id: Ek5r0eRJvy8
Channel Id: undefined
Length: 12min 48sec (768 seconds)
Published: Fri Jun 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.