Improve Faces, Hands, and Poses with ADetailer! 💥

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today I would like to show you a very good extension which is after detailer or also called a detailer on stable diffusion this is very useful because we can improve faces hands and position and it follows the Imp painting techniques so it's actually better than Cod forer or gfp gun which we seen already in one of my previous videos you can use the ad detailer with stable diffusion 1.5 but also with stable diffusion Xcel which is great and yeah let's dive in so the model we are going to use depending on what was trained on is going to detect and recognize the object or subject in this case that the model is recognizing a face of of this beautiful lady and after having recognized this face is going to build a mask on it used in painting for generating a better face and this is the results from using media pipe phase 4 now to install the ailer it's very simple you go into extensions and then available load from and then you look for the ader here and you press into install if you cannot find it in here there is another way you going to install from URL then you go into the main GitHub page and you copy this link here and you paste it inside this checkbox here and then you press into install after that you need to apply and restart UI then given that I showed you this this is the main GA page for the 0 tailer there are a lot of informations about this extension if you want to have more details about the installation process and in case you have issues you can go into discussions or issues actually and you can raise questions also going down you can have more informations about the model s so here you can say face YOLO hand YOLO person YOLO media p face these are all available models that you can use in for your a detailer then it gives you also additional models you can download Ultra ltic YOLO and once downloaded you need to move them inside this folder webui models a detailer and and also is suggesting that the model should end with PT or pth so make sure you're using the right model so usually when you download extension you should have already the the models so you don't have to download them but in case you don't have them you should go through this little process great so as I was saying before the ad tailor helps in recognizing subjects faces hands into an image and then is going to improve what has recognized we could actually do this improve M through imp painting when we go into image to image and then we upload our image into the Imp painting tab but there are some pros and cons in doing this first of all doing this process of imp painting it requires a lot more time I wouldn't say a lot but more time and most of the time you don't actually get what you want because the results is uh kind of it's not consistent with the with the image you actually have so that's why ad tailer is very important instead because it maintains that consistency now for this example I've already built my prom description I'm using realistic Vision 5.1 so I'm using stable diffusion 1.5 but as I said before this uh Ed detailer works also for stable diffusion Excel for this example I'm going to generate a group of people and usually when you when we generate a group of people phases are not usually very good andh hands as well so let's see how we can improve the image we're going to generate using ader so let's generate it first without using the Ed tailer and let's see what we got and this is the image you can see is it's quite nice but obviously faces are not the best they are a bit deformed right mainly those of people on the back let's go into the ader the ader is at the bottom of the tuab so it's in here and the first thing we need to do is to enable it then we need to choose which type of model to use as you seen before we have different models for faces and they are quite similar but you can achieve different results with different one usually face Yello is quite good and also I find it really good media pipe phas full now I'm going to use face YOLO for now I don't want to change any settings I want to leave the default setting for the ad detailer and I'm going to press generate so as you can see it's detecting faces so it's like kind of we can see the process is kind of zooming on the single phas and then he going to improve it and this is the final result which honestly I find it pretty pretty good right now I have the option of showing me the picture with the detected mask and um you can change this in the in the settings on the the ad tailer as you can see in this case the model is detecting one two three four five phases so this is the picture before and this is the picture after so as you can see the phase has changed quite a lot mainly for these people on the back and on the side this number is the uh confidence score for the model meaning that the model in this case for example is 85% confident that in that mask there is a face now knowing that we can now start playing with settings a little bit more we can go under this detection tab within the ader tab and we can see here detection model confidence threshold so this is what control the confidence of the model in this case it's 0.3 so this means that it's going to improve phases for which the model is at least 30% confident so for example let's change this to 0.81 and let's press generate so now let's let's compare the previous results with these ones in the previous image we can see that the model detected five faces in the second case we use a threshold of 0.81 right so what happens the model is going to ignore all of the Mask built on a face for which the model has a confidence less than 0.8 so in this case it's going to ignore this person on the back so if you see the final result you can see that all of the phases have been improved except from the the one on the back so this is how it works I hope this was was clear so when you see that your model is not detecting all of the phases you need to improve then it means that you need to decrease a little bit your detection model confidence threshold in the opposite case is when you see that your model is detecting too many phases maybe it's I don't know maybe if you have it too low is going to consider an object instead of a face so when it's consider too many things inside the image uh you need to increase the confidence threshold so this is very important again then another very important one is the Imp painting strength which is under the Imp painting tab here so the Imp painting the noising strength imp paint the noising strength tells the model how much to change the face usually is better to use a value not too low not too high because if you get it too low then the phase is not going to change much or sometimes not at all if you increase it too much then you can get something that is not really consistent with your original image which is not great so in my case I'm using 0.4 but let's try for example with one let's see what happens now actually let me reduce this again to 0.5 and indeed as you can see we got something horrible I honestly this is yeah this doesn't make sense right so definitely you should use something slightly lower than one um but higher than 0.1 otherwise you're not going to change anything another very important one is the uh mask mean area ratio and The Mask Max area ratio so this is the minimum and the maximum area of the detected mask allowed what does it mean so if the minimum area is 0.1 then the model is going to reject all of the areas which have a mask smaller than 10% of the overall picture and when I talk about the overall picture I talk about the size of the picture I want to show you this positive and negative prompt with this you can give some more information about the phase you are going to change you're going to improve so for example let's assume that we would like to have blue eyes you can actually add it in here as a positive prompt so it's just a promp that is going to be applied for the Imp painting process right so if you want to add more details about the face or depending obviously on the model you're using the position or the hands you can add them here both for the positive and the negative so you can I don't know add blue eyes beautiful high quality again and you can add in the negative ative prompt I don't know blonde for example if you don't want your improved face to have blonde hair so let's I'm going to use blue eyes now now let's let's change the prompt a little bit something like a portray of a woman and then I'm using a random seed I'm going to generate something quickly so we created now another picture so let's compare the before and the after so this is before you see the model detected the face and this is the after so it has actually changed the color of the eyes now it's SL without slightly it's quite different right let's decrease the Imp painting the noising strength so hopefully we will get uh more or less the same face but with blue eyes let's see if it works you see has more the same face compared to the other one it's respecting more the the original face another way of doing it in case you want to actually use the uh High the noise so maybe let's assume we really want a change to have very blue eyes we can increase the the noising strength and we can actually use the control net model which is included inside the ad tailer it's actually in here you have this control net model and then you can choose you have different models in here so if you want to keep the same you know details but you just want to change the color for example you can use line art because line art is going to create a mask which reflect exactly the the face of the original image and then it's just going to change you know it's going to build another image based on those lines so let's uh let's do that so I have increased this the noising strength now and I've used line art control net model and this is the result from using line art control net and this are really the most important settings really there are some others also regarding the mask preprocessing for example in here but I I really never touch them they are just going to increase or decrease the mask or they're going to move the mask when you generate the image you can decide to use another checkpoint or another sampling method for generating the image as well you can use a different variational out encoder although I again I would suggest you to try and experiment with that if you're not happy with with the results you you're getting from the default values which usually are very good anyway now the last thing I want to show you is that you can use more models at the same times so you have two tabs in this case you have first and second and in the first tab we are going to use the face YOLO whil in the second one we want to improve the hands let's suppose that so what we do we go into this um drop- down list and we choose the the hand model hand YOLO in here and then here you can change the settings for the hand model hand YOLO model as well so you can use different ones you can use the same you can use the default it's really up to you I would suggest you to run Thea value for both initially and then start playing around with them in case you want to change something cuz you're not happy with the final result so now we have both models enabled and I'm going to press generate I'm building the same the first image we built before so it's detecting face is first and here you can see is detecting the hands with the second model so I applied first the first model for face and then after is applying the model for hands again hands are not always uh great unfortunately but I must admit that with this a detailer that they're improving most of the time and this is it let's compare so you can see here the face you can see the hands detected I got two mask actually and this is the before and this is the after they haven't improved a lot so in this case maybe you want to increase the denoising strength for the hand model and see what happens so that's it for today I hope this was useful thank you very much for watching and see you in the next video bye
Info
Channel: Laura Carnevali
Views: 20,208
Rating: undefined out of 5
Keywords: stable diffusion, diffusion, ai art, diffusion model, generative ai, generative art, stability ai, ai artist, imagen, nft, apple silicon, stable diffusion on m1, stable diffusion with python, stable diffusion hugging face, stable diffusion github, stable diffusion v1.5, stable diffusion tutorial, stable diffusion xl, refinement stage, new sd, sdxl 1.0, controlnet, adetailer, denoising, inpainting, mask, detection, after detailer, improve face, improve hands, fix hands, sdxl
Id: kL9rD7iYVOY
Channel Id: undefined
Length: 14min 23sec (863 seconds)
Published: Tue Oct 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.