ryanhlewis/flux2-klein-latent-trajectories
FLUX.2 Klein Latent Trajectories This dataset contains synthetic text-to-image generations produced with a local FLUX.2 Klein 4B snapshot, together with the prompts, generated WebP images, and captured intermediate diffusion latent states. Contents 262,144 generated examples. 512 Torch shard files under shards/, with 512 samples per shard. One JSON sidecar per shard with generation metadata. Image resolution: 512 x 512. Image format: WebP, quality 90. Diffusion… See the full description on the dataset page: https://huggingface.co/datasets/ryanhlewis/flux2-klein-latent-trajectories.
FLUX.2 Klein Latent Trajectories
This dataset contains synthetic text-to-image generations produced with a local FLUX.2 Klein 4B snapshot, together with the prompts, generated WebP images, and captured intermediate diffusion latent states.
Contents
- 262,144 generated examples.
- 512 Torch shard files under
shards/, with 512 samples per shard. - One JSON sidecar per shard with generation metadata.
- Image resolution: 512 x 512.
- Image format: WebP, quality 90.
- Diffusion inference steps: 4.
- Guidance scale: 1.0.
- Prompt max sequence length: 512.
- FLUX projected latent token vocabulary: 4096, from 12-bit random projections.
- Projection seed: 12345.
- Global generation seed: 20260613.
Record Schema
Each shard_XXXXX.pt is a torch.save payload with:
{
"meta": dict,
"projection": torch.Tensor, # projection used for 12-bit latent codes
"samples": list[dict],
}Each sample contains:
id: stable sample id, for examplesample_00098304.global_idx: integer index in the full corpus.seed: generation seed for this sample.prompt: generated English prompt.prompt_ids: FLUX text tokenizer ids,int32, shape[512].latent_tokens: projected latent codes,uint16, shape[4, 1024].packed_latents_fp16: captured FLUX latent tensors,float16, shape[4, 1024, 128].timesteps: diffusion timesteps captured at the 4 callback points.image_format:webp.image_bytes: encoded generated image bytes.
The latent_tokens field is a compact 12-bit random-projection code over the captured FLUX latents. It is not a learned tokenizer. The packed_latents_fp16 field is the higher-fidelity latent trajectory data.
Prompt Generation
Prompts were generated deterministically from a small combinatorial template of common public image-prompt archetypes. The templates combine subject, style, lighting, composition, color palette, and quality constraints. No scraped image captions or private user prompts are included.
Example prompt:
a lighthouse on a black sand coast; clean product photography, white sweep background, softbox reflections; overcast diffused daylight; low angle perspective with clear scale cues; palette: red, white, and charcoal with restrained saturation; high detail, coherent geometry, no watermark.Loading Example
from io import BytesIO
from PIL import Image
import torch
payload = torch.load("shards/shard_00000.pt", map_location="cpu")
sample = payload["samples"][0]
prompt = sample["prompt"]
image = Image.open(BytesIO(bytes(sample["image_bytes"]))).convert("RGB")
latent_tokens = sample["latent_tokens"] # uint16, [4, 1024]
packed_latents = sample["packed_latents_fp16"] # float16, [4, 1024, 128]These shards are PyTorch pickle files. Only load them in an environment where you trust the dataset files.
Intended Uses
- Training or evaluating sequence models over diffusion latent trajectories.
- Comparing compact projected latent codes with learned image tokenizers.
- Studying prompt-conditioned latent dynamics for synthetic text-to-image outputs.
- Building derived tokenized datasets such as latent-model/VQ/RVQ image-token corpora.
Limitations
- The dataset is fully synthetic and inherits artifacts and biases from the generator and prompt template.
- Prompt diversity is controlled and template-based, not web-scale natural caption diversity.
- The captured latent tensors are specific to this FLUX.2 Klein implementation and checkpoint snapshot.
- The compact
latent_tokensare random-projection codes, not semantic discrete latents. - Generated images are WebP-compressed.
Provenance and Terms
Produced with a distributed GPU pipeline using a local FLUX.2 Klein 4B model snapshot:
black-forest-labs/FLUX.2-klein-4B, snapshot e7b7dc27f91deacad38e78976d1f2b499d76a294.
The dataset license is marked other because use may be subject to the upstream model, code, and infrastructure terms. Check the applicable FLUX.2 Klein model terms before redistribution or commercial use.
