ComfyUI - Hands are finally FIXED! This solution works with all models!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right we are finally going to fix hands uh so if you watched my live stream last Saturday I showed how to do this but I ran into a couple issues and I've since resolved those uh so this is going to show you how to fix hands at about 90 some per of your images 1.5 sdxl whatever model it all works very well and it's pretty simple quick word from our sponsor today uh gigabyte has sponsored the channel uh so they sent us a 17x laptop which we are using uh and during the live streams and a lot of our videos here uh so you can kind of check that out it is a 48 card in it so uh we can take it on the road we can do amazing artwork uh when we're not at home uh it is a fantastic laptop and I had a lot of fun with this again during the live streams we play with it quite a bit uh so you get a chance to see the features a little bit more in action uh but it is quite fast uh so it's been able to knock these things out a lot faster than my older 3090 card that we've been using pretty much uh for the longest time now so again huge thanks to gigabyte for supporting the channel so I have here a very basic graph and I'm going to be using the Juggernaut model uh you again you can use whatever model You' like and have a very simple prompt here portrait of a beautiful woman in a summer dress and a flower garden waving her hands and excited so sitting ourself up for success with waving our hands we have no negative prompt here you can throw things in here like the word hands is a pretty popular one recently uh that helps correct hands or whatever uh but again we're going to do this a more methodical way and not just hope that the prompt Works uh we have a custom node here for the empty latent but you do whatever you'd like to do and then a standard case sampler so I'm just picked a seed here and we're going to use a fixed seed for this uh so we don't change a lot of variables as we explore this so just 20 steps uh you do want to do enough steps to make sure the model does have a chance to resolve the image meaning don't be too quick on this because once we've done this we really don't want to have to do another case sampler again later uh to help with any residual noise we want to try and get it right the first time because we only want to try and fix the hands so we don't want to try and fix the image again now it's not to say we can't upscale when we're done to try and do something else but again for this uh we really don't have to deal with that and if you don't have this preview remember in your manager here you can go and change your preview here to the slow version and show you in every sampler yeah she has lots of extra fingers looks quite exciting all right so let's fix this up so the node that does all the work here is this mesh gra forer so if you type in the word mesh you should see it in here there's a couple of them there's a face mesh uh but we're looking for the depth map pre-processor here uh so what this is going to do is this comes with the control net uh uh auxiliary preprocessor so if you're doing any control net you probably already have this if you're up to date remember always do a fetch all or update all uh before you complain that you can't get it to work uh because this stuff changes on a daily basis so what we want to do is we want to take and find the hands which is what this this does but it also takes and figures out what the hand shape should be and it uses a very small model to do that uh so we just take this image and push it into here we can take this image and pull it right back out again and see what we get now because we're using a fixed seed we don't have to worry about this thing taking time to process again we just hit q and it'll go right to this graph forer here and we'll see what we get so what we're looking for out of here is just the hands and it should show them in a depth map and there we go so the hands if you notice the lightest part is toward the camera and the darkest part is away from the camera I think it does this somewhat randomly based on what I can see but it does help the model understand how the hand is laid out uh so I think it's a good idea you can also work with this resolution here if you want more out of it uh but I think for this uh this is good enough because we only need to guide this depth all right so from here what do we do to fix this well let's use a control net and I like to use the advanced one here but that's just my personal preference and we want to do is we want to take this image which is the depth map and we want to put that in here you're not going to use this image down here because this control net is expecting a depth map and we can tell that because if we pull this control net out and control net loader we're going to load in the depth map so let's just go find it I have a lot of control Nets on here so I'm going to take the word depth and I'm going to look for this one again you can look for whatever one you want I'm just going to use the one that's official release from stability um that the one I grabbed let me double check that should be the 128 Laura yes uh so that's the one that I want although any of these will work all right so from here uh we should be able to kind of figure out what we need to do now we need to hook up these positives and negatives over here so we'll just go I'm just going to drag these across the screen you can make your graph a lot nicer when you're done with this uh but for now this is what we're going to do uh and then we're going to take this into a case sampler now here's where I screwed up on Saturday let's just grab this case sampler here again I Hold On my ALT key and if I click and drag it will duplicate the node and so I'm just going to hook up the positive and negative like I did before and again I'm going to show you this because I ran into this and I got really frustrated and I couldn't figure it out uh let's save you some pain here I'm going to grab this and drag it up and create a route for it this is the model here and I'm probably going to do the same with the vae eventually because we're going to need it now this latent I'm I'm going to actually screw up twice here and show you kind of what I did if we take this lat we drag it over here too uh now we can take this and decode it and again we need our VA like I said let's go ahead and drag this up and over and I'm going to explain this again so don't freak out if you're like oh my God I lost this guy so I'm actually I'm G to save this one because been okay so let's walk through what I did real quick here because it's kind of a a spaghetti mess uh but that's okay so up here uh this is going to be our group right so this is our control name group and all we're doing in here is taking this this graph forer to create this depth map and now also creat a mask let's take a look at that mask as well so I have this really nice image to mask note here from the MTB set and use that and preview this as well so you can kind of see what the mask looks like and then for our control net we're using just a full strength control net with with no with no specific uh start or end and we're going to use a depth map here okay so if we hit Q prompt on this we can see what this looks like this is what the the mask looks like versus the actual depth map so you see this has got a lot more detail and this is just a mask of what we're going to be replacing now what I did is I just ran this thing directly into this case sampler and you see first of all that the picture is very different and why is that well because we only want to redraw the hands we don't want to redraw the whole picture so we need to make sure we mask this uh so in order to mask this we want to actually this it's this latent here this line here this is the problem now there's a couple ways to do this one is if we type in in pain there's VA incode for inpainting this node here uh is one way to do it now I don't have as much luck with this one as I do with uh just the standard one the masking one uh this one tends to create rectangles around the hands uh as I'll show you well as you'll experiment with I'm not going to show you the mistake here because there's other mistakes we're going to make um but I don't really think this node works as well but again you try what you want to try I'm going to use I'm going to type in the word mask and I'm going use set latent noise mask here so I'm going to take the latent that came from our first case sampler and we're going to take the mask that came from again this refiner here that looks like this this is this mask we're grabbing but we're going to grab the green line we're not going to grab the blue one this is just our preview and we're going to drag that into so what we've done it was basically saying the only part that I want you to correct is the part that is in white here everything else leave the image alone so if we run this again what happens and you see that it is only refining just the hands should end up with something that looks a lot better here we go so you see that her hands are now proper um although they look a little wonky and why do they look wonky well they look won Mony and this is the mistake that I had made this is this took me a little bit to find is you notice that the seed is 20 on both of them and that was the issue so make sure that the seeds are different what I had done in my live stream is I was using the global um This Global seed here which I love it's a little remote control you can drag around the screen with you and kind of keep track of what your seeds are uh but what it does is it keeps fixed for all controls and keeps all of them the same and I kept running into that problem so now if we run this again we should end up with a lot less issue with that kind of crunchiness around the hand so some things to be aware of with this is that it does not know what the right size of a hand is right so it may make the hand too large or uh because again it doesn't know that it's supposed to be the right size so it's just going to take whatever size hand you have and fix it now the other issue is that it's not going to fix fingers that are too long the issue I have here is if we look at this mask you can see that we can kind of see the individual fingers here and if we have multiple fingers let's say we have one with like five or six fingers and there's a finger sticking up through here that finger is not going to be removed because the mask is only only using the hand here so I have a suggestion and that's it's right here it's based on depth for the mask we're going to change it to tight B boxes this will create a bounding box around just the depth of the hand here so these will turn into rectangles and then you can use these little m mask expands uh here to kind of help with the padding uh to see if we can get a better result out of it now I don't think these are the default values I think I've messed with this a bit but uh again the result should be uh whatever obviously whatever you get to work but you'll see here that this will turn to rectangles now so when it goes through it will use a rectangle now this will take care of the extra fingers that we might have because now they won't be seen through the additional fingers so this should work out better however uh the issue I have with this one is sometimes that the fingers could be extra long and stick off the top of this uh so there's actually another option here and that is the original see the original will create a much larger rectangle again paying attention to your mask expansion here and that should help quite a bit one of those and you see the bounding box is now much larger obviously my set settings are a bit aggressive on the size of this but you get the idea and it'll go through and mask out just the hands and replace them with the proper meshed hands so there you go we end up with something that's much nicer now from here I would recommend that you take this into an upscaler which will help with the face and other any other issues again I use the ultimate upscaler here uh but that should help resolve this and any issues there might be with any lines that might show up uh you shouldn't have too many uh but uh it can happen so I'll post this graph in the community area for all the people who help support the channel so you guys can have it there's actually a much prettier graph that I did from the live stream on Saturday uh so I'll make sure you guys get that one huge thanks to gigabyte our sponsor today uh so really appreciate them uh taking time to support the channel and again all the people who have supported us as well we have over 300 members now so we are rocking it and again I'm putting all the files and all these other things into the community area here on YouTube for all the people who are sponsors for the channel so again thank you so much and make sure you go in there and look around cuz you have access to months and months of all the live streams and all these different graphs that I've got as well as a bunch of other things there's edding embeddings in there that I'm giving away uh so trying to keep you guys uh buried with goodies and I really appreciate your support so everybody take care stay safe and I'll catch youall next time
Info
Channel: Scott Detweiler
Views: 48,903
Rating: undefined out of 5
Keywords: ai art, creativity, ai art tutorial, ai generated art, ai art generator, ai, ai created art, stable diffusion, ai painting, #ai 画像 生成, comfyUI tutorial, comfy tutorial, stable diffusion tutorial, comfyui, hand fix, fixing hands, stable diffusion xl, ComfyUI, AI art, SDXL, sdxl tutorial, sdxl template, comfyui tutorial, stable diffusion beginner tutorial, comfyui lora
Id: PLSIegjSEDg
Channel Id: undefined
Length: 12min 16sec (736 seconds)
Published: Thu Jan 18 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.