SDXL auto clothes inpainting - v1.0 Showcase
Hey everyone!
I'm pretty new to ComfyUI and struggled to find a good inpainting workflow to automatically mask and inpaint clothes, so I cobbled this together after a lot of trial and error. It's not perfect, but it works surprisingly well for me.
This workflow does some cool stuff. Basically, it uses AI segmentation to create the masks - so it can understand what parts of an image are clothing, fashion elements, or specific regions. Then it uses ControlNet to guide the image transformation and a custom inpainting technique to seamlessly replace or modify parts of the image. The workflow goes through a few stages:
1. Generates masks using semantic segmentation
2. Crops and prepares the image for editing
3. Uses ControlNet to maintain image structure
4. Applies inpainting with Fooocus techniques
5. Stitches the edited image back together
Might be helpful for others struggling like I was! Feel free to modify and improve.
The custom nodes used should be available through the Comfy Manager.
You will need:
https://huggingface.co/mattmdjaga/segformer_b2_clothes
https://huggingface.co/sayeed99/segformer-b3-fashion
(there is a switch to use one or the other segmentation method, they have their pro and cons, so if one doesn't work well, switch to the other. Remember to expand the masks to fit your needs)
Foocus inpaint model and head: https://huggingface.co/lllyasviel/fooocus_inpaint