File size: 1,987 Bytes
e31ee35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
tags:
- text-to-image
- flux
- lora
- diffusers
- tryon
- virtual-try-on
- kontext
base_model: black-forest-labs/FLUX.1-dev
instance_prompt: a photo
widget:
- text: "a photo of person wearing elegant dress"
---

# Kontext Tryon Universal - 1031

这是一个基于 FLUX.1 的通用虚拟试穿(Virtual Try-On)LoRA 模型。

## 模型信息

- **基础模型**: FLUX.1-dev
- **训练方法**: LoRA (Low-Rank Adaptation)
- **训练数据**: Kontext 1022 merged with real (filtered)
- **Epoch**: 4
- **文件大小**: 4.6 GB
- **文件格式**: SafeTensors

## 使用方法

### 使用 Diffusers 库

```python
from diffusers import FluxPipeline
import torch

# 加载基础模型
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.bfloat16
)

# 加载 LoRA 权重
pipe.load_lora_weights(
    "mike-srp/kontext-tryon-universal-1031",
    weight_name="epoch-4.safetensors"
)

pipe.to("cuda")

# 生成图像
prompt = "a photo of person wearing elegant dress"
image = pipe(
    prompt,
    num_inference_steps=50,
    guidance_scale=7.5
).images[0]

image.save("tryon_result.png")
```

### 下载模型文件

```python
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="mike-srp/kontext-tryon-universal-1031",
    filename="epoch-4.safetensors"
)

print(f"模型已下载到: {model_path}")
```

### 在你的推理服务中使用

```python
import os
from diffusers import FluxPipeline

# 设置 LoRA 路径
lora_path = "mike-srp/kontext-tryon-universal-1031"

pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
pipe.load_lora_weights(lora_path, weight_name="epoch-4.safetensors")
```

## 适用场景

- 虚拟试穿
- 服装展示
- 时尚设计
- 电商产品展示

## 许可证

请遵守 FLUX.1 的使用条款和相关许可证。

## 作者

- **Organization**: [srpone](https://huggingface.co/srpone)
- **Author**: [mike-srp](https://huggingface.co/mike-srp)