An state-of-the-art virtual try-on solution that combines the power of CATVTON (CatVTON: Concatenation Is All You Need for Virtual Try-On with Diffusion Models) with Flux fill inpainting model for realistic and accurate clothing transfer. Also inspired by In-Context LoRA for prompt engineering.
Running it now on website: CATVTON-FLUX-TRY-ON
Latest Achievement
(2025/1/26):
(2025/1/16):
(2024/12/6):
(2024/12/1):
(2024/11/26):
(2024/11/25):
6.0675811767578125 on VITON-HD dataset. Test configuration: scale 30, step 30.(2024/11/24):
5.593255043029785 on VITON-HD dataset. Test configuration: scale 30, step 30. My VITON-HD test inferencing results available here| Original | Garment | Result |
|---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
| Original clothed model | Restored garment result |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
Fine-tuning weights in Hugging Face: 🤗 catvton-flux-alpha
LORA weights in Hugging Face: 🤗 catvton-flux-lora-alpha
Fine-tuning weights in Hugging Face: 🤗 cat-tryoff-flux
The model weights are trained on the VITON-HD dataset.
Make sure you are running the code with VRAM >= 40GB. (I run all my experiments on a 80GB GPU, lower VRAM will cause OOM error. Will support lower VRAM in the future.)
bash
conda create -n flux python=3.10
conda activate flux
pip install -r requirements.txt
huggingface-cli login
You can download VITON-HD dataset from VITON-HD. The data structure is as follows: Structure of the Dataset directory should be as follows.
train
|-- ...
test
|-- image
|-- image-densepose
|-- agnostic-mask
|-- cloth
Run the following command to train the model (make sure you have 2xH100 80GB):
bash train_flux_inpaint.sh
Adjust the path to your dataset and txt file.
Run the following command to restore the front side of the garment from the clothed model image:
python tryoff_inference.py \
--image ./example/person/00069_00.jpg \
--mask ./example/person/00069_00_mask.png \
--seed 41 \
--output_tryon test_original.png \
--output_garment restored_garment6.png \
--steps 30
Run the following command to try on an image:
LORA version:
python tryon_inference_lora.py \
--image ./example/person/00008_00.jpg \
--mask ./example/person/00008_00_mask.png \
--garment ./example/garment/00034_00.jpg \
--seed 4096 \
--output_tryon test_lora.png \
--steps 30
Fine-tuning version:
python tryon_inference.py \
--image ./example/person/00008_00.jpg \
--mask ./example/person/00008_00_mask.png \
--garment ./example/garment/00034_00.jpg \
--seed 42 \
--output_tryon test.png \
--steps 30
Run the following command to start a gradio demo with LoRA weights:
python app.py
Run the following command to start a gradio demo without LoRA weights:
python app_no_lora.py
Gradio demo: Try-on Hugging Face: 🤗 CATVTON-FLUX-TRY-ON Try-off Hugging Face: 🤗 CAT-TRYOFF-FLUX
@misc{chong2024catvtonconcatenationneedvirtual,
title={CatVTON: Concatenation Is All You Need for Virtual Try-On with Diffusion Models},
author={Zheng Chong and Xiao Dong and Haoxiang Li and Shiyue Zhang and Wenqing Zhang and Xujie Zhang and Hanqing Zhao and Xiaodan Liang},
year={2024},
eprint={2407.15886},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2407.15886},
}
@article{lhhuang2024iclora,
title={In-Context LoRA for Diffusion Transformers},
author={Huang, Lianghua and Wang, Wei and Wu, Zhi-Fan and Shi, Yupeng and Dou, Huanzhang and Liang, Chen and Feng, Yutong and Liu, Yu and Zhou, Jingren},
journal={arXiv preprint arxiv:2410.23775},
year={2024}
}
Thanks to Jim for insisting on spatial concatenation. Thanks to dingkang MoonBlvd Stevada for the helpful discussions.
60 commits
5 commits
Python
99.1%
An state-of-the-art virtual try-on solution that combines the power of CATVTON (CatVTON: Concatenation Is All You Need for Virtual Try-On with Diffusion Models) with Flux fill inpainting model for realistic and accurate clothing transfer. Also inspired by In-Context LoRA for prompt engineering.
Running it now on website: CATVTON-FLUX-TRY-ON
Latest Achievement
(2025/1/26):
(2025/1/16):
(2024/12/6):
(2024/12/1):
(2024/11/26):
(2024/11/25):
6.0675811767578125 on VITON-HD dataset. Test configuration: scale 30, step 30.(2024/11/24):
5.593255043029785 on VITON-HD dataset. Test configuration: scale 30, step 30. My VITON-HD test inferencing results available here| Original | Garment | Result |
|---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
| Original clothed model | Restored garment result |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
Fine-tuning weights in Hugging Face: 🤗 catvton-flux-alpha
LORA weights in Hugging Face: 🤗 catvton-flux-lora-alpha
Fine-tuning weights in Hugging Face: 🤗 cat-tryoff-flux
The model weights are trained on the VITON-HD dataset.
Make sure you are running the code with VRAM >= 40GB. (I run all my experiments on a 80GB GPU, lower VRAM will cause OOM error. Will support lower VRAM in the future.)
bash
conda create -n flux python=3.10
conda activate flux
pip install -r requirements.txt
huggingface-cli login
You can download VITON-HD dataset from VITON-HD. The data structure is as follows: Structure of the Dataset directory should be as follows.
train
|-- ...
test
|-- image
|-- image-densepose
|-- agnostic-mask
|-- cloth
Run the following command to train the model (make sure you have 2xH100 80GB):
bash train_flux_inpaint.sh
Adjust the path to your dataset and txt file.
Run the following command to restore the front side of the garment from the clothed model image:
python tryoff_inference.py \
--image ./example/person/00069_00.jpg \
--mask ./example/person/00069_00_mask.png \
--seed 41 \
--output_tryon test_original.png \
--output_garment restored_garment6.png \
--steps 30
Run the following command to try on an image:
LORA version:
python tryon_inference_lora.py \
--image ./example/person/00008_00.jpg \
--mask ./example/person/00008_00_mask.png \
--garment ./example/garment/00034_00.jpg \
--seed 4096 \
--output_tryon test_lora.png \
--steps 30
Fine-tuning version:
python tryon_inference.py \
--image ./example/person/00008_00.jpg \
--mask ./example/person/00008_00_mask.png \
--garment ./example/garment/00034_00.jpg \
--seed 42 \
--output_tryon test.png \
--steps 30
Run the following command to start a gradio demo with LoRA weights:
python app.py
Run the following command to start a gradio demo without LoRA weights:
python app_no_lora.py
Gradio demo: Try-on Hugging Face: 🤗 CATVTON-FLUX-TRY-ON Try-off Hugging Face: 🤗 CAT-TRYOFF-FLUX
@misc{chong2024catvtonconcatenationneedvirtual,
title={CatVTON: Concatenation Is All You Need for Virtual Try-On with Diffusion Models},
author={Zheng Chong and Xiao Dong and Haoxiang Li and Shiyue Zhang and Wenqing Zhang and Xujie Zhang and Hanqing Zhao and Xiaodan Liang},
year={2024},
eprint={2407.15886},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2407.15886},
}
@article{lhhuang2024iclora,
title={In-Context LoRA for Diffusion Transformers},
author={Huang, Lianghua and Wang, Wei and Wu, Zhi-Fan and Shi, Yupeng and Dou, Huanzhang and Liang, Chen and Feng, Yutong and Liu, Yu and Zhou, Jingren},
journal={arXiv preprint arxiv:2410.23775},
year={2024}
}
Thanks to Jim for insisting on spatial concatenation. Thanks to dingkang MoonBlvd Stevada for the helpful discussions.
60 commits
5 commits
Python
99.1%