ComfyUI - Hands are finally FIXED! This solution works with all models!
HTML-код
- Опубликовано: 17 янв 2024
- Hands are finally fixed! This solution will work about 90% of the time using ComfyUI and is easy to add to any workflow regardless of the model or LoRA you might be using. This is utilizing the MeshGraphromer Hand Refiner, which is part of the controlnet preprocessors you get when you install that custom node suite. We can use the output of this node as well as the mask to help guide correction in any image. I also show some of the issues I ran into while working with this solution.
#comfyui #stablediffusion
Gigabyte 17X Laptop is doing the inference today! Grab one here:
amzn.to/3thtfpR
You can grab the controlnet from here, or use the manager:
github.com/Fannovel16/comfyui...
Interested in the finished graph and in supporting the channel as a sponsor? I will post this workflow (along with all of the previous graphs) over in the community area of RUclips.
/ @sedetweiler - Кино
Bold choice, spending 5 minutes setting up nodes you explicitly tell us not to do, only to have those nodes be required steps in the tutorial.
Thanks for all your videos.
I was a little lost with all those nodes versions but, now, I'm starting to understand better how to use Comfyui
So cool that this works! Love the ingenuity that it must have taken to figure this all out.
It was a bit of a pain to watch if you check out the live stream from last Saturday. That seed was the major issue.
The best video I have seen so far. Very clear and it gets to the point. Nothing to add. Thanks
Awesome man, trying this now, your tutorials are great and easy to follow. A godsend!
Glad I could help!
Very nice tutorial. Looks like compositing^^ so as a comp-artist, i love this workflow :)
very clear and well explained, many thanks for sharing!
Hi That is very cool,and works well for me. Once again your explanations are clear and very simple to follow. As an old guy who learns best by reading these are great.
Great to hear!
Thank you for all the useful information!☺
Hi Scott! First of all I want to congrats you for yours amazing tutorials. Thank you!! Could you please create another version of this workflow where instead use prompt to create an image we will upload an image?
thank you! i'm getting great results using this...
super specific use case, when the subjects hands are literally like the image your using, if not the depth maps it comes up with a straight trash.
So grateful I 'm starting to understand how things flow in Comfy UI without feeling too lost. It sounded like Chinese to me a couple of months ago. Now it's like German. Still rough but somehow familiar. 😆 Thank you for this!
Glad it was helpful!
@@sedetweiler I just wanted to know, what's the minimum system requirements for running comfyUi smoothly, without any problem?
Appreciate you 🙂
Probably 4gb of vram.
@@sedetweiler I've tried with 4GB VRAM and, 16GB RAM.. it takes 2:16 hours to generate and upscale 1 image.
RTX 4060 8GB VRAM with 16GB RAM ✌️or RTX 3060 12GB VRAM with 16GB RAM✌️or RTX 3060 8GB VRAM with 16GB VRAM✌️.... (I have i7 12th gen) Which one do you prefer between these three?
Don't know which one would be the best for faster image generation and upscaling....
Thanks for your earlier response 🙂
@@furiousnotch7914 VRAM takes priority, the more the better. Then think about the speed of the card. The new 4070 Super seems to be a happy middle ground of the latest generation. Smaller budget? 4060 Ti 16 Gb. Bigger budget? Think 4080 Super or 4090. Of the 30 series, I would take the fastest one with at least 16 Gb. But honestly, I would save up a bit more and go straight to 40 series.
This is great. Thank you for making it so clear and simple. Would you happen to have any videos on maintaining consistency of characters across multiple renders? Many situations require more than just one shot of a character but I find consistency almost impossible to achieve just by text alone.
Nice follow up, thanks Scott
Any time!
Thanks for your video. You can use the global seed if you set the seed in an extra primitive node and fix it
Cool, thanks
Wonderful! Thanks for sharing! 👍
Thank you! Cheers!
Thank you for making a tutorial by building nodes manually, it really helps clarify each function of the nodes, unlike other channels which present workflows with ready-made nodes
Thank you very much for this!
You're very welcome!
It cannot be completely eradicated. Only post processing with pts AI can help, and sometimes when the hand is quite stable , it may provide an additional glove or piece of steel on the hand,
Well, that works fine with big hands but not very good with like 3-4 characters in the picture and little hands, closed hands, specific poses. Somewhat the MeshGrapher gives bad results. But it's definitely this path to use for correcting details without altering too much of the original seed. I'm impressed how that works.
Thank you, that works perfectly!
Glad it helped!
Hi! Thank you so much! I just became a sponsor! Your videos are so useful as I'm trying to figure out solutions to these types of issues and I was wondering if you had any ideas for how to fix exposed feet as these often are in the same place as hands on initial generation and I haven't seen any similar depth rec or masking for this particular use case. Would love to hear your thoughts!
I have not seen much of a call for that, but civit probably has some for models and you could just use a different mask creation method and this same solution
Thank you for the sub!
Thanks for the tutorial!
You are welcome! Thanks for taking the time to leave a comment. Cheers!
Please try different hand poses you will know it never fix hand. When the ControlNet depth preprocessor gives you bad depth hand, you will still get bad hand. Even it gives you good preprocessed depth hand, for different hand poses it will still generate flip, or reverse bad hand. I am so sorry to tell the true.
It isn't perfect, but again this works in 90% of the situations where we get bad hands.
I would say that it improves 50% in the photo-like images. But maybe 10-20% in painting or some low CFG styles.
I made it to 4:30 and then nothing shows up in Controlnet Models, "undefined". I went to manager > install custom nodes > Fannovel16 which says "NOTE: Please refrain from using the controlnet preprocessor alongside this installation, as it may lead to conflicts and prevent proper recognition." Not sure how to proceed. Is my ComfyUI installation bad?
Same here, not sure what im doing wrong
Great vid, thanks Scott. Guys, if your using A1111.. It takes just two clicks to enable Hand Refiner in Controlnet and fix hands lol But the noodles are much more fun, if you have time to kill.
The difference for me is I know how it works. with much of A1111 you check a box and the magic happens. With Comfy you actually control and learn how it all goes together. It is the difference from just eating in a restaurant and knowing how to cook as well.
The Hand Refiner in ControlNet isn't as powerful as the fine control you have in ComfyUI. One-button solutions always have issues. I've used both and always get better results with ComfyUI.
Thanks for this video. Have you tried to see if this works with SDXL workflows?
Can you next time go more on SD3 Creative upscaler? IK don't find much info on it. So you don't use it with a 2k image? it sats 1000 or less? I'm trying to figure out if it is worth it at 25 cents per upscale. Thanks!
One more thing that you can do is send the final image to fooocus image prompt > inpaint>improve face, hands (2nd option), paint both hands, and use the quick prompt called detailed hand.
Edit: This is AFTER you have refined the hands using the above tutorial.
Thanks for sharing!
@@sedetweiler this sounds interesting, if you tested this and you think it's effective, we would love to see a part 2 of this video doing these extra steps for a perfect result
Hey Scott, really suprised you're not ahead of the curve with somethging about a SD3 howto.
Is there a way to split the image to background and person, fix the hands and then recombine?
Maybe also model a the pose (body and hands), so any animation of that can be done very precise and consistent?
Amazing video! Learnt so much from this Scott! A new random question arises, what's the name of the plugin that gives you info on which node is executed at runtime on the top left? :)
That is from the PythonGoSsssss pack.
Hello! Is there a way to integrate two json files with different functions in comfyui? One is to do the inpaint function, and the other is to maintain a consistent character through faceid, but I'm having trouble linking the two.
😯so simple. I love ComfyUI
It really is, for such a terrible issue. Cheers!
Great video, thanks for making it! Have you tried it with a person holding something? I’m wondering how well it works if part of the hand is meant to be not visible 🤔
Not sure, but it is worth trying!
I got to the point where the Meshgraphormer is added to the Ui , however all it generates is a black box. I installed the comfyui manager and such. Are there some videos I should go back and watch before trying the methods in this video?
Thank you so much for another amazing tutorial!
I’m trying to figure out what the best way is to combine this with the refiner. Would I go through both the base and the refiner for the full image first, and then do base and refiner again for only the hands?
I tried something like that, but the results are not that great as the hands don’t really match the visual quality of the rest of the picture.
I would refine at the very end.
@@sedetweiler Refine everything together you mean? How would you do that if you want to do 80% of the processing in the base and 20% in the refiner? Fix the hands even with some noise of the base left?
yup. that is what I would do. Since the position of the fingers is probably already determined by that time, additional refinement isn't going to undo that.
Thank you, I really appreciate your input!
ty for sharing !
My pleasure!
Thanks for this video
Most welcome
now that's pretty cool!
I am loving it!
hi. Great content. Thank you . where is the workflow json for the video? thank you
They are in the community tab here on RUclips. That is the only method they give us for communication, unfortunately. Thank you for supporting the channel!
Good job!
Thank you! Cheers!
Hi thank you for this idea, but i had problem. i generated 3 persons but the refiner only got 1 person hand left and right, the second and third person's hands are not detected. So i only fixed one person hand. What is the problem here?
Great stuff! Do you know if there’s a community node for Invoke for this? I’m not sure how interchangeable or inter-compatible the nodes are.
I don't know. I love the Invoke project for a lot of reasons, but I just have not used it lately as I live in comfy most of the day.
For some reason the hands from the picture I am trying this on don't get detected. I guess this method only works for hands that are already clear enough they are hands.
amazing! i couldn't get it to work though, it won't detect the hands (the "display mask" box is just a black square every time, and i can't work out why). still.. something to work on :)
How do you make it so you don't see the 2 squares in your end image where it repainted the hands? can even see them in your youtube video.
I've noticed that this functions well with open hands but not as effectively with hands in a relaxed, close-to-the-body position. Do you have any insights on fine-tuning it to address these scenarios? Thanks a bunch for the excellent tutorials!
same here. it's not the solution I was hoping for. It erh.. kinda sucks
does that work for all kind of hand positions? e.g. hands grabbing a handle, hands tipping on a keyboard or piano, hands clapping ....
I am getting an error
"Error occurred when executing KSampler:
mat1 and mat2 shapes cannot be multiplied (308x2048 and 768x320)"
Does anyone know what this is? am running the inpaint depth hand control model that is recommended on the github
Seems to be an error with the Ksample
How do you get this level of control though with colab notebooks and python code?
does it also work on hands which dont wave directly at the camera or for cartoon models ? i dont think so
i have some problems, i dont seem to find out why the hands are smaller in the mask and when impaiting its like they render smaller
Should I run Meshgraphormer before or after ReActor?
Do you have any solution if im getting "new(): expected key in DispatchKeySet(CPU, CUDA, HIP, XLA, MPS, IPU, XPU, HPU, Lazy, Meta) but got: PrivateUse1" error while using MeshGraphormer?
PS. Greate video, i just would make it run on my amd pc xD
can this handle an image of a couple holding hands? Thanks. its impossible in Krita and Firefly I tried it already..
I would like to try it, but I can't see the workflow attached here or in the community tab. Although I'm not sure if it will work due to hardware limitations (rx580) and software differences (sd 1.5, torch, nodes).
Scott great stuff! I ran into some snags applying this to a workflow with 2 other controlnets ( Depth + Openpose) Im not using Advanced contronet for the other 2 and 1 Ksampler. Do I need 2 Ksamplers like your video?
The first one creates the flawed image, and the graphformer can then spot the hands and the second sampler fixes them. So, I am using 2 samplers for that reason. Because this works so well with just depth, I am not throwing all the controlnets at it, as it just works as is quite often.
I got my workflow to work with one KSampler using 1.5 model ( Im using Controlnet for the body (DWopenpose + Depth) and now MeshGraphomer) and got to that point where i generated great hands but the image totally changed , so I added the Set Latent noise mask with samples going into a empty latent image (replacing the one from the KSampler) and the image is totally gone. So frustrating as i was almost there.. Any guidance would be appreciated
Got it working! thanks@@sedetweiler
awesome! it sounded like you were SO close! that is great news!
@@scottownbey9340did you end up adding another ksampler or staying with one?
This only seems to detect 1 set of hands even when there's multiple people and it doesn't detect parts of fingers or hands that are occluded. And there is very often noticeable artifacts around the bounding boxes themselves even if the hands are done well. Any ideas how to refine this?
Is this possible to be done with other WebUi, like Forge WebUI?
i clicked update all in the manager, now my comfy doesn't work anymore. i get this error:
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
any ideas how to solve this? everything worked fine before the update
I can use it normally under the SD1.5 model, but I always get an error when I use the SDXL model.
Hi Scott, thanks for the update. I'm also trying this with img2img but I can't get it to work propperly. Maybe an idea for another video?
Sure! that should be as simple as replacing the empty latent with a VAE Encoded image and use the samples off of that.
Hi Scott, now it works. I think my input image was not the right choice for that. I changed it now to the girl in your video with six fingers as input, and now its fixed and i get five fingers. Thanks! @@sedetweiler
HUGE THANKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sure! happy Friday!
Can this be used with a image as input?
This may be a dumb question but does this process also work for cartoon/anime models?
I have installed the ControlNet but that node not appears to me
Thanks man
Any time
yup!
Thank you! Can you share how to do this with moving hands in a video?
use the "image batch to image list" node as input for this hand fixer
I can't figure out how to make this work. Even if the MeshGraphormer produces good results and the hands look nice in the depth map, the hands in the final image often look worse than in the image before MeshGraphormer. It seems that the second KSampler does mess up the hands again. Is there anything to avoid this?
you can always use a different model for the 2nd sampler. Be sure you use a different seed! That was one I tripped over.
@@sedetweiler wish this helped. I'm using the same model you are in the video and it just makes it worse.
Funny how I have the proper controlnet installed but I don´t have this specific one for hands.... What am I doing wrong? thx.
check that you are up-to-date and restarted.
Is there anything similar in the works for FEET?!
I have two GPU's how do make sure comfyui is using the most powerful of the two nvidea cards.
Can you share a downloadable workflow for this
HI Scott. IS it possible to use ComfyUI to do inpainting on the pre-existing image?
all models! nice
cheers!
I use to enjoy your mid journey tutorials and workflow. Can I ask why you stopped? Now that the models are even more powerful, i wish we can turn to expert like you.
I guess I just need to make some. I have a few ideas on them they I have not seen covered. Thank you for the suggestion!
It doesn't work with every model either. Graphormer has its problems with hands that originate from 2D, 2.5D models. Apparently the depth information that Graphormer needs to recognise that they are fingers is missing.
So far I have had great luck with it, even using non-AI images as starting points. I think it is a pretty flexible tool.
my controlnet model list is empity snd I can't find where to download them
If you go to the git for any node suite by clicking on the name in the manager, it will tell you what additional files or models are needed and where to get them.
@@sedetweiler @ 4:20 when you are selecting your model in the controlnet list, you are full of models, my list is empity!
@@sedetweiler and, another question: Is it working on text video?
same, "load controlnet model" box list empty. Did get mesh things when installing fannovel16 pack but that list is empty.. continuing to loo for answer.
Hi Scott, where is the wf please?
wf? sorry, not sure I follow.
@@sedetweiler that’s ok, I tedter your workflow for graphormer
The meshgraphormer puts put only a black Image. I have everything installed and updated. Any help?
Hmm, is it not seeing the hands at all? If they are really messed up, it will not see them. I would just check the mask to see if it found them.
@@sedetweiler i tested it again with a simple prompt of a waving woman, using empty latent Image and a resolution of 832x1216 (using a custom sdxl merge) and it works fine. The First Time I tried I did img2img of a stylized toon character which output hands already look quite alright. However the meshgraphormer refuses to recognize the hands of said character.
It might not be good with cartoons. Not sure, I don't tend to go for that type of artwork personally.
@@sedetweiler yeah, thats what I expected and it seems to be the case. It doesnt properly recognize cartoony proportions, even though in my opinion cartoony hands come out better in general, due to the fact that they are bigger and give stable diffusion more space to generate them a bit better.
@@beatemero6718 maybe you could try DWPose?
can you pastebin the workflow?
It is in the community area on youtube for channel sponsors.
@@sedetweiler ugh
The control net model doesn't work with an amd setup, save the time homies.
meshgraph hand refiner not work ...
Hi Scott, any new videos? Theres some new stuff we need to learn
Hi Scott
hi there!
make a video about upscale
I did a few of those. something specific you want to see?
@@sedetweiler Like magnificAi, upscale with extra details
I generated woman face that i very like. Is any way to apply this face to rest of images which i will generate? Reactor or other face replace nodes makes face very bluury when image is bigger than 512x512.
use IP adapter
@@dflfd I tried IPAdapter too and results are similar. The face is either blurry or much different than source face :(.
Not trying to sound facetious here but surely it would be far less of a ballache just to photoshop extra fingers out, far quicker 🤷♂️
Yeah, those original image hands were already pretty great -- I'd just fix it in photoshop. I guess this method is fine for people with ZERO artistic ability.
Thanks, this video made me realize SD isn't for me. This is WAY too complicated. It's no wonder now why most AI art at high res looks like crap if you look closely at the details.
anyone compared this to handdetailer?
no idea. this seems to be super simple to deploy and works on anything I have thrown at it.
e ainda não ficou bom ..
Try GroundingDinoSam
Thx sir!
Does not work well at all, sorry.
What do you mean? It fixes hands like 80% of the time.
it only made it worse :/
it's not a fix, that's a hack
True. We are working around a weakness. But as the models get better, we can probably stop needing to rely on things like this.
@@sedetweiler unless it gets heavily trained on high definition hands it's not gonna get any better, we need a bit larger encoding (at a cost) and decoder trained on hands, too much details getting lost.
It's a hit and miss and more miss than hit really. 😢
Not a particularly useful workflow. Only fixes the most simplistic hand deformations, such as open hand poses as in this example. Any form of gesture complexity and it doesn't work (ex., deformed hand holding onto a sword hilt or similar cases of occlusion such as a subject placing their left hand on top of their right).