Datasets:
|
Download README.md from leffff/diffusion-distillation-workshop: direct link, hf CLI and curl.
- Browser
- Download file 3.19 kB
-
https://huggingface.co/datasets/leffff/diffusion-distillation-workshop/resolve/main/README.md
- Command line
-
hf download hf://datasets/leffff/diffusion-distillation-workshop/README.md
-
curl -L -o README.md https://huggingface.co/datasets/leffff/diffusion-distillation-workshop/resolve/main/README.md
3.19 kB
| license: apache-2.0 | |
| task_categories: | |
| - text-to-image | |
| language: | |
| - en | |
| tags: | |
| - diffusion | |
| - distillation | |
| - synthetic | |
| - sana | |
| pretty_name: Diffusion Distillation Workshop (Sana-600M teacher samples) | |
| size_categories: | |
| - 1K<n<10K | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: train | |
| path: data/train-*.parquet | |
| - split: eval | |
| path: data/eval-*.parquet | |
| # Diffusion Distillation Workshop dataset | |
| 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). | |
| 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. | |
| | split | rows | prompts from | | |
| |---|---|---| | |
| | `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) | | |
| | `eval` | 64 | [PartiPrompts](https://huggingface.co/datasets/nateraw/parti-prompts), balanced over its 12 categories | | |
| ## Columns | |
| | column | content | | |
| |---|---| | |
| | `prompt` | the text actually fed to the teacher | | |
| | `source_prompt`, `category`, `subcategory`, `source` | provenance (for PartiPrompts, `subcategory` is the *Challenge*) | | |
| | `seed` | `torch.Generator("cuda").manual_seed(seed)` for the initial noise | | |
| | `image` | decoded 512×512 PNG | | |
| | `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)` | | |
| | `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` | | |
| | `prompt_attention_mask` | `uint8` bytes, shape `(128,)` | | |
| `null_prompt_embeds.safetensors` holds the unconditional (empty negative prompt) embedding and mask for classifier-free guidance. `meta.json` holds all generation parameters. | |
| ## Generation | |
| `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. | |
| ## Loading | |
| ```python | |
| import numpy as np, torch, pyarrow.parquet as pq | |
| from huggingface_hub import hf_hub_download | |
| path = hf_hub_download("leffff/diffusion-distillation-workshop", "data/train-00000-of-00008.parquet", repo_type="dataset") | |
| t = pq.read_table(path, columns=["prompt", "latent", "prompt_embeds", "prompt_attention_mask"]).to_pydict() | |
| latents = torch.from_numpy(np.stack([np.frombuffer(b, np.float16).reshape(32, 16, 16) for b in t["latent"]])) | |
| embeds = torch.from_numpy(np.stack([np.frombuffer(b, np.float16).reshape(128, 2304) for b in t["prompt_embeds"]])) | |
| masks = torch.from_numpy(np.stack([np.frombuffer(b, np.uint8) for b in t["prompt_attention_mask"]])).long() | |
| ``` | |
| ## License | |
| 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. | |