Human Garment Generation
A whole model wearing your shirt, from one product photo
- cloth_image
- face_image
- pose_image
- cloth_mask_image
- images
- cloth_mask_image
The "only cloth image" workflow was the first thing this pack shipped, and it's still the purest version of the idea: give it a flat-lay or product photo of a garment, and it invents an entire model wearing it. You don't feed it a person at all. No pose reference, no face, no base image - one shirt in, a fully dressed person out. For a lot of people that's the whole reason they installed the pack, and it's a genuinely fun trick the first time you run it.
The catch is the name. "Generate" is the swiss-army node of the family: it also does IP-Adapter FaceID try-ons (a specific person wearing your garment) and, with a pose image added, a controlnet-openpose version that locks the body position. The basic garment-only mode is one thing; the FaceID modes are a whole other install.
How it works
Same engine as the inpainting node, minus the person. A base SD 1.5 diffusers pipeline (Realistic Vision V4.0 by default) gets a ClothAdapter bolted on: the garment is segmented (via cloth_segm.pth), encoded through the VAE, and pushed through a reference UNet whose cross-attention maps are stored and replayed during denoising. That's the "cloth guidance" that makes the fabric and print actually stick, and enable_cloth_guidance toggles it. Leave it on; turning it off just gives you a plain text-to-image with the garment as a vague hint.
The inputs that matter
Required: cloth_image, prompt (default "a photography of a model"), model_path (the adapter .safetensors in the node's checkpoints/ folder), pipe_path, and enable_cloth_guidance. Then the optional ones you'll actually fiddle with:
- num_samples, seed, sample_steps (20), height/width (768×576) - the usual sampling dials. Note the guidance knob here is called scale (default 3), not
guidance_scale; the garment's own grip is cloth_guidance_scale (default 3). Two scales, two jobs. - face_image + faceid_version (FaceID / FaceIDPlus / FaceIDPlusV2) - hand it a portrait and the model's face becomes that person. This is IP-Adapter FaceID, which swaps CLIP embeddings for InsightFace face-recognition vectors; it works, but it needs extra weights and an extra node pack, and its licensing is research-only, so don't build a storefront on it.
- pose_image - add this and it loads a
control_v11p_sd15_openposeControlNet so the person follows a pose skeleton. OpenPose conditions on structure, IP-Adapter on appearance; combining them is the classic one-two from the ControlNet playbook.
It returns two outputs: images, and cloth_mask_image - the mask of the generated garment region. Save it or reuse it as input elsewhere; it's a nice bonus you don't get from the other nodes.
Installing it
ComfyUI Manager (search "ComfyUI_MagicClothing") or:
cd ComfyUI/custom_nodes
git clone https://github.com/frankchieng/ComfyUI_MagicClothing.git
cd ComfyUI_MagicClothing
pip install -r requirements.txt
Restart ComfyUI. Drop cloth_segm.pth and your chosen magic_clothing_*.safetensors (upper-body, or the lower/full-body OMS_1024_VTHD+DressCode_200000.safetensors) into the node's checkpoints/ folder. If you want the FaceID modes you also need ComfyUI_IPAdapter_plus, plus the IP-Adapter FaceID bins in models/ipadapter and their LoRAs in models/loras; the openpose mode wants comfyui_controlnet_aux and the lllyasviel annotator models. That's a lot of moving parts for an optional branch.
Where people get burned
- The dependency pin trap, again.
requirements.txtwantstorch==2.1.1+cu118,numpy==1.25.1,transformers==4.31.0- a 2024 CUDA 11.8 stack. Blindly pip-installing it into a modern ComfyUI can downgrade torch and break other packs. This is the ecosystem's oldest problem and this pack is a textbook case. - "face detection error, plz try another portrait!" - that's a real error string from the source. FaceID runs InsightFace face detection internally; a portrait with no detected face raises it. Try a clearer, front-facing photo.
- The lower/full-body model is experimental. The README says so in almost so many words: "just for experiment now," and tells you to play with hyperparameters. Expect jank.
- First run is heavy - base model, VAE, segmentation weights, and for FaceIDPlus the
laion/CLIP-ViT-H-14image encoder, all downloaded from HuggingFace. Budget the bandwidth. - Empty
model_pathdropdown means the adapter isn't sitting directly incheckpoints/.
It's the node to reach for when you want a fast fashion-on-a-model mockup and don't care about a specific person. When you need the actual person, that's the inpainting node's job.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| cloth_image | IMAGE | — | |
| prompt | STRING | a photography of a model | — |
| model_path | COMBO | 0 options: | |
| pipe_path | COMBO | 3 options: SG161222/Realistic_Vision_V4.0_noVAE, Lykon/dreamshaper-8, redstonehero/xxmix_9realistic_v40 | |
| enable_cloth_guidance | BOOLEAN | true | — |
| num_samplesopt | INT | 11–10 | — |
| n_promptopt | STRING | bare, monochrome, lowres, bad anatomy, worst quality, low quality | — |
| seedopt | INT | 42 | — |
| scaleopt | FLOAT | 3.01–10 | — |
| cloth_guidance_scaleopt | FLOAT | 3.01–10 | — |
| sample_stepsopt | INT | 201–100 | — |
| heightopt | INT | 768256–1024 | — |
| widthopt | INT | 576192–768 | — |
| faceid_versionopt | COMBO | 3 options: FaceID, FaceIDPlus, FaceIDPlusV2 | |
| face_imageopt | IMAGE | — | |
| pose_imageopt | IMAGE | — | |
| cloth_mask_imageopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| cloth_mask_image | IMAGE | — |