leffff's picture
Add dataset card
2f356cf verified
|
Raw History Blame Contribute Delete
3.19 kB
metadata
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.

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 simplified_prompt, balanced over its 12 style categories (≈341 each)
eval 64 PartiPrompts, 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

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.