Spaces:
Running
Running
File size: 4,887 Bytes
e4c2a51 c1f23f8 e4c2a51 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | ---
title: Virtual Try-On
emoji: ๐
colorFrom: blue
colorTo: pink
sdk: gradio
app_file: app.py
pinned: false
python_version: 3.10.20
---
# FASHN VTON v1.5: Efficient Maskless Virtual Try-On in Pixel Space
<div align="center">
<a href="https://fashn.ai/research/vton-1-5"><img src='https://img.shields.io/badge/Project-Page-1A1A1A?style=flat' alt='Project Page'></a> 
<a href='https://huggingface.co/fashn-ai/fashn-vton-1.5'><img src='https://img.shields.io/badge/Hugging%20Face-Model-FFD21E?style=flat&logo=HuggingFace&logoColor=FFD21E' alt='Hugging Face Model'></a> 
<a href="https://huggingface.co/spaces/fashn-ai/fashn-vton-1.5"><img src='https://img.shields.io/badge/Hugging%20Face-Spaces-FFD21E?style=flat&logo=HuggingFace&logoColor=FFD21E' alt='Hugging Face Spaces'></a> 
<a href=""><img src='https://img.shields.io/badge/arXiv-Coming%20Soon-b31b1b?style=flat&logo=arXiv&logoColor=b31b1b' alt='arXiv'></a> 
<a href="LICENSE"><img src='https://img.shields.io/badge/License-Apache--2.0-gray?style=flat' alt='License'></a>
</div>
by [FASHN AI](https://fashn.ai)
Virtual try-on model that generates photorealistic images directly in pixel space without requiring segmentation masks.
<p align="center">
<img src="https://static.fashn.ai/repositories/fashn-vton-v15/results/hero_collage.webp" alt="FASHN VTON v1.5 examples" width="900">
</p>
This repo contains minimal inference code to run virtual try-on with the FASHN VTON v1.5 model weights. Given a person image and a garment image, the model generates a photorealistic image of the person wearing the garment. Supports both model photos and flat-lay product shots as garment inputs.
---
## Local Installation
We recommend using a virtual environment:
```bash
git clone https://github.com/fashn-AI/fashn-vton-1.5.git
cd fashn-vton-1.5
python -m venv .venv && source .venv/bin/activate
pip install -e .
```
**Note:** Installation includes `onnxruntime-gpu` for GPU-accelerated pose detection. Ensure CUDA is properly configured on your system. For CPU-only environments, replace with the CPU version:
```bash
pip uninstall onnxruntime-gpu && pip install onnxruntime
```
---
## Model Weights
Download the required model weights (~2 GB total):
```bash
python scripts/download_weights.py --weights-dir ./weights
```
This downloads:
- `model.safetensors` โ TryOnModel weights from [HuggingFace](https://huggingface.co/fashn-ai/fashn-vton-1.5)
- `dwpose/` โ DWPose ONNX models for pose detection
**Note:** The human parser weights (~244 MB) are automatically downloaded on first use to the HuggingFace cache folder. Set `HF_HOME` to customize the location.
---
## Usage
```python
from fashn_vton import TryOnPipeline
from PIL import Image
# Initialize pipeline (automatically uses GPU if available)
pipeline = TryOnPipeline(weights_dir="./weights")
# Load images
person = Image.open("examples/data/model.webp").convert("RGB")
garment = Image.open("examples/data/garment.webp").convert("RGB")
# Run inference
result = pipeline(
person_image=person,
garment_image=garment,
category="tops", # "tops" | "bottoms" | "one-pieces"
)
# Save output
result.images[0].save("output.png")
```
### CLI
```bash
python examples/basic_inference.py \
--weights-dir ./weights \
--person-image examples/data/model.webp \
--garment-image examples/data/garment.webp \
--category tops
```
**Note:** The pipeline automatically uses GPU if available. The try-on model weights are stored in bfloat16 and will run in bf16 precision on Ampere+ GPUs (RTX 30xx/40xx, A100, H100). On older hardware or CPU, weights are converted to float32.
See [`examples/basic_inference.py`](examples/basic_inference.py) for additional options.
---
## Categories
| Category | Description |
|----------|-------------|
| `tops` | Upper body: t-shirts, blouses, jackets |
| `bottoms` | Lower body: pants, skirts, shorts |
| `one-pieces` | Full body: dresses, jumpsuits |
---
## API
FASHN provides a suite of [fashion AI APIs](https://fashn.ai/products/api) including virtual try-on, model generation, image-to-video, and more. See the [docs](https://docs.fashn.ai/) to get started.
---
## Citation
If you use FASHN VTON v1.5 in your research, please cite:
```bibtex
@article{bochman2026fashnvton,
title={FASHN VTON v1.5: Efficient Maskless Virtual Try-On in Pixel Space},
author={Bochman, Dan and Bochman, Aya},
journal={arXiv preprint},
year={2026},
note={Paper coming soon}
}
```
---
## License
Apache-2.0. See [LICENSE](LICENSE) for details.
**Third-party components:**
- [DWPose](https://github.com/IDEA-Research/DWPose) (Apache-2.0)
- [YOLOX](https://github.com/Megvii-BaseDetection/YOLOX) (Apache-2.0)
- [fashn-human-parser](https://github.com/fashn-AI/fashn-human-parser) ([License](https://github.com/fashn-AI/fashn-human-parser?tab=readme-ov-file#license))
|