Datasets:
Improve cref_sref dataset usage README
Browse files- README.md +203 -150
- cref_sref/README.md +68 -18
README.md
CHANGED
|
@@ -1,205 +1,258 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
- `/
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
- `
|
| 10 |
-
- `
|
| 11 |
-
-
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
HF_UPLOAD_CHECKLIST.md
|
| 22 |
-
README.md
|
| 23 |
-
qwen/
|
| 24 |
-
flux/
|
| 25 |
-
illustrious/
|
| 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 |
-
- `style`: the image used for `sref_0`
|
| 58 |
-
- `target`: the image used for the combined content+style target
|
| 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 |
-
- `sequence_count`: how many triplets reuse this exported image
|
| 112 |
-
- `sequence_ids_json`: which triplets reuse this image
|
| 113 |
|
| 114 |
-
|
| 115 |
|
| 116 |
-
##
|
| 117 |
|
| 118 |
-
``
|
| 119 |
-
python3 - <<'PY'
|
| 120 |
-
import csv
|
| 121 |
-
path = '/path/to/repo/cref_sref/qwen/triplets.csv'
|
| 122 |
-
with open(path, 'r', encoding='utf-8', newline='') as fh:
|
| 123 |
-
row = next(csv.DictReader(fh))
|
| 124 |
-
for key in [
|
| 125 |
-
'sequence_id',
|
| 126 |
-
'pair_key',
|
| 127 |
-
'content_image_path',
|
| 128 |
-
'style_image_path',
|
| 129 |
-
'target_image_path',
|
| 130 |
-
'content_match_status',
|
| 131 |
-
'style_match_status',
|
| 132 |
-
'target_match_status',
|
| 133 |
-
'content_generation_prompt',
|
| 134 |
-
'style_generation_prompt',
|
| 135 |
-
'target_generation_prompt',
|
| 136 |
-
]:
|
| 137 |
-
print(f'{key}: {row[key]}')
|
| 138 |
-
PY
|
| 139 |
-
```
|
| 140 |
|
| 141 |
-
|
| 142 |
|
| 143 |
-
``
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
```
|
| 158 |
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
-
Join:
|
| 162 |
|
| 163 |
- `triplets.csv.content_image_path` -> `content_images.csv.exported_image_path`
|
| 164 |
- `triplets.csv.style_image_path` -> `style_images.csv.exported_image_path`
|
| 165 |
- `triplets.csv.target_image_path` -> `target_images.csv.exported_image_path`
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
|
|
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
- `ambiguous`: more than one candidate matched the same visual key
|
| 180 |
- `no_candidates`: no candidate pool was available for that lookup
|
| 181 |
|
| 182 |
-
|
| 183 |
|
| 184 |
-
- `resolved`:
|
| 185 |
- `unmatched_original`: original image path was not matched
|
| 186 |
-
- `missing_prompt_payload`: prompt sidecar
|
| 187 |
- `missing_prompt_entry`: prompt file existed, but the specific image entry was missing
|
| 188 |
- `missing_prompt_index`: image filename could not be mapped to a prompt index
|
| 189 |
|
| 190 |
-
## Important
|
| 191 |
-
|
| 192 |
-
- Exported images are vault training images, not raw copies of original one-lora or dual-lora PNG files.
|
| 193 |
-
- `original_path` and prompt recovery fields are best-effort provenance fields.
|
| 194 |
-
- Some rows intentionally remain unmatched rather than risk incorrect prompt assignment.
|
| 195 |
-
- `_state/` is internal resume state used during export; it is not required for ordinary dataset consumption.
|
| 196 |
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
|
| 200 |
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
|
|
|
|
|
|
| 204 |
|
| 205 |
-
For detailed per-source match counts, see each source's `summary.json`.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: "FreeStyle Dataset: cref/sref LoRA Triplets"
|
| 3 |
+
task_categories:
|
| 4 |
+
- image-to-image
|
| 5 |
+
tags:
|
| 6 |
+
- image-to-image
|
| 7 |
+
- style-reference
|
| 8 |
+
- content-reference
|
| 9 |
+
- lora
|
| 10 |
+
- triplet
|
| 11 |
+
- prompt-provenance
|
| 12 |
+
size_categories:
|
| 13 |
+
- 100K<n<1M
|
| 14 |
+
---
|
| 15 |
|
| 16 |
+
# FreeStyle Dataset: cref/sref LoRA Triplets
|
| 17 |
|
| 18 |
+
This repository contains a file-based image triplet dataset for content-reference (`cref`) and style-reference (`sref`) training/evaluation. The exported payload is under [`cref_sref/`](./cref_sref/).
|
| 19 |
|
| 20 |
+
Each row in a `triplets.csv` file represents one training sequence with three images:
|
| 21 |
|
| 22 |
+
- **content**: image used as the content reference (`cref_0`)
|
| 23 |
+
- **style**: image used as the style reference (`sref_0`)
|
| 24 |
+
- **target**: image for the combined content+style result
|
| 25 |
|
| 26 |
+
The images are deduplicated within each source/role. A single image file can be reused by multiple triplet rows.
|
| 27 |
|
| 28 |
+
## Quick Start
|
| 29 |
|
| 30 |
+
Install lightweight dependencies:
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
pip install huggingface_hub pandas pillow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
```
|
| 35 |
|
| 36 |
+
Download and inspect the metadata for one source without downloading all images:
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from huggingface_hub import hf_hub_download
|
| 40 |
+
import pandas as pd
|
| 41 |
+
|
| 42 |
+
repo_id = "Blue2Giant/FreeStyle_Dataset"
|
| 43 |
+
source = "qwen" # one of: qwen, flux, illustrious
|
| 44 |
+
|
| 45 |
+
triplets_csv = hf_hub_download(
|
| 46 |
+
repo_id=repo_id,
|
| 47 |
+
repo_type="dataset",
|
| 48 |
+
filename=f"cref_sref/{source}/triplets.csv",
|
| 49 |
+
)
|
| 50 |
+
triplets = pd.read_csv(triplets_csv)
|
| 51 |
+
|
| 52 |
+
print(len(triplets))
|
| 53 |
+
print(triplets[[
|
| 54 |
+
"sequence_id",
|
| 55 |
+
"content_image_path",
|
| 56 |
+
"style_image_path",
|
| 57 |
+
"target_image_path",
|
| 58 |
+
"content_generation_prompt",
|
| 59 |
+
"style_generation_prompt",
|
| 60 |
+
"target_generation_prompt",
|
| 61 |
+
]].head())
|
| 62 |
+
```
|
| 63 |
|
| 64 |
+
Download the three images for one triplet:
|
| 65 |
|
| 66 |
+
```python
|
| 67 |
+
from huggingface_hub import hf_hub_download
|
| 68 |
+
from PIL import Image
|
| 69 |
+
import pandas as pd
|
| 70 |
+
|
| 71 |
+
repo_id = "Blue2Giant/FreeStyle_Dataset"
|
| 72 |
+
source = "qwen"
|
| 73 |
+
|
| 74 |
+
triplets_csv = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/triplets.csv")
|
| 75 |
+
triplets = pd.read_csv(triplets_csv)
|
| 76 |
+
row = triplets.iloc[0]
|
| 77 |
+
|
| 78 |
+
paths = {}
|
| 79 |
+
for role in ["content", "style", "target"]:
|
| 80 |
+
rel = row[f"{role}_image_path"] # relative to cref_sref/<source>/
|
| 81 |
+
paths[role] = hf_hub_download(
|
| 82 |
+
repo_id=repo_id,
|
| 83 |
+
repo_type="dataset",
|
| 84 |
+
filename=f"cref_sref/{source}/{rel}",
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
images = {role: Image.open(path).convert("RGB") for role, path in paths.items()}
|
| 88 |
+
print(row["sequence_id"], images["content"].size, images["style"].size, images["target"].size)
|
| 89 |
```
|
| 90 |
|
| 91 |
+
## Recommended Download Patterns
|
| 92 |
|
| 93 |
+
This is a large file-tree dataset. Prefer selective downloads rather than cloning/downloading the entire repository at once.
|
| 94 |
|
| 95 |
+
Download all CSV/JSON/README metadata, but no images:
|
|
|
|
|
|
|
| 96 |
|
| 97 |
+
```python
|
| 98 |
+
from huggingface_hub import snapshot_download
|
| 99 |
|
| 100 |
+
snapshot_dir = snapshot_download(
|
| 101 |
+
repo_id="Blue2Giant/FreeStyle_Dataset",
|
| 102 |
+
repo_type="dataset",
|
| 103 |
+
allow_patterns=[
|
| 104 |
+
"README.md",
|
| 105 |
+
"cref_sref/README.md",
|
| 106 |
+
"cref_sref/*/README.md",
|
| 107 |
+
"cref_sref/*/summary.json",
|
| 108 |
+
"cref_sref/*/*.csv",
|
| 109 |
+
],
|
| 110 |
+
)
|
| 111 |
+
print(snapshot_dir)
|
| 112 |
+
```
|
| 113 |
|
| 114 |
+
Download one complete source, including images:
|
| 115 |
|
| 116 |
+
```python
|
| 117 |
+
from huggingface_hub import snapshot_download
|
| 118 |
|
| 119 |
+
source = "qwen" # qwen is the smallest; flux and illustrious are much larger
|
| 120 |
+
snapshot_dir = snapshot_download(
|
| 121 |
+
repo_id="Blue2Giant/FreeStyle_Dataset",
|
| 122 |
+
repo_type="dataset",
|
| 123 |
+
allow_patterns=["README.md", "cref_sref/README.md", f"cref_sref/{source}/**"],
|
| 124 |
+
)
|
| 125 |
+
print(snapshot_dir)
|
| 126 |
+
```
|
| 127 |
|
| 128 |
+
If you need the full dataset, use `snapshot_download(repo_type="dataset")`, but expect many files.
|
| 129 |
|
| 130 |
+
## Repository Layout
|
| 131 |
|
| 132 |
+
```text
|
| 133 |
+
<repo-root>/
|
| 134 |
+
README.md # this guide
|
| 135 |
+
cref_sref/
|
| 136 |
+
README.md # payload-level guide
|
| 137 |
+
HF_UPLOAD_CHECKLIST.md
|
| 138 |
+
qwen/
|
| 139 |
+
README.md
|
| 140 |
+
summary.json
|
| 141 |
+
triplets.csv
|
| 142 |
+
content_images.csv
|
| 143 |
+
style_images.csv
|
| 144 |
+
target_images.csv
|
| 145 |
+
images/
|
| 146 |
+
content/...
|
| 147 |
+
style/...
|
| 148 |
+
target/...
|
| 149 |
+
flux/
|
| 150 |
+
... same layout ...
|
| 151 |
+
illustrious/
|
| 152 |
+
... same layout ...
|
| 153 |
+
```
|
| 154 |
|
| 155 |
+
Public upload notes:
|
| 156 |
|
| 157 |
+
- `_state/` export-resume folders are omitted.
|
| 158 |
+
- `logs/` are omitted.
|
| 159 |
+
- Paths stored in `triplets.csv` are relative to the source directory, e.g. relative to `cref_sref/qwen/`.
|
| 160 |
|
| 161 |
+
## Sources and Counts
|
| 162 |
|
| 163 |
+
| Source | Triplet rows | Unique content images | Unique style images | Unique target images |
|
| 164 |
+
|---|---:|---:|---:|---:|
|
| 165 |
+
| `qwen` | 33,582 | 90 | 424 | 5,162 |
|
| 166 |
+
| `flux` | 273,682 | 482 | 13,037 | 129,237 |
|
| 167 |
+
| `illustrious` | 172,589 | 8,045 | 1,581 | 65,952 |
|
| 168 |
+
| **Total** | **479,853** | **8,617** | **15,042** | **200,351** |
|
|
|
|
|
|
|
| 169 |
|
| 170 |
+
Total exported image files across source/role directories: **224,010**.
|
| 171 |
|
| 172 |
+
## File Semantics
|
| 173 |
|
| 174 |
+
### `triplets.csv`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
+
Use `triplets.csv` as the main training/evaluation index. Important columns include:
|
| 177 |
|
| 178 |
+
- `sequence_id`: unique sequence id
|
| 179 |
+
- `base_model`: one of `qwen`, `flux`, `illustrious`
|
| 180 |
+
- `pair_key`: pair identifier
|
| 181 |
+
- `content_model_id`, `style_model_id`
|
| 182 |
+
- `content_image_path`, `style_image_path`, `target_image_path`
|
| 183 |
+
- `content_original_path`, `style_original_path`, `target_original_path`
|
| 184 |
+
- `content_match_status`, `style_match_status`, `target_match_status`
|
| 185 |
+
- `content_prompt_status`, `style_prompt_status`, `target_prompt_status`
|
| 186 |
+
- `content_generation_prompt`, `style_generation_prompt`, `target_generation_prompt`
|
| 187 |
+
- `vault_texts_json`
|
| 188 |
+
|
| 189 |
+
For model training, the most common fields are the three `*_image_path` columns and, when available, the three `*_generation_prompt` columns.
|
| 190 |
+
|
| 191 |
+
### `content_images.csv`, `style_images.csv`, `target_images.csv`
|
|
|
|
| 192 |
|
| 193 |
+
These files are deduplicated image-level metadata tables. Important columns include:
|
| 194 |
+
|
| 195 |
+
- `exported_image_path`: image path relative to the source directory
|
| 196 |
+
- `original_path`: best-effort recovered original generation image path
|
| 197 |
+
- `match_status`: original-path matching status
|
| 198 |
+
- `prompt_status`: prompt recovery status
|
| 199 |
+
- `generation_prompt`
|
| 200 |
+
- `base_prompt`
|
| 201 |
+
- `sequence_count`: number of triplet rows that reuse this image
|
| 202 |
+
- `sequence_ids_json`: triplet ids that reuse this image
|
| 203 |
|
| 204 |
+
Join keys:
|
| 205 |
|
| 206 |
- `triplets.csv.content_image_path` -> `content_images.csv.exported_image_path`
|
| 207 |
- `triplets.csv.style_image_path` -> `style_images.csv.exported_image_path`
|
| 208 |
- `triplets.csv.target_image_path` -> `target_images.csv.exported_image_path`
|
| 209 |
|
| 210 |
+
Example join:
|
| 211 |
|
| 212 |
+
```python
|
| 213 |
+
from huggingface_hub import hf_hub_download
|
| 214 |
+
import pandas as pd
|
| 215 |
|
| 216 |
+
repo_id = "Blue2Giant/FreeStyle_Dataset"
|
| 217 |
+
source = "qwen"
|
| 218 |
|
| 219 |
+
triplets = pd.read_csv(hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/triplets.csv"))
|
| 220 |
+
content_meta = pd.read_csv(hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/content_images.csv"))
|
| 221 |
+
content_meta = content_meta.set_index("exported_image_path")
|
| 222 |
|
| 223 |
+
row = triplets.iloc[0]
|
| 224 |
+
print(content_meta.loc[row["content_image_path"]])
|
| 225 |
+
```
|
| 226 |
+
|
| 227 |
+
## Match and Prompt Status Values
|
| 228 |
+
|
| 229 |
+
`match_status` describes whether the exporter could map an exported vault image back to an original candidate image:
|
| 230 |
+
|
| 231 |
+
- `matched`: exact visual-key match found in the candidate pool
|
| 232 |
+
- `unmatched`: candidate pool existed, but no exact unique match was found
|
| 233 |
- `ambiguous`: more than one candidate matched the same visual key
|
| 234 |
- `no_candidates`: no candidate pool was available for that lookup
|
| 235 |
|
| 236 |
+
`prompt_status` describes whether generation prompt metadata was recovered:
|
| 237 |
|
| 238 |
+
- `resolved`: prompt metadata was recovered
|
| 239 |
- `unmatched_original`: original image path was not matched
|
| 240 |
+
- `missing_prompt_payload`: prompt sidecar JSON was missing
|
| 241 |
- `missing_prompt_entry`: prompt file existed, but the specific image entry was missing
|
| 242 |
- `missing_prompt_index`: image filename could not be mapped to a prompt index
|
| 243 |
|
| 244 |
+
## Important Notes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
+
- Exported images are vault training images, not guaranteed to be raw copies of the original one-LoRA or dual-LoRA generation files.
|
| 247 |
+
- `original_path` and prompt recovery fields are best-effort provenance fields. Do not assume every row has a resolved prompt.
|
| 248 |
+
- Rows with unresolved provenance are intentionally kept rather than forcing incorrect prompt assignments.
|
| 249 |
+
- The repository is organized as ordinary files. Use `huggingface_hub`, `pandas`, and `Pillow` for flexible access.
|
| 250 |
|
| 251 |
+
## Where to Start
|
| 252 |
|
| 253 |
+
1. Choose a source: start with `qwen` for a smaller first pass.
|
| 254 |
+
2. Read `cref_sref/<source>/README.md` and `summary.json`.
|
| 255 |
+
3. Load `cref_sref/<source>/triplets.csv`.
|
| 256 |
+
4. For each row, resolve image paths relative to `cref_sref/<source>/`.
|
| 257 |
+
5. Optionally join to the deduplicated `*_images.csv` metadata tables for provenance and reuse statistics.
|
| 258 |
|
|
|
cref_sref/README.md
CHANGED
|
@@ -1,25 +1,75 @@
|
|
| 1 |
-
# cref_sref
|
| 2 |
|
| 3 |
-
This
|
| 4 |
|
| 5 |
-
|
| 6 |
-
- `qwen/`
|
| 7 |
-
- `flux/`
|
| 8 |
-
- `illustrious/`
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
Notes:
|
| 20 |
- `triplets.csv` is sequence-level.
|
| 21 |
- `*_images.csv` files are deduplicated image-level metadata.
|
| 22 |
-
-
|
| 23 |
-
-
|
| 24 |
|
| 25 |
-
Start with the source-level `README.md` and `triplets.csv`.
|
|
|
|
| 1 |
+
# `cref_sref` Payload Guide
|
| 2 |
|
| 3 |
+
This folder contains the content-reference/style-reference LoRA triplet payload for the FreeStyle dataset.
|
| 4 |
|
| 5 |
+
Start from the root [`README.md`](../README.md) for full usage examples. This file summarizes the payload layout.
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
## Sources
|
| 8 |
+
|
| 9 |
+
| Source | Triplet rows | Unique content images | Unique style images | Unique target images |
|
| 10 |
+
|---|---:|---:|---:|---:|
|
| 11 |
+
| `qwen` | 33,582 | 90 | 424 | 5,162 |
|
| 12 |
+
| `flux` | 273,682 | 482 | 13,037 | 129,237 |
|
| 13 |
+
| `illustrious` | 172,589 | 8,045 | 1,581 | 65,952 |
|
| 14 |
+
|
| 15 |
+
## Layout
|
| 16 |
+
|
| 17 |
+
Each source directory has the same structure:
|
| 18 |
+
|
| 19 |
+
```text
|
| 20 |
+
<source>/
|
| 21 |
+
README.md
|
| 22 |
+
summary.json
|
| 23 |
+
triplets.csv
|
| 24 |
+
content_images.csv
|
| 25 |
+
style_images.csv
|
| 26 |
+
target_images.csv
|
| 27 |
+
images/
|
| 28 |
+
content/...
|
| 29 |
+
style/...
|
| 30 |
+
target/...
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
`_state/` and `logs/` are intentionally not included in the public upload.
|
| 34 |
+
|
| 35 |
+
## How to Use
|
| 36 |
+
|
| 37 |
+
For a source such as `qwen`:
|
| 38 |
+
|
| 39 |
+
1. Read `qwen/triplets.csv`; it is the sequence-level index.
|
| 40 |
+
2. For each row, use:
|
| 41 |
+
- `content_image_path`
|
| 42 |
+
- `style_image_path`
|
| 43 |
+
- `target_image_path`
|
| 44 |
+
3. Resolve those paths relative to `cref_sref/qwen/`.
|
| 45 |
+
4. Use `content_images.csv`, `style_images.csv`, and `target_images.csv` only when you need image-level metadata, reuse counts, original-path provenance, or prompt recovery details.
|
| 46 |
+
|
| 47 |
+
Minimal Python example:
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from huggingface_hub import hf_hub_download
|
| 51 |
+
from PIL import Image
|
| 52 |
+
import pandas as pd
|
| 53 |
+
|
| 54 |
+
repo_id = "Blue2Giant/FreeStyle_Dataset"
|
| 55 |
+
source = "qwen"
|
| 56 |
+
|
| 57 |
+
triplets = pd.read_csv(hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/triplets.csv"))
|
| 58 |
+
row = triplets.iloc[0]
|
| 59 |
+
|
| 60 |
+
content_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/{row['content_image_path']}")
|
| 61 |
+
style_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/{row['style_image_path']}")
|
| 62 |
+
target_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"cref_sref/{source}/{row['target_image_path']}")
|
| 63 |
+
|
| 64 |
+
content = Image.open(content_path).convert("RGB")
|
| 65 |
+
style = Image.open(style_path).convert("RGB")
|
| 66 |
+
target = Image.open(target_path).convert("RGB")
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## Notes
|
| 70 |
|
|
|
|
| 71 |
- `triplets.csv` is sequence-level.
|
| 72 |
- `*_images.csv` files are deduplicated image-level metadata.
|
| 73 |
+
- The same image can be reused by many triplets; check `sequence_count` in the image metadata tables.
|
| 74 |
+
- Prompt/provenance fields are best effort. Rows with unresolved provenance are intentionally preserved.
|
| 75 |
|
|
|