See how any garment looks on you — powered by AI diffusion models
Upload a person photo + a garment image → get a photorealistic try-on result in seconds.
This project provides a ready-to-run Kaggle notebook that sets up a complete virtual try-on pipeline using the OOTDiffusion model. Through an intuitive Gradio web interface, you can upload any person photo and garment image to generate a realistic image of the person wearing that garment — no local setup required.
| Feature | Description |
|---|---|
| 🚀 One-Click Setup | Auto-installs dependencies, clones the repo, and downloads ~15 GB of model checkpoints |
| 🎨 High-Quality Output | Full 768×1024 resolution with 30 diffusion steps and lossless PNG pipeline |
| 🌐 Gradio Web UI | Generates a public gradio.live URL — access from any device, anywhere |
| 🧠 Smart Memory Mgmt | Built-in garbage collection & CUDA cache clearing for stable GPU performance |
| 🎛️ Configurable | Tune diffusion steps, guidance scale, and seed for full control over results |
Prerequisites: A free Kaggle account — everything runs in the cloud, no local install needed.
Step 1 ➜ Open the notebook & install dependencies (auto-restarts kernel)
Step 2 ➜ Download model checkpoints from HuggingFace (~15 GB)
Step 3 ➜ Launch the Gradio UI & get a public URL
- Open the notebook — Go to OOTDiffusion on Kaggle and click Copy & Edit.
- Enable GPU — Navigate to
Settings → Accelerator → GPU T4 ×2(or P100). - Run Step 1 — Installs all dependencies and restarts the kernel automatically.
- Run Step 2 — Downloads model checkpoints from HuggingFace (~15 GB, takes a few minutes).
- Run Step 3 — Launches the Gradio UI and prints a public URL.
- Try it out — Open the URL, upload a garment and a person photo, then click Generate! 🎉
┌─────────────────┐ ┌─────────────────┐
│ Garment Image │ │ Person Photo │
└────────┬────────┘ └────────┬─────────┘
│ │
│ ┌───────────▼───────────┐
│ │ OpenPose │
│ │ (Body Keypoints) │
│ ├───────────────────────┤
│ │ Human Parsing │
│ │ (Body Segmentation) │
│ └───────────┬───────────┘
│ │
▼ ▼
┌──────────────────────────────────────────────┐
│ OOTDiffusion HD Model │
│ │
│ CLIP Encoding → Outfitting Fusion │
│ → Denoising → Composition │
└──────────────────────┬───────────────────────┘
│
▼
┌─────────────────┐
│ Try-On Result │
│ 768 × 1024 px │
└─────────────────┘
Pipeline breakdown:
- Garment is encoded using CLIP ViT-L/14 to capture visual features.
- Person photo is preprocessed with OpenPose (keypoints) and Human Parsing (segmentation).
- Both are fed into OOTDiffusion HD which fuses the garment onto the person through guided diffusion.
| Parameter | Default | Range | Description |
|---|---|---|---|
| Steps | 30 |
10 – 50 | Diffusion steps — higher = better quality, slower generation |
| Guidance Scale | 2.0 |
1.0 – 5.0 | Controls garment fidelity — 2.0 is the sweet spot |
| Seed | -1 |
-1 or any int | Fixed seed for reproducibility, -1 for random |
💡 Tip: Use
Steps = 20for faster previews andSteps = 30–40for final results.
| Layer | Technology | Purpose |
|---|---|---|
| Diffusion Model | OOTDiffusion HD | Core virtual try-on generation |
| Vision Encoder | CLIP ViT-L/14 | Garment feature extraction |
| Pose Estimation | OpenPose | Body keypoint detection |
| Segmentation | Human Parsing (LIP) | Body region segmentation |
| Framework | PyTorch + Diffusers 0.24.0 | Deep learning backbone |
| Web UI | Gradio 3.41.2 | Interactive interface with public sharing |
| Platform | Kaggle Notebooks | Free cloud GPU compute |
📦 OOTDiffusion
├── 📓 kaggle_ootd.ipynb Main notebook — run this on Kaggle
├── 📄 README.md You are here
└── 📄 .gitignore Git ignore rules
| Limitation | Details |
|---|---|
| Upper-body only | Currently supports shirts, tops, jackets — no full-body or lower-body |
| GPU required | Needs a CUDA-capable GPU runtime (Kaggle T4 or P100) |
| Large downloads | Model checkpoints are ~15 GB — first run takes several minutes |
| Quality varies | Results depend on input image quality, pose, lighting, and garment complexity |
This project builds on the incredible work of:
- OOTDiffusion by Yuhao Xu et al. — the core virtual try-on diffusion model
- OpenAI CLIP — vision-language model for garment encoding
- Gradio — interactive ML web interface framework
- Kaggle — free cloud GPU compute platform
⭐ If you found this useful, give it a star!
Made with ❤️ by Daksh Bhalala