Virtual Try-on using Flux Kontext LoRA
A simple and efficient virtual try-on model that can run on a single RTX 4090 with 1184x864 resolution.
Installation
Recommend creating a virtual env with python 3.11, e.g. with conda.
Tested on CUDA 12.8 and so will attempt to install corresponding pytorch version
pip install -r requirements.txt
Run
Clone Github repo @ FluxKontext_Tryon
python app.py
Note
We quantize the DiT to 8-bit and use torch.compile by default so first run will be slightly longer.
We also quantize the T5 text encoder to 8-bit precision as well.
Users who have access to more compute can modify the code to enable higher precision.
Safety
The model may generate some NSFW images depending on the clothes provided. Thus, we have implemented a safety checker using Qwen3-VL-8B.
NSFW images detected will be replaced by a black image.
Acknowledgement
Our code is modified based on Diffusers. We adopt Flux.1-Kontext-dev as the base model. We also use Qwen/Qwen3-VL-8B-Instruct in our code base.
Model tree for sean96t/Flux-Kontext-TryOn
Base model
black-forest-labs/FLUX.1-Kontext-dev