(check v1.0 page for comparison images)
This is a workflow to strip persons depicted on images out of clothes. It's a long and highly customizable pipeline, capable to handle many obstacles:
can keep pose, face, hair and gestures;
can keep objects foreground of body;
can keep background;
can deal with wide clothes;
can manipulate skin color.
Installation and dependencies
Update ComfyUI (should be at least a version of August 2023);
Install WAS Node Suite custom nodes (should be at least a version of January 2024);
Install Impact pack custom nodes (should be at least a version of January 2024);
Install ControlNet Auxiliary Preprocessors custom nodes;
Download, open and run this workflow;
Check "Resources" section below for links, and downoad models you miss.
Resources
This workflow relies on a lot of external models for all kinds of detection. Some of them should download automatically. Here are links for ones that didn't:
ControlNet OpenPose. Put it in "\ComfyUI\ComfyUI\models\controlnet\".
ViT-H SAM model. Put it in "\ComfyUI\ComfyUI\models\sams\".
ViT-B SAM model. Put it in "\ComfyUI\ComfyUI\models\sams\".
How to use
Load picture.
Select a model.
Write prompt for naked body (very important, determines gender).
Write prompt for the whole picture (barely important).
Run it.
All kinds of masks will generate to choose. Look at blue groups from left to right, and choose the best mask at every stage by connecting blue nodes together.
Tune something, and run again, until you are happy with a results.
FAQ
Q: All offered masks suck.
A: Draw a mask manually. Open the image in SAM Editor (right click on the node), put blue dots on person (left click) and red dots on background (right click). Detect and save to node. Retouch the mask in mask editor. Don't forget to actually use the mask by connecting related nodes!
Q: Some hair is not excluded from the mask.
A: Find "Detect and cut hair" group and decrease treshold there.
Q: Got patches of skin around the face.
A: Same as above, plus find "Detect face" group and increase "dilation" there. Connect the correct nodes to choose dilated face mask.
Q: Gloves persist.
A: Connect correct nodes to not exclude hands.
Q: Hanging clothes generated.
A: Check your prompt. Put that specific clothes piece into negatives.
Q: Skin color mismatch anyway.
A: Detect a desired skin color manually in any color picker (Paint works). Put RGB values in "Manual skin color" node.
Q: Got seams around former siluette.
A: Significantly increase denoise in next to last and last nodes. But it might destroy background.
Q: Wrong pose/missing limbs.
A: Barely fixable. Should insert manually created OpenPose pose, which is pain.
Q: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
A: Update both ComfyUI and Impact Pack.
Description
26.01.2024:
New algoritm to remove seams.
Switch Rembg model.
Minor tunes.
FAQ
Looks like we don't have an active mirror for this file right now.
CivArchive is a community-maintained index — we catalog mirrors that volunteers upload to HuggingFace, torrents, and other public hosts. Looks like no one has uploaded a copy of this file yet.
Some files do get recovered over time through contributions. If you're looking for this one, feel free to ask in Discord, or help preserve it if you have a copy.