bghira's picture
Document released Webshart APIs and paired SimpleTuner loading
c18deab verified
|
Raw History Blame Contribute Delete
7.51 kB
---
license: cc-by-nc-sa-4.0
task_categories:
- image-to-image
language:
- en
size_categories:
- 10M<n<100M
tags:
- webshart
- parquet
- metadata-only
pretty_name: ScaleEdit-12M Webshart Metadata
configs:
- config_name: default
data_files:
- split: train
path: metadata/*/*.parquet
---
# ScaleEdit-12M: metadata-only Webshart companion
This repository contains **11,845,023 metadata records across 251 Parquet shards**
covering every row of [InternVL-U/ScaleEdit-12M](https://huggingface.co/datasets/InternVL-U/ScaleEdit-12M),
pinned to commit `05d2eea7b80ba72c077d39be43b7aca1a7857e6a`. It contains **no image payloads** and does
not duplicate the source's 6,188,768,447,762 bytes of compressed Parquet.
The metadata Parquet files total 423,499,152 bytes.
## Webshart usage
Use Webshart **0.8.0 or later**, which includes the native Parquet loader:
```bash
python -m pip install --upgrade "webshart[hub]>=0.8.0"
```
The companion supplies metadata for bucketing and captions; image bytes are read
from the pinned upstream Parquet files. This is not a tar byte-offset index.
The example uses the small `3.4_count_change` category: **458 complete image
pairs in one approximately 54 MB source shard**.
```python
import webshart
dataset = webshart.discover_dataset(
"InternVL-U/ScaleEdit-12M",
format="parquet",
metadata="webshart/ScaleEdit-12M-metadata",
subfolder="3.4_count_change",
)
loader = webshart.ParquetDataLoader(dataset, image_columns=["source_image"])
metadata = loader.get_metadata(0, 0)
sample = next(loader.iter_shard(0, stop=1))
edited_bytes = sample.data
source_bytes = sample.payloads["source_image"]
instruction = sample.captions
```
Prefer `loader.iter_shard(shard_index)` for sequential training. The source has
very large compressed row groups and dictionaries: native page streaming avoids
loading an entire 15+ GB image column, but initial dictionary decoding can still
cost hundreds of MiB. Random row access scans preceding rows within its row
group; this is not constant-cost tar-style seeking. Pass only the image columns
you need to limit memory and network use.
`webshart-parquet.json` maps source shards to metadata files, pins the upstream
revision, records row counts/file sizes, and verifies metadata SHA-256 checksums.
`metadata_mode="replace"` uses these complete companion rows without reading
upstream metadata columns. The manifest selects edited-image dimensions and
maps `edit_instruction` to `captions`; it does not invent richer JSON captions.
Custom companion files can store native struct/list captions or declare
`json_columns` for JSON-encoded mixed string/object caption lists.
## SimpleTuner paired editing preset
Use a SimpleTuner revision containing [PR #3325](https://github.com/bghira/SimpleTuner/pull/3325)
and Webshart 0.8.0 or later. Put the following array in
`multidatabackend.json` and configure an editing model such as
[Flux Kontext](https://github.com/bghira/SimpleTuner/blob/main/documentation/quickstart/FLUX_KONTEXT.md).
The training target is `edited_image`; its reference is `source_image`, and its
caption is the editing instruction. These captions are not standalone scene descriptions.
```json
[
{
"id": "scaleedit-edits",
"type": "webshart",
"source": "InternVL-U/ScaleEdit-12M",
"metadata": "webshart/ScaleEdit-12M-metadata",
"subfolder": "3.4_count_change",
"caption_strategy": "webshart",
"metadata_backend": "webshart",
"resolution": 512,
"resolution_type": "pixel",
"crop": false,
"dataset_type": "image",
"conditioning_data": [
"scaleedit-sources"
],
"cache_dir_vae": "cache/vae/scaleedit/edited_image",
"webshart": {
"format": "parquet",
"cache_dir": "cache/webshart/scaleedit/edited_image",
"shard_cache_gb": 0,
"parallel_downloads": 4,
"columns": {
"image": "edited_image",
"captions": "edit_instruction",
"width": "edited_image_width",
"height": "edited_image_height"
}
}
},
{
"id": "scaleedit-sources",
"type": "webshart",
"source": "InternVL-U/ScaleEdit-12M",
"metadata": "webshart/ScaleEdit-12M-metadata",
"subfolder": "3.4_count_change",
"caption_strategy": "webshart",
"metadata_backend": "webshart",
"resolution": 512,
"resolution_type": "pixel",
"crop": false,
"dataset_type": "conditioning",
"conditioning_type": "reference_strict",
"source_dataset_id": "scaleedit-edits",
"cache_dir_vae": "cache/vae/scaleedit/source_image",
"webshart": {
"format": "parquet",
"cache_dir": "cache/webshart/scaleedit/source_image",
"shard_cache_gb": 0,
"parallel_downloads": 4,
"columns": {
"image": "source_image",
"captions": "edit_instruction",
"width": "source_image_width",
"height": "source_image_height"
}
}
},
{
"id": "scaleedit-text",
"type": "local",
"dataset_type": "text_embeds",
"default": true,
"cache_dir": "cache/text/scaleedit"
}
]
```
Both backends select the same complete 458-pair category and use identical
part/row identities. Keep their caches separate and their selected sample sets
aligned. Independently limiting or filtering each backend can break pairing;
equal `max_num_samples` limits alone do not guarantee equal pairs.
`shard_cache_gb: 0` disables whole-shard downloads in favor of range reads.
Most full-dataset parts are about 31 GB, and dictionary decoding can still require
hundreds of MiB. Metadata-only bucketing does not imply cheap image access.
See [SimpleTuner's Webshart configuration](https://github.com/bghira/SimpleTuner/blob/main/documentation/DATALOADER.md#webshart-datasets)
for backend options. Before expanding beyond this subset, account for the
URL-only source images described below.
## Schema and identity
Every original non-image column is preserved: `id`, `edit_task`,
`edit_instruction`, source URL/SHA-256/fetch-date fields, source and edited
width/height, and all three quality scores. Added locators are `source_path`,
`source_row` (zero-based absolute row within the source file), and
`source_row_group`. **IDs repeat between task categories**; join by pinned
source path plus row position, not `id` alone.
Source images for 702,078 rows are referenced by URLs instead of embedded
bytes. Those URLs, hashes, and fetch dates are preserved, but **no external image
URL was fetched or rehosted**. Webshart returns `None` for absent source bytes;
applications must explicitly implement their own retrieval/verification policy.
As upstream explains, original linked-image rights remain with their owners.
## Provenance and validation
Generated with projected non-image reads rather than a full dataset download. Projection read 508,945,853 logical range bytes.
Each output was compared against its projected Arrow table and SHA-256 checked;
all source paths, row positions, dimensions, counts, and shard coverage were
validated. `summary.json` contains per-task counts and totals. Metadata uses Zstd
compression, 2,048-row groups, and page indexes. No source or edited image bytes
are included in this repository.
See the [upstream dataset card](https://huggingface.co/datasets/InternVL-U/ScaleEdit-12M)
for dataset construction, limitations, attribution, and citation. This metadata
derivative retains the upstream **CC-BY-NC-SA-4.0** license and is not an
endorsement by the original authors. Upstream usage restrictions still apply.