From Pixels to Perfection: Mastering AI-Generated Clothing Replacement
1. Workflow Overview

This is an AI-powered clothing replacement workflow featuring:
Automatic garment segmentation with BiRefNet
Context-aware inpainting using Flux Fill model
High-resolution output (default 1024x1536)
Key Models:
BiRefNet
: Human parsing model (auto-downloaded)Flux Fill fp8
: Quantized model for clothing redrawControlNet LoRA
: Style control (F.1_Fashion_Model_Sportswear_1.0
)
2. Critical Nodes
Node | Function | Installation |
---|---|---|
| Garment masking with BiRefNet | Install comfyui-easy-use |
| Smart cropping with context preservation |
|
| Advanced inpainting with CLIP vision guidance | Requires AdvancedRefluxControl |
Dependencies:
Model Files:
Flux Fill dev - fp8_黑森林官方重绘模型_fp8_e4m3fn
→ Save tomodels/flux/
flux1-redux-dev.style
→ Save tomodels/style_models/
3. Workflow Structure
Phase 1: Input Processing
Loads source image (
yellow-dress.jpg
)Generates garment mask (expanded by 50px via
GrowMask
)
Phase 2: Local Redraw
Crops garment area (forced size 1024x1024)
Applies LoRA for style control (weight=0.8)
Prompt: "A hyper-realistic photograph, a young lady in a vibrant yellow short-sleeved dress..."
Phase 3: Composition
Seamless blending with
ImageCompositeMasked
Post-processed with
bislerp
stitching
4. Inputs & Outputs
Required Inputs:
Source person image (transparent background supported)
Optional clothing reference (
magazine.png
)
Outputs:
Redrawn clothing only (
ComfyUI/temp_...png
)Final composited image (
ComfyUI/output_...jpg
)
5. Important Notes
⚠️ Hardware:
Minimum 8GB VRAM (FP8 model reduces usage)
Launch with --xformers for acceleration
🔧 Troubleshooting:
Rough garment edges:
Adjust
GrowMask
expansion value (default=50)Change
InpaintCrop
resize mode tobicubic
Style mismatch:
Switch LoRA model (multiple fashion LoRAs pre-loaded)