File size: 4,474 Bytes
ae01c4b
 
 
 
 
 
b64e35e
 
 
 
 
 
 
ae01c4b
761f47d
b64e35e
761f47d
b64e35e
761f47d
b64e35e
 
 
ae01c4b
 
 
761f47d
ae01c4b
761f47d
ae01c4b
230ca1b
ae01c4b
 
 
 
 
761f47d
ae01c4b
761f47d
7894832
ae01c4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761f47d
 
ae01c4b
761f47d
ae01c4b
761f47d
230ca1b
7894832
 
 
 
ae01c4b
7894832
 
 
 
 
 
 
 
ae01c4b
761f47d
ae01c4b
 
 
 
 
 
230ca1b
761f47d
ae01c4b
761f47d
ae01c4b
b64e35e
7894832
b64e35e
7894832
ae01c4b
7894832
761f47d
ae01c4b
761f47d
b64e35e
ae01c4b
 
 
 
 
761f47d
ae01c4b
761f47d
b64e35e
ae01c4b
 
 
761f47d
7894832
761f47d
ae01c4b
 
 
b64e35e
 
 
 
 
 
 
 
 
 
 
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
---
language:
- en
- zh
task_categories:
- image-to-image
pretty_name: FreeStyle CRef/SRef LoRA Triplet Dataset
license: cc-by-nc-4.0
tags:
- style-transfer
- diffusion
- lora
- dual-reference-generation
---

# FreeStyle: Free Control of Style-Content Dual-Reference Generation from Community LoRA Mining

[**Project Page**](https://blue2giant.github.io/FreeStyle/) | [**Paper**](https://huggingface.co/papers/2606.20506) | [**GitHub**](https://github.com/Blue2Giant/FreeStyle)

This dataset contains CRef/SRef LoRA triplets exported from the 0426 diffusion training data. It was introduced as part of **FreeStyle**, a scalable dual-reference generation framework that treats community LoRAs as compositional anchors for style and content.

Each training example in this dataset consists of three images:
- **content**: content reference image, used as `cref_0`
- **style**: style reference image, used as `sref_0`
- **target**: image generated from the combined content + style condition

Use `triplets.csv` as the main entry point. Image-level CSV files are provided only for deduplicated metadata and provenance lookup.

## Sources

| Directory | Base model | Original source | Triplets |
| --- | --- | --- | ---: |
| `cref_sref/qwen/` | `qwen` | `cref_sref_qwen_lora_part1` | 33,582 |
| `cref_sref/flux/` | `flux` | `cref_sref_flux_lora_part1` | 273,682 |
| `cref_sref/illustrious/` | `illustrious` | `cref_sref_illustrious_lora_part1` | 172,589 |

## Layout

```text
<repo-root>/
  README.md
  cref_sref/
    README.md
    qwen/
      triplets.csv
      content_images.csv
      style_images.csv
      target_images.csv
      images/content/...
      images/style/...
      images/target/...
    flux/
      ... same structure ...
    illustrious/
      ... same structure ...
```

## How To Use

Pick one source directory and read its `triplets.csv`:

```python
import csv
from pathlib import Path
from PIL import Image

source_dir = Path("/path/to/FreeStyle_Dataset/cref_sref/qwen")  # qwen / flux / illustrious

with open(source_dir / "triplets.csv", newline="", encoding="utf-8") as f:
    row = next(csv.DictReader(f))

content = Image.open(source_dir / row["content_image_path"]).convert("RGB")
style = Image.open(source_dir / row["style_image_path"]).convert("RGB")
target = Image.open(source_dir / row["target_image_path"]).convert("RGB")

print(row["sequence_id"])

# One training-compatible text pair. The original training samples one of several
# instruction/caption choices; see the next section.
instruction = row["vault_primary_instruction_en_123"]
target_caption = row["vault_captions_scene_3_en"]
print(instruction)
print(target_caption)
```

## Which Prompt Fields Are Used For Training?

The 0426 training config uses the three lora-triplet sources:
`cref_sref_qwen_lora_part1`, `cref_sref_flux_lora_part1`, and `cref_sref_illustrious_lora_part1`.

In the training loader, a sample is represented by:
```text
<cref_0 image> <sref_0 image> <instruction text> <target caption text> <target image>
```

For these lora-triplet sources, the training DB provides 8 text choices per sequence. Each choice uses exactly one instruction field plus one target-caption field:

| Instruction field | Vault text index |
| --- | --- |
| `vault_primary_instruction_en_123` | `primary_instruction_en_123` |
| `vault_primary_instruction_cn_123` | `primary_instruction_cn_123` |
| `vault_sample_instruction_en_123` | `sample_instruction_en_123` |
| `vault_sample_instruction_cn_123` | `sample_instruction_cn_123` |

paired with one of:

| Target-caption field | Vault text index |
| --- | --- |
| `vault_captions_scene_3_en` | `captions/scene_3_en` |
| `vault_captions_scene_3` | `captions/scene_3` |

## Notes

- Images are deduplicated; the same image file may appear in multiple triplet rows.
- `original_path` and prompt fields are best-effort provenance metadata and may be unresolved for some rows.
- For detailed column definitions and provenance status values, see `cref_sref/README.md`.

## Citation

```bibtex
@article{lan2026freestyle,
  title         = {FreeStyle: Free Control of Style-Content Dual-Reference Generation from Community LoRA Mining},
  author        = {Lan, Jinghong and Cheng, Wei and Chen, Yunuo and Ye, Ziqi and Xing, Peng and Fang, Yixiao and Wang, Rui and Yang, Yufeng and Zhang, Xuanyang and Zou, Difan and Zeng, Xianfang and Yu, Gang and Zhang, Chi},
  journal       = {arXiv preprint arXiv:2606.20506},
  year          = {2026}
}
```