OOTDiffusion Generate
Dress a Person Photo in Any Garment — the OOTDiffusion Generate Node
- pipe
- cloth_image
- model_image
- image
- image_masked
You've got a photo of a person and a photo of a shirt, and you want to know how the shirt looks on them - face, body, pose, lighting all untouched, only the clothes swapped. That's exactly what this node does. OOTDGenerate is the working heart of the ComfyUI-OOTDiffusion pack: it takes a person image plus a garment image and re-renders the person wearing the garment. It's virtual try-on, locally, no API, no key, no uploading your photos to a stranger's server.
A word of context first, because it shapes expectations. This is 2024-era research tech; since then the "swap the shirt" conversation mostly moved to instruction-edit models like Flux Kontext and Qwen-Image-Edit - great until they aren't. An edit model redraws the whole frame, so the garment drifts and the person subtly changes. OOTDiffusion is the opposite trade: a purpose-built try-on pipeline that keeps everything except the clothes and does its level best to nail the garment. For a faithful "what does this jacket look like on this specific person" result, it still beats prompt-and-pray.
How it works
The Generate node is the third step of a three-node pipeline, but all the smarts live here. Inside, it:
- Embeds your garment photo with a CLIP vision model (
openai/clip-vit-large-patch14) - the clothing is conditioned in as an image, not a text prompt. - Runs human parsing (ATR/LIP ONNX models) plus OpenPose on the person photo to figure out where the current garment is.
- Builds a mask of that garment region and blanks it out of the person image.
- Feeds the masked person + garment embedding into a two-UNet diffusers pipeline (one UNet for the garment, one for the try-on inpainting) and samples with a UniPC scheduler at 20 steps.
Everything gets resized to a 768×1024 portrait frame regardless of what you feed in, and the whole thing runs in fp16 on your GPU.
Inputs that actually matter
- pipe (MODEL) - comes straight from either loader node in this pack. Don't be fooled by the MODEL type name; it's a custom OOTDiffusion object, so nothing else in ComfyUI will accept it.
- cloth_image / model_image (IMAGE) - the garment shot and the person photo. The garment should be a fairly flat product-style image; the person image is whatever you want to dress.
- category -
Upper body,Lower body, orDress. This one's a trap: it must match the loader's model type. A half-body pipeline can only doUpper bodyand will raise aValueErrorif you pick anything else. - cfg - defaults to 2.0. The author's description is the whole story: it's how closely the output sticks to the input garment. Lower gives a looser, more natural drape; higher clamps harder to the cloth.
- seed / steps - the usual. 20 steps is the sane default.
Outputs
Two images. image is the try-on result; image_masked is the person photo with the garment region blanked out - the input the model actually painted into. It's grey and ugly and not a bug. Wire image to a Preview node and move on.
Real-world tips
Community experience with OOTDiffusion is consistent on one point: this is garment-to-garment replacement, not dressing a naked person. If the model is already wearing a similar piece - shirt to shirt, dress to dress - parsing finds the region to replace and results are dramatically better. If parsing can't find a garment to mask, the whole thing silently degrades.
How to install
Install the pack once and all three of its nodes come along. Easiest path is ComfyUI Manager (search "ComfyUI OOTDiffusion"); manually it's:
cd ComfyUI/custom_nodes
git clone https://github.com/AuroBit/ComfyUI-OOTDiffusion
pip install -r ComfyUI-OOTDiffusion/requirements.txt
Here's the honest part: this is one of the fiddlier installs in the ecosystem. The pack pins diffusers==0.24.0, which can fight other nodes' diffusers requirements; it needs torch with CUDA and the nvcc compiler for its C++ extensions; and on Windows you need Visual Studio build tools plus a vcvars64.bat session or the compile fails. Community threads from 2024 are full of "spent an hour, got an error" - budget for it, and read the pack README's Windows guide before you start. If the compile trips you up, install cuda-nvcc and point CUDA_HOME at it.
Common issues
- ValueError on category - half-body pipe with a non-upper-body category. Match the loader type to the garment.
- Compile failures at first load - missing nvcc/MSVC, not a code bug. Fix the toolchain, restart.
- Blurry or drifting cloth - try nudging
cfgup, and make sure the person already wears something similar. - Models download at first run - the pack pulls several GB of weights from Hugging Face on first use; that's expected, not a hang.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | MODEL | — | |
| cloth_image | IMAGE | — | |
| model_image | IMAGE | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 2.00–14 | — |
| category | COMBO | 3 options: Upper body, Lower body, Dress |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_masked | IMAGE | — |