Datasets:
id stringlengths 21 21 | kind stringclasses 1
value | resolution int32 128 128 | prompt stringlengths 35 600 | prompt_id stringlengths 12 12 | seed int64 42 11k | steps int32 4 4 | seq_len int32 64 64 | bucket int32 128 256 | sigma listlengths 4 4 | sigma_next listlengths 4 4 | timestep listlengths 4 4 | xt unknown | xt_shape listlengths 3 3 | v unknown | v_shape listlengths 3 3 | ref_latents unknown | ref_shape listlengths | ref_of stringclasses 0
values | tensor_dtype stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
t2i_1e9dbf288d84_r128 | t2i | 128 | The image shows a modern apartment building with a white facade and multiple balconies. The building has three floors, with large windows and glass railings on the balconies. On the ground floor, there is a shaded outdoor seating area with yellow umbrellas. The building is situated on a street corner, with trees and gr... | 1e9dbf288d84 | 42 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | [
71,
62,
141,
63,
74,
62,
198,
62,
248,
191,
20,
192,
166,
191,
178,
63,
138,
63,
16,
190,
163,
63,
62,
191,
91,
63,
60,
190,
37,
191,
135,
190,
83,
63,
104,
62,
33,
64,
249,
62,
140,
191,
226,
189,
145,
62,
58,
190,
159,... | [
4,
64,
128
] | [
24,
62,
129,
63,
234,
62,
221,
62,
25,
192,
55,
192,
253,
191,
132,
62,
100,
191,
23,
192,
145,
191,
96,
192,
208,
190,
190,
191,
10,
192,
223,
191,
201,
63,
139,
63,
73,
64,
179,
63,
36,
61,
109,
63,
224,
63,
145,
63,
1... | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_445ee1bfe5fd_r128 | t2i | 128 | "The image shows a hand using a calligraphy pen to add intricate details to a watercolor painting. T(...TRUNCATED) | 445ee1bfe5fd | 43 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "AECbvpk+9z7hvg4/YD+bPpW+s77zv+U94b8BvkQ+FT//vv8+Qj/6Pjq6yj8RQMy/XLz3vl+9kr8iQE6/oT5ev2u/sL1jPyM/Lz6(...TRUNCATED) | [
4,
64,
128
] | "5D/0vpI+/j2ivmc+rT/rPn++x78ZwOa/h8A5wMa/VL8EwBrA878ZwCW/ED8pP1XAbj9HPro+mr/bPwXAfr8NwEI/rj9CQKY/dT7(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_4b864ddabd82_r128 | t2i | 128 | "The image depicts two people enjoying the ocean at sunset. One person is actively swimming or paddl(...TRUNCATED) | 4b864ddabd82 | 44 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "+T5IPnu/Pb/JPpG+Q7+ZvlI9Uj+SPdI/tr+mPH+/Jr+TPde8yL/qPgI/tL3pv64/qb7FPpU/RL+jO8W/iD+KP0M/bz0MPi+/lT9(...TRUNCATED) | [
4,
64,
128
] | "aT8wP829WT6sPuq+k791vye/Fr9Uv128McCXv+K/n79WviW++b+QPTE/Jjyov+g/eL+nvjU/l78KvwjAuD5oPlRAI0AvQANAVT8(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_6f71cced6a6a_r128 | t2i | 128 | "The image depicts a person dressed as a clown. The clown is wearing a red outfit with a green and w(...TRUNCATED) | 6f71cced6a6a | 45 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "7r1rP9k/nL4yvnE+OL9tP7k/jL+HP7++Hz8pPqW+mL+RP2K9ur/Qv96/R7+GP7y/ST8IP1k/0z9Bv3Y/Vr/Ov7I/Eb+tPgU/HD/(...TRUNCATED) | [
4,
64,
128
] | "/r4fPqk/2b6HvYg+Zr8QP78+FMDFvhLAWz+0Pr0+t76XueK/UMB5wAjAd79zPAzAjL+lv4C/fr45vxg/m7/ivydAST/dP/0/uz6(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_92eb187f8255_r128 | t2i | 128 | "A white heart-shaped cloud floats in a clear blue sky, its fluffy edges defined against the vibrant(...TRUNCATED) | 92eb187f8255 | 46 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "oT+Iv8O/Er6TvZW/Ab+xP209yT8SP8g/Vb+Vv1W/hD/Ovaw+Nz0EPh+/Dj96v8293D0FPuE/EEDXPsg9+L78viM/k78mPxg/rb/(...TRUNCATED) | [
4,
64,
128
] | "ez88vzy/Gr/PP4i/wjzDP9S+yT8Bv6w+LcAKwF2/mT8XwNC/1r8DwCFAZEDNv8c+LD4FP7E/JkCRvhm/oL+mvR8/KcCVv+q/Y8C(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_044d4550f767_r128 | t2i | 128 | "A curved dagger with a handle shaped like a fish is presented against a plain white background. The(...TRUNCATED) | 044d4550f767 | 47 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "hr9CvqW/lT0VwGc/iD8TQNm/YT+IPbq/kD8IP+C+fD2sPEq/778hv7I/hL8OvcY/XL/OPgY+WD6MPSM/mj/Kvzw/rb8WvgC/J8A(...TRUNCATED) | [
4,
64,
128
] | "vL+JvxXAD8DBvys+LEBEQKe/EUBHP7M/1T4UP4C/5D6+vhC/47+xPqk/k79wPxxAjr8QP/K+CD//vFc/9z6svyRAF7/EP4S/HsC(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_7d4bc7fdaf19_r128 | t2i | 128 | "The image features a white pickup truck parked on a concrete driveway. The truck is equipped with l(...TRUNCATED) | 7d4bc7fdaf19 | 48 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "rr+fv3Q+lD8wvxM/2b7pPS+9Iz/avpe+tz/TvQXAHz/IPUK8cb3+vh2/KL1wP28+aT4aP+o8Fz7MvYK/jD/KvuS+cz+kvoQ+zj+(...TRUNCATED) | [
4,
64,
128
] | "ub7Evm8/DkDZv6a/xL/Fv52/Or+Xv+y/xr7hv4TAGsCcvAc/j76lvY6/o78SPzq/4j6wP8m8Sz9IPxg+0T9eP94/M0DWP70/3D+(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_44172981376b_r128 | t2i | 128 | "The image features a festive winter scene with several Christmas trees silhouetted against a bright(...TRUNCATED) | 44172981376b | 49 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "pz6bP8w+Q78sP0Y/+j9fPwhAnT+XPqi+sT7ZPiI/br+Nvzk/sL6kvk4+5D7Zvic/4r49vpw/B0AXP50/Tj+SPxo/Fj4CP8o+l7+(...TRUNCATED) | [
4,
64,
128
] | "yj/gP6s/HD3FPlA/9T9EP0ZAOkDVP7M/8D8UQLk/gz+jvxC/hb+gv/C+wD/+vpY/AkAhQGJApECWP6s/bD/gP3Q+JD+LPnQ/sr8(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_7a1c99e93942_r128 | t2i | 128 | "The image portrays a statue of a man, captured in a three-quarter view. The man is depicted in a ro(...TRUNCATED) | 7a1c99e93942 | 50 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "tL+ePwzAv7/OPoo+Lb6uPzk/Xj4fv2m+9T6cvpO/Jj8lPwY/Qr0pP42/xL8nv3e+/b5Hv8K/Mb9zP4k+iL+kP8I+EsC8P/C/Wj8(...TRUNCATED) | [
4,
64,
128
] | "g7/LPwHAvL8+Pge+ub53P3y8Db+ev3W/2L8NwEPApL8EPys/Cz6DP/S+nr+pvQ4+hr96vwnAXb/GP4A/374BQClA375jQKu+ij8(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
t2i_7125d7aed766_r128 | t2i | 128 | "The image is an advertisement for a range of water heaters by Ariston, part of the Thermogroup, in (...TRUNCATED) | 7125d7aed766 | 52 | 4 | 64 | 128 | [
1,
0.9546917080879211,
0.8753688931465149,
0.7007085680961609
] | [
0.9546917080879211,
0.8753688931465149,
0.7007085680961609,
0
] | [
1000,
954.6917114257812,
875.368896484375,
700.7085571289062
] | "9b4Dvr++ir/ePvG+VL/RPwXAtb4eP86/zD7OP2E+YD9RwG6/EL9rvqU/jL9Rv6W+qL+Iv4o/vL9hv4e/rD+kvrY/Uz/bvFQ/172(...TRUNCATED) | [
4,
64,
128
] | "wj6IPv48Lb+yPq2/6D63P1fAFL9QP+K/F76OP5Q/HUBbwIK/gL9Cv90/jzynvyO+p7+HvxI/g7+Ov6++Kz8pP8q/xL8BwHI/Cj0(...TRUNCATED) | [
4,
64,
128
] | null | null | null | bfloat16 |
FLUX-Klein-Tiny Teacher Trajectories (Stage 1)
59,000 recorded 4-step denoising trajectories from
black-forest-labs/FLUX.2-klein-9b-kv,
dumped in bf16, eager (uncompiled, unquantized) on an H100, for velocity
distillation of smaller students.
Each record stores, for every one of the teacher's 4 sampling steps, the exact triple
the student is regressed against: the input latent x_t, the sigma/timestep at that
step, and the teacher's predicted velocity v. A student trained on these learns the
teacher's vector field rather than its own drift — no teacher forward pass is needed
at training time, so distillation runs on a single small GPU.
Companion model repo: radames/flux-klein-tiny.
Why trajectories and not images
Image-level distillation makes the student re-discover the sampler. Here the sampler is
given: the schedule is stored per record, and the loss is a plain regression of the
student's velocity onto the teacher's at the teacher's own visited points. Because
x_t is recorded and not re-derived, the student never trains on states the teacher
did not actually pass through, and exposure bias between teacher and student
trajectories is removed by construction.
Splits
One config (default), five splits keyed by kind × resolution. Splitting this way
rather than using one filterable split is deliberate: sequence length is a function of
resolution (256² → 256 latent tokens, 512² → 1024), so each split has a fixed row
size. That keeps parquet row groups uniform, lets you stream only the resolution you
are training on, and avoids paging 2 MB 512² rows while training at 128². kind and
resolution are also present as columns if you prefer to concatenate and filter.
| split | rows | resolution | latent tokens (seq_len) |
ref tokens | files | size |
|---|---|---|---|---|---|---|
t2i_128 |
11,000 | 128² | 64 | – | 1 | 1.12 GB |
t2i_256 |
17,500 | 256² | 256 | – | 5 | 7.15 GB |
t2i_512 |
25,500 | 512² | 1024 | – | 29 | 41.62 GB |
edit_256 |
2,500 | 256² | 256 | 256 | 1 | 1.15 GB |
edit_512 |
2,500 | 512² | 1024 | 1024 | 4 | 4.59 GB |
| total | 59,000 | 40 | 55.6 GB |
55.6 GB on the hub (zstd); 71.5 GB of raw bf16 payload once decoded.
Schema
| column | type | notes |
|---|---|---|
id |
string |
unique, e.g. t2i_986983b0e505_r256 |
kind |
string |
t2i or edit |
resolution |
int32 |
128 / 256 / 512 (square, native — never downscaled) |
prompt |
string |
the text the teacher was conditioned on |
prompt_id |
string |
12-hex hash of the prompt; stable across resolutions |
seed |
int64 |
the generator seed used for x_0 |
steps |
int32 |
always 4 |
seq_len |
int32 |
latent tokens per step (64 / 256 / 1024) |
bucket |
int32 |
text-token bucket the prompt was padded into (128 or 256) |
sigma |
list<float32> |
length 4, σ at each step |
sigma_next |
list<float32> |
length 4, σ after each step |
timestep |
list<float32> |
length 4, the scheduler timestep passed to the transformer |
xt |
binary |
raw bf16 bytes, shape xt_shape = [4, seq_len, 128] |
xt_shape |
list<int32> |
[4, seq_len, 128] |
v |
binary |
raw bf16 bytes, shape v_shape = [4, seq_len, 128] |
v_shape |
list<int32> |
[4, seq_len, 128] |
ref_latents |
binary |
edit splits only, else null; packed reference latents |
ref_shape |
list<int32> |
[ref_seq_len, 128], else null |
ref_of |
string |
edit splits only: id of the t2i trajectory the reference came from |
tensor_dtype |
string |
always "bfloat16" |
Why bytes
Arrow has no bfloat16 type. Upcasting to fp32 would double the dataset to ~143 GB and would break the bit-exactness guarantee below (bf16 → fp32 → bf16 is lossless, but the stored artifact would no longer be the teacher's output). So the tensors are stored as raw little-endian bf16 bytes plus an explicit shape column, which round-trips byte-for-byte. All shards were written on x86-64 (little-endian).
Loading and decoding
import torch
from datasets import load_dataset
ds = load_dataset("radames/flux-klein-tiny-trajectories", split="t2i_512", streaming=True)
row = next(iter(ds))
def decode(buf, shape):
# bytearray() makes the buffer writable, which silences torch's non-writable warning
return torch.frombuffer(bytearray(buf), dtype=torch.bfloat16).reshape(tuple(shape))
xt = decode(row["xt"], row["xt_shape"]) # [4, 1024, 128] bfloat16
v = decode(row["v"], row["v_shape"]) # [4, 1024, 128] bfloat16
sigma = torch.tensor(row["sigma"]) # [4] float32
sigma_next = torch.tensor(row["sigma_next"]) # [4] float32
timestep = torch.tensor(row["timestep"]) # [4] float32
# edit splits only
ref = decode(row["ref_latents"], row["ref_shape"]) if row["ref_latents"] else None
NumPy, if you would rather not pull in torch (ml_dtypes provides the bf16 view):
import numpy as np, ml_dtypes
xt = np.frombuffer(row["xt"], dtype=ml_dtypes.bfloat16).reshape(row["xt_shape"])
Distillation loss
The trajectory is a plain Euler integration, so the student sees x_t and must predict
v:
for step in range(4):
v_hat = student(xt[step], timestep=timestep[step], encoder_hidden_states=emb)
loss = torch.nn.functional.mse_loss(v_hat.float(), v[step].float())
The teacher's own update, for reference, is x_{t+1} = x_t + (sigma_next - sigma) * v.
Verification
Two gates were run over the full dump before it was packaged, and a third after.
- Euler self-consistency (all 59,000 records). Stored
x_t,v,sigmaandsigma_nextmust reproduce the next storedx_texactly:59000/59000 within 2 bf16 ULP of the latent scale, worst 0.00781(bf16 eps = 0.00391). The trajectory is internally consistent — the stored velocity really is the one that produced the stored next state. - Bit-exact teacher replay (8 sampled trajectories). The teacher was re-loaded and
re-run on stored inputs:
8/8 bit-exact,fresh_rel_l2 = replay_rel_l2 = rerun_rel_l2 = 0.0,replay_cos = 1.0,seed_x0_identical = true. This is only meaningful because the dump was eager and unquantized; a compiled or FP8 teacher is not bit-reproducible across processes. - Packaging round-trip (this repo). 255 trajectories stratified across all five
splits were decoded back out of the parquet and compared with the source
safetensors: 0 failures, both as
torch.equalon the decoded tensors and as raw byte equality. All 59,000 ids and every metadata field matched the source index.
Rebuilding the on-disk training format
The training code in radames/flux-klein-tiny
reads sharded safetensors + a JSONL index (distill/shards.py), not parquet. To go back
to that layout, write each row's xt/v/ref_latents bytes straight into a
safetensors data section — no decode, no re-encode, so the shards come back
byte-identical:
# per shard: entries = [(f"{id}.xt", "BF16", xt_shape, xt_bytes), ...]
header = {}; off = 0
for name, dtype, shape, raw in entries:
header[name] = {"dtype": dtype, "shape": list(shape), "data_offsets": [off, off + len(raw)]}
off += len(raw)
blob = json.dumps(header, separators=(",", ":")).encode()
blob += b" " * ((-len(blob)) % 8) # safetensors pads the header to 8 bytes
with open(path, "wb") as f:
f.write(struct.pack("<Q", len(blob))); f.write(blob)
for *_, raw in entries: f.write(raw)
The index record per trajectory needs id, kind, res, seq_len, steps,
prompt_id, ref_seq_len and shard — everything else in the index is provenance.
This path has been exercised. On 2026-08-15 the machine holding the original dump
was evicted and its disk was lost. The dataset was rebuilt from this repo into the
training layout and re-gated with the project's own Euler self-consistency check, which
reported 59000/59000 within 2 bf16 ULP of the latent scale, worst 0.00781 — the same
figures the original teacher dump produced. Full-coverage verification (all 300,000
tensors) and stratified bit-comparison both passed. This repo is a sufficient backup of
the trajectories: only student_embeds (regenerable, see below) and the teacher's PNG
renders do not survive in it.
Provenance
- Teacher:
black-forest-labs/FLUX.2-klein-9b-kv(Apache-2.0), bf16, eager, not quantized, not compiled. Capture point isscheduler.step(model_output, timestep, sample), which receives(v, t, x_t)already sliced to the latent tokens, identically for t2i and edit paths. - Prompts: 54,026 unique. The bulk are captions from
jasperai/monet(Apache-2.0), text only — filtered tonsfw < 0.2,watermark < 0.2, 30–600 chars, exact dedup, whitespace-normalized. Complemented by 4,000 synthetic constraint-bearing prompts (hex colours, quoted text, macro/low-light/flat-graphic content types) generated by a seeded combinatorial synthesizer in the project repo. Median t2i prompt length is 447 characters. - No images from any external dataset are used or redistributed. MONET is read
caption-column-only. The 5,000 reference images behind the edit splits were
generated by the teacher itself from those prompts, and only their packed latents
(
ref_latents) ship here — the PNGs do not. - Edit instructions: 26 distinct instructions (e.g. "Make it night time with warm street lighting, keep the composition unchanged") applied across the 5,000 teacher- generated references, 2,500 at 256² and 2,500 at 512².
- Cost: 59,000 trajectories in 12,125 s wall on one H100; median 0.20 s each.
What is deliberately not here
Student text embeddings are excluded. The dump also produced 7680-wide embeddings
from the 4B student's text encoder (54,026 of them, 2.06 MB each, **109 GB**). They
are a pure function of the prompt text that is already in this dataset, so shipping
them would nearly triple the download for nothing. Regenerate them with:
python -m distill.dump_trajectories --out /path/to/data --student-embeds
(from radames/flux-klein-tiny; loads only the 4B text encoder, no teacher, and dedups by prompt hash across resolutions and t2i/edit reuse). Teacher embeddings are not included either and are not useful to a student: they are 12288-wide against the student's 7680.
Also not included: the teacher's PNG renders (1.2 GB), which are an artifact of the reference pass rather than training data.
Limitations
- Square resolutions only (128², 256², 512²). The sigma schedule is a function of
image_seq_len, so a 512² trajectory says nothing about the 256² schedule — do not mix schedules across resolutions. - Exactly 4 steps per trajectory. This is a distillation set for few-step students, not a general flow-matching corpus.
- Single seed family;
x_0is deterministic givenseed, so the dataset does not cover per-prompt noise diversity. - Prompts are English and inherit MONET's (cc12m-derived) content distribution and its captioner biases.
License
Apache-2.0, matching the teacher and the MONET caption text this was prompted with.
Citation
@misc{flux_klein_tiny_trajectories_2026,
title = {FLUX-Klein-Tiny Teacher Trajectories},
author = {Radamés Ajna},
year = {2026},
url = {https://huggingface.co/datasets/radames/flux-klein-tiny-trajectories}
}
- Downloads last month
- 22