Hand Segmentation for ADetailer
Credits to mnemic for this article and Anzhc for this ADetailer model (see for more information)
Installation:
Download the zip archive
Extract the model into your ADetailer model folder
For the WebUIs like Auto1111, Forge and SD.next it should be in models/adetailer
For ComfyUI it should be in models/ultralytics/segm
Start it up (full restart if already had it open) and select the model from the ADetailer tab/node (tip for webui: you can go to Settings鈫扐detailer and change the number of models that can be used up to 10, very useful if you want to use more than 2 ADetailer models)
Make sure to have correct Detection thresholds/inpaint strength and so on for your images
Generate them hands!
It detects hands good enough for what SD hands can be. I might work more on this in the future. Please tell me what you think. Thanks! 馃槉
Description
FAQ
Comments (11)
Nice work!
Did you create the dataset yourself?
Thanks! The dataset was the same as the hand model from ADetailer just converted to segmentation with a couple additional scripts.
@Pitpe11聽Oh? How do you do that? Did you convert the detection model to a segmentation model? Or did the ADetailer hands dataset contain both segmentation and bounding boxes? And you have the data somewhere?
@mnemic聽The Ultralytics documentation has an auto annotate function for yolov8 that creates a seg mask with SAM (Segment Anything). Just took that, modified it a bit and done. Although it asks for a detection model, so it creates new bounding boxes which can be wrong. I didn't have time to mess with using the original bounding boxes to create the seg mask (might need to create completely new scripts for that). I couldn't find a segmentation dataset, so I decided to just use the original hand dataset, convert it to segmentation with SAM and train on that. All the scripts and datasets I used are in a very unorganized mess (unfortunately) as I learned as I went and solved problems with new scripts as they appeared 馃槀. If you want to send me a Civ DM or on Discord (probably better on Discord).
can you post some parameters for this? I tried to use it and it was a mess, trying to see what settings I would need
Unfortunately, there's no correct parameters to use. You can look at this model for a quick tutorial. First you need to generate a hand that is decent enough and then use the model to increase the details (or whatever you want to do). You must play with the parameters on your own, since every image is going to be different. Also keep in mind that this is not a magic tool that will fix the mess of hands SD creates, especially since this is a segmentation model. For that, it would be better to try your luck with the bbox model.
@Pitpe11聽Thanks for sharing!
I've been trying to figure out a way to automatically reduce full shots to medium shots, loose close ups and extreme close ups.
@klikkeri1聽No problem! Also, I'm not quite sure what you mean. If you want, you can send me a DM on Civitai.
@Pitpe11聽All good.
Assume that you have high resolution picture but you want to crop the picture to smaller pieces. You can do that by segmenting picture into "forehead", "chin", "upper torso" and "hips". After that it is pretty easy to do different kinds of shots, i.e, extreme close up is from forehead to chin

