leffff commited on
Commit
2f356cf
·
verified ·
1 Parent(s): 6655fbc

Add dataset card

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - text-to-image
5
+ language:
6
+ - en
7
+ tags:
8
+ - diffusion
9
+ - distillation
10
+ - synthetic
11
+ - sana
12
+ pretty_name: Diffusion Distillation Workshop (Sana-600M teacher samples)
13
+ size_categories:
14
+ - 1K<n<10K
15
+ configs:
16
+ - config_name: default
17
+ data_files:
18
+ - split: train
19
+ path: data/train-*.parquet
20
+ - split: eval
21
+ path: data/eval-*.parquet
22
+ ---
23
+
24
+ # Diffusion Distillation Workshop dataset
25
+
26
+ Teacher samples for a hands-on workshop on **diffusion step distillation** (Consistency Distillation, LADD, DMD, PDD). The teacher is [Sana-600M-512px](https://huggingface.co/Efficient-Large-Model/Sana_600M_512px_diffusers).
27
+
28
+ Every row contains the **text prompt**, the teacher's **prompt embeddings**, the **generated latent**, and the **decoded 512×512 image**. With it, a Colab student can skip the 2.6B-parameter Gemma-2 text encoder and the teacher sampling and go straight to distillation.
29
+
30
+ | split | rows | prompts from |
31
+ |---|---|---|
32
+ | `train` | 4096 | [open-image-preferences-v1](https://huggingface.co/datasets/data-is-better-together/open-image-preferences-v1) `simplified_prompt`, balanced over its 12 style categories (≈341 each) |
33
+ | `eval` | 64 | [PartiPrompts](https://huggingface.co/datasets/nateraw/parti-prompts), balanced over its 12 categories |
34
+
35
+ ## Columns
36
+
37
+ | column | content |
38
+ |---|---|
39
+ | `prompt` | the text actually fed to the teacher |
40
+ | `source_prompt`, `category`, `subcategory`, `source` | provenance (for PartiPrompts, `subcategory` is the *Challenge*) |
41
+ | `seed` | `torch.Generator("cuda").manual_seed(seed)` for the initial noise |
42
+ | `image` | decoded 512×512 PNG |
43
+ | `latent` | `float16` bytes, shape `(32, 16, 16)`. DC-AE latent in **model space**: the x₀ the transformer sees. Decode with `vae.decode(latent / 0.41407)` |
44
+ | `prompt_embeds` | `float16` bytes, shape `(128, 2304)`. Gemma-2 hidden states from Sana's `encode_prompt` with the complex human instruction, `max_sequence_length=128` |
45
+ | `prompt_attention_mask` | `uint8` bytes, shape `(128,)` |
46
+
47
+ `null_prompt_embeds.safetensors` holds the unconditional (empty negative prompt) embedding and mask for classifier-free guidance. `meta.json` holds all generation parameters.
48
+
49
+ ## Generation
50
+
51
+ `SanaPipeline` default sampler (flow DPM-Solver), 20 steps, CFG 4.5, 512×512, transformer in fp16, Gemma-2 in bf16, DC-AE in fp32. Generated on a single H100.
52
+
53
+ ## Loading
54
+
55
+ ```python
56
+ import numpy as np, torch, pyarrow.parquet as pq
57
+ from huggingface_hub import hf_hub_download
58
+
59
+ path = hf_hub_download("leffff/diffusion-distillation-workshop", "data/train-00000-of-00008.parquet", repo_type="dataset")
60
+ t = pq.read_table(path, columns=["prompt", "latent", "prompt_embeds", "prompt_attention_mask"]).to_pydict()
61
+ latents = torch.from_numpy(np.stack([np.frombuffer(b, np.float16).reshape(32, 16, 16) for b in t["latent"]]))
62
+ embeds = torch.from_numpy(np.stack([np.frombuffer(b, np.float16).reshape(128, 2304) for b in t["prompt_embeds"]]))
63
+ masks = torch.from_numpy(np.stack([np.frombuffer(b, np.uint8) for b in t["prompt_attention_mask"]])).long()
64
+ ```
65
+
66
+ ## License
67
+
68
+ Apache-2.0. The prompts come from apache-2.0 datasets, and the images and latents were generated by the apache-2.0 Sana-600M model.