Skip to main content

WINK
or: diffusion without the latent training wheels

🇬🇧 English | 🇩🇪 Deutsch | 🇨🇿 Čeština | 🇨🇳 中文 | 🇷🇺 Русский

Home repo — https://git.pvlb.dev/ml-lab/wink
GitHub mirror: https://github.com/pvlb-dev/wink



Welcome to WINK, a tiny lab for complex-valued image generation!

v0.1.1 is a promptable MNIST diffusion model that runs on a laptop CPU, paints white ink on a transparent background, and generates entirely in the browser. Pick a digit, set guidance, get a digit. 261k parameters, 4 layers, RAT-32 — no VAE, no latent decoder, no server.

image geneRATion — the RAT from TARDITS, retargeted from tokens to pixels.

WINK hero: complex-valued pixel diffusion, a neon camera-eye and a hamster mascot.

The RAT block and hypercomplex layers come from TARDITS (tardits>=0.3.0). It is the same RAT family, not the same model: WINK adds 2D patch tokens, a diffusion-step rotor, class conditioning and a pixel head. The 261k promptable checkpoint here is a WINK model, not the 100M TARDITS base.


🚀 Quickstart & Usage

Just want to play?

The 10k promptable weights are already in the repo. No Python training needed:

python -m http.server 5001 -d web
# open http://127.0.0.1:5001

Digit buttons + guidance slider, transparent RGBA output, Web Worker inference. See web/README.md.

Install

From PyPI — the import is still wink:

pip install wink-diffusion
# or
uv add wink-diffusion

From source for development:

git clone https://git.pvlb.dev/ml-lab/wink.git
cd wink
uv sync --locked --extra mlflow --extra eval
.venv/bin/pytest -q

Train the 0.1 model (CPU)

The 10k model behind the browser weights takes ~46 min on t14:

.venv/bin/wtrain -c examples/configs/mnist_rat_cond_cfg_h32_10k.yaml

For a simple unconditional first run, examples/configs/mnist_rat.yaml trains RAT-16 in ~19 min. The MNIST cache is included in examples/data/.

Generate prompted digits

.venv/bin/wsample \
  -c examples/configs/mnist_rat_cond_cfg_h32_10k.yaml \
  --checkpoint examples/saved/mnist_rat_cond_cfg_h32_10k/final.pt \
  -n 80 --classes 0,1,2,3,4,5,6,7,8,9 \
  --guidance 5 --alpha --nrow 8 -o prompted.png

Writes a transparent RGBA sheet and a checkerboard preview.

Unconditional alpha digits

MNIST is white ink on black, so the grayscale intensity is an alpha mask. The original RAT-16 checkpoint is already an alpha model:

.venv/bin/wsample -c examples/configs/mnist_rat.yaml \
  --checkpoint examples/saved/mnist_rat_h16/final.pt \
  -n 64 --alpha -o alpha.png

Export the real MNIST test split as RGBA PNGs (no GIMP):

.venv/bin/python docs/scripts/mnist_to_alpha.py --split test

Track runs

mlflow ui --backend-store-uri sqlite:///mlflow.db

🙃 Architecture

Click to expand 🔻

WINK architecture: noisy image plus one-hot digit, patch embed, factorized 2D position, time rotor, four RAT blocks, pixel head, unpatchify and alpha renderer.

The WINK denoiser. The digit plane is concatenated to the noisy image; the time rotor is applied after the 2D position; the renderer outside the model turns x0 into RGBA.

x0 [B,C,H,W] -> 4x4 patches -> complex patch embedding
             -> + factorised 2D position (+ class plane in v0.1)
             -> time rotor R_t (ported from dagoBERT)
             -> hyper (full complex softmax) | rat (bidirectional fast-weight)
             -> complex head -> x0_hat [B,C,H,W]
  • No VAE, no latent. Diffusion runs directly in pixel space at 28×28 (MNIST) and 32×32 (CIFAR); a bad sample is the denoiser's fault.
  • Patches: 4×4, so MNIST is 49 tokens and CIFAR is 64.
  • Time: a learned complex rotor rotates the latent by the diffusion step; no separate absolute time table.
  • RAT: the bidirectional fast-weight block from tardits, with a chunked scan for the 64-token CIFAR window. hyper is the full-softmax control.
  • Conditioning (v0.1): a 10-channel one-hot digit plane is concatenated to the noisy image at every DDIM step; 10% class dropout gives a null branch and classifier-free guidance (--guidance) makes the digit obey the prompt. This is digit-class conditioning, not free text: the UI maps “seven” to 7.
  • Levels: level is a config field (ℂ, ℍ, 𝕆, …). Level 1 is the CPU default; levels 2/3 work on CIFAR but cost more than they return at this scale.

The detailed design, invariants and port map: docs/model-internals.md.

🔥 Evidence & measurements

Click to expand 🔻

M1 — MNIST, 3k CPU steps

model val x0-MSE note
hyper softmax 0.0801 blob-like samples
RAT-16 0.0629 readable digits
RAT-32 0.0617 CPU pick, 217.5 ms/step

Quality saturates around 8–32 heads; speed keeps improving. Full tables: mnist-hyper-vs-rat.md, rat-head-sweep.md.

M2 — CIFAR-10, 10k steps, FID vs 10k real images

model val x0-MSE FID
hyper 10k 0.0347 160.36
RAT-32 10k 0.0351 156.12
RAT-32 20k cosine 0.0326 @17k 178.68
RAT-32 width 96, 10k 0.0330 149.60
quaternion level 2, 10k 0.0342 170.04

The honest story: RAT wins at 49 tokens; CIFAR is texture-level, not object-level; more steps can lower val while hurting FID; width helps, depth and higher levels are not free wins. Reports: 2026-11-19-cifar10-10k.md, 2026-11-20-cifar10-rat-chunked.md, 2026-11-20-cifar10-head-sweep.md, 2026-11-20-cifar10-20k-cosine.md, 2026-11-21-cifar10-levels.md, 2026-11-21-cifar10-param-matched-10k.md.

0.1 — promptable MNIST

model params budget val x0-MSE
unconditional RAT-32 250k 3k 0.0617
channel + class dropout + CFG 261k 10k 0.0435

Prompted 0–9 grid: prompted_digits_10k_preview.png. Details: 2026-11-21-mnist-promptable.md.

What did not work (yet)

  • 1,000-step / epsilon prediction at 0.24M params: high-noise x0 was too inaccurate; sampler stayed noise.
  • v-prediction at 1,000 steps: plateaued.
  • Additive sinusoidal time conditioning: slower convergence.
  • Longer CIFAR training (20k) and quaternion level 2 at equal params: lower val, worse FID.
  • A 6-layer depth control was deferred at ~1.5 s/step under laptop load.

These are recorded as nulls, not hidden.

🗺️ Repo map & docs

Click to expand 🔻
src/wink/            models, diffusion, trainer, data, alpha, CLIs
examples/configs/    two entry points: simple MNIST + promptable 10k
examples/data/       MNIST cache (11 MB), committed
examples/saved/      empty; checkpoints written here
docs/                findings, experiments, model internals, repo map
web/                 pure-JS promptable toy + exported weights
tests/               38 tests (no network needed)
AGENTS.d/            private knowledge clone, not tracked here

🧭 Outlook

  • 0.1.0: package the CPU MNIST release (quickstart, changelog, tag).
  • Fashion-MNIST: second tiny dataset, same alpha/promptable pipeline.
  • RGBA: true colour + alpha diffusion, not just grayscale-as-alpha.
  • CIFAR capacity: width 128 and a fair level-2 schedule; the 96-wide run is the current best FID.
  • Text conditioning and VAE/latent variants are out of scope for v0.

📜 License & attribution

Apache-2.0; see LICENSE. WINK is the image sibling of TARDITS; the RAT block and hypercomplex layers are shared, the image model is its own.

Metadata

Release files for wink-diffusion 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wink-diffusion 0.1.1
File Size Uploaded Provenance Actions
wink_diffusion-0.1.1.tar.gz 20.5 MB Without provenance Details for wink_diffusion-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wink-diffusion 0.1.1
File Interpreter ABI Platform Actions
wink_diffusion-0.1.1-py3-none-any.whl Python 3 none any Details for wink_diffusion-0.1.1-py3-none-any.whl

Total release size: 20.6 MB

Release files / wink_diffusion-0.1.1.tar.gz

Download URL wink_diffusion-0.1.1.tar.gz
Size 20.5 MB
Tags Source
SHA-256 checksum
How to use checksums
8e9270471a37d04719063d8c01546fcd7f5b082d4210de0313fe1c542ed604c4
BLAKE2b-256 checksum
How to use checksums
cecd1b2f300b89ad25759484163b51500ad009cee78437f2256dc6cb7e56da60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / wink_diffusion-0.1.1-py3-none-any.whl

Download URL wink_diffusion-0.1.1-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8acc6f5e159bb5059ab8eaa6e6fec254646832646216c364caa450cc2e547b6c
BLAKE2b-256 checksum
How to use checksums
80e5d72d1926790c456541eb3c3d5b081a251134071acc953a5b75269d7e5d70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for wink-diffusion 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page