RD Flow 64 ONNX
ONNX export of RD Flow 64 by Retro Diffusion (Retro-Diffusion/rd-flow-64) for ONNX Runtime Web (WebGPU). RD Flow 64 is a 271M pixel-art text-to-image model that draws 64 x 64 sprites and scenes with a real palette.
Demo: linoyts/RD-Flow-64-WebGPU
Non-commercial. This is a Derivative under the RD Flow 64 Model License (LICENSE.md) and is distributed under
that same license. The images you make are yours; the model itself may not be used commercially. For commercial use,
generate with Retro Diffusion.
Files
| File | What | Precision | Size |
|---|---|---|---|
onnx/flow.onnx (+ _data) |
the drawing model: picture + palette-pointer heads | fp16 weights, fp32 compute | 0.54 GB |
onnx/text_encoder/layer_00..26_int8.onnx |
prompt reader layers (Qwen3-VL-4B text, layers 0-26) | int8 weights (MatMulNBits, block 32, symmetric), fp16 activations | 27 x 0.11 GB |
onnx/text_encoder/embed_tokens_int8.onnx |
token embeddings | int8 (GatherBlockQuantized, block 128) | 0.40 GB |
onnx/text_encoder/final_norm.onnx |
final norm + RD Flow's weightless RMS normalisation | fp16 in, fp32 out | small |
onnx/config.json |
file map read by the demo's loader | ||
text_encoder/ |
Qwen's tokenizer and config, with its LICENSE and NOTICE |
Pipeline
- The caption is tokenized raw (no chat template, no special tokens, at most 512 tokens), run through the embedding, the 27 reader layers (causal attention, rope theta 5e6) and the final norm. The features are rounded to bf16, as the original pipeline does.
- The drawing model samples with 16 Euler steps (shift 3), classifier-free guidance 4 over t in [0, 0.9], and self-conditioning. From t = 0.6 a palette is extracted from the prediction; from t = 0.35 the pointer head picks palette slots per pixel, and pixels commit once confident. The result is decoded to RGBA through the palette.
The sampler, palette extraction and torch-compatible random noise are ported to JavaScript in the demo's rdflow.js.
Accuracy
Checked against the official PyTorch pipeline on CPU:
- Drawing model export vs PyTorch fp32: relative difference about 1e-5 (fp16 weight storage is exact for these weights).
- JS sampler given the reference prompt features: 99.4 to 100% of pixels pick the same palette slot.
- Prompt reader: the int8 weights give features within 1.2 to 1.5% relative error of fp32 (bf16, which the official pipeline uses, is about 1.4%). Small feature changes still move individual pixels, so the pictures are not pixel-identical to the official ones for the same seed.
Changes from the original
- Converted the RD Flow 64 weights to ONNX (opset 17). The forward pass was rewritten for export (precomputed rope tables, identity rope for non-grid tokens, palette slots masked through an input); the math is unchanged. Weights are stored in fp16.
- Quantized the prompt reader's linear layers and embeddings to int8 and split it into one graph per layer.
- No fine-tuning or other weight changes.
License and credit
RD Flow 64 by Retro Diffusion, https://retrodiffusion.ai. Copyright (c) 2026 Astropulse, LLC (Retro Diffusion).
Licensed under the RD Flow 64 Model License (LICENSE.md): non-commercial use only, no training on outputs.
The prompt reader is part of Qwen3-VL-4B-Instruct by the Qwen
team, licensed under Apache 2.0 (text_encoder/LICENSE, text_encoder/NOTICE). Changes: only the token embeddings,
layers 0-26 and the final norm are kept; they were converted to ONNX and quantized to int8.
Model tree for linoyts/RD-Flow-64-ONNX
Base model
Retro-Diffusion/rd-flow-64