Instructions to use xocialize/tryon-FLUX.2-klein-4B-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use xocialize/tryon-FLUX.2-klein-4B-lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", torch_dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("xocialize/tryon-FLUX.2-klein-4B-lora") prompt = "TRYON" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Virtual Try-On β FLUX.2-klein-4B LoRA
A rank-32 edit LoRA for FLUX.2-klein-4B that dresses a person in a specified outfit. 3 ordered inputs β 1 output:
- person β a full-body photo with the clothing region masked out (clothing-agnostic)
- top β the upper-body garment (isolated, product-style)
- bottom β the lower-body garment (isolated); for a one-piece dress, use the dress in both slots
Output: the person wearing the specified top + bottom, with identity, pose, and background preserved.
Usage
- Base: FLUX.2-klein-4B (image edit / multi-reference).
- Trigger / prompt:
TRYON a full-body photo of a person. Replace the outfit with the top and bottom as shown in the reference images. The final image is a full body shot. - Reference order (load-bearing):
person, top, bottom. - Note: the person input should be clothing-agnostic (the outfit region greyed/masked), matching how the model was trained β agnostic-ify the input before inference.
Training
Self-trained with ai-toolkit (v0.10.24) on
black-forest-labs/FLUX.2-klein-base-4B (Apache-2.0). Rank 32 / alpha 32, adamw8bit, lr 1e-4,
flowmatch, qfloat8, 3000 steps β this is the step-2000 checkpoint (best generalization in
reconstruction + outfit-swap eval). Dataset: 273 full-body fashion tuples, each derived from a
single photo via clothing-agnostic masking + garment-part segmentation
(mattmdjaga/segformer_b2_clothes) + Qwen2.5-VL captioning. Source frames are Pexels
(train-only) and are NOT redistributed β only the trained weights are published here.
Provenance
| File | tryon-klein-4b.safetensors |
| Size | 92,426,760 bytes |
| SHA-256 | E251C836B4792910CB322317F58A91063F73BEF7255031912886AF840DC7DD43 |
| Rank | 32 (BFL-fused dialect) |
| Base | black-forest-labs/FLUX.2-klein-4B |
| Checkpoint | ai-toolkit step 2000 / 3000 |
Known limitations (v1)
- Garment-part segmentation occasionally includes nearby objects (e.g. furniture the subject sits on) in the bottom crop, which can render as a faint artifact. A matting-refinement pass on the control crops is planned for v2.
- Best on full-body, standing/seated fashion framing; all-dark outfits are the weakest case.
Apache-2.0. Trained by xocialize.
- Downloads last month
- 24
Model tree for xocialize/tryon-FLUX.2-klein-4B-lora
Base model
black-forest-labs/FLUX.2-klein-4B