{"slug": "show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu", "title": "Show HN: Pico-Faces – A diffusion transformer image generator on a RP Pico 2 MCU", "summary": "A developer has created Pico-Faces, a generative AI image generator that runs on a $1 RP2350 microcontroller as used in the Raspberry Pi Pico 2, producing 128×128 RGB face images in 5–20 seconds each. The model, a latent flow diffusion transformer with 2.9 or 1.7 million parameters, achieves a Gen-FID of 53.8 on device and supports conditional generation across five classes, with the project released on GitHub.", "body_md": "This project implements a **Gen AI image generator running on a $1 Microcontroller**, the RP2350, as used in the Raspberry Pi Pico 2.\n\nIt can generate 128×128 RGB images of human faces in 5-20s each and display them on a VGA monitor or stream them over USB. The model implements a latent flow diffusion transformer (DiT), similar to what is used in models like Flux. There are two variants at 2.9 and 1.7 million parameters, 5000x times less than even a typical local diffusion model. It supports conditional generation in 5 classes (gender × smile + neutral).\n\nIt is more than astonishing that a model this small is able to generate complex images at all. Many MNIST toy diffusion projects use far more parameters and are barely able to generate anything coherent. Interestingly, a lot of the optimizations that helped large models were also necessary for this micro model.\n\n**Article with more details here**\n\n## pico_faces_monitor.mp4\n\nThis indicates that the model does indeed behave like a diffusion model. Smaller diffusion models often tend to collapse to an initial bias without actual refinement in subsequent steps. This is not the case here.\n\nThis demonstrates that the model scales as expected with number of steps k and classifier free guidance w (CFG).\n\n-\nHold BOOTSEL while resetting the RP2350 board, copy\n\n[uf2/pico_faces_m3_decD_deep_full.uf2](/cpldcpu/pico-faces/blob/main/uf2)onto the`RPI-RP2`\n\ndrive. -\n`pip install pyserial matplotlib numpy pillow`\n\n, then:\n\n```\npython viewer/view_serial.py --port com10 --seed 3 --steps 8 --class 4  --cfg 6 --show\n```\n\nCheck the [viewer/README.md](/cpldcpu/pico-faces/blob/main/viewer/README.md) for the full parameters descriptions.\n\nOptional: on a Pimoroni VGA Demo Base the firmware displays the images on a connected VGA monitor.\n\nHigh quality model `m3_decD_deep_full` |\nFast model `m3_long_cfg` |\n|\n|---|---|---|\n| DiT | dim 128 × depth 12, 2.37M params | dim 128 × depth 8, 1.59M params |\n| VAE decoder | ~493K params | small, ~116K params |\n| Blob size | 4.02MB | 2.57MB |\n| Gen-FID (device, N=5000, K=8 w=4) | 53.8 (fp reference: 52.4) |\n— (speed build) |\n| Time / image | ~10 s @ K=4 w=4 (≈20 s @ K=8 w=8) | ~4.3 s @ K=4 w=4 (5.4 s @ K=8 plain) |\n\n**Path A — from the released checkpoints (no GPU, ~minutes).**\n\n```\npip install -r requirements.txt   # plus torch (CPU is fine for folding)\nbash scripts/finalize.sh m3_decD_deep_full\nbash scripts/finalize.sh m3_long_cfg\n```\n\nThis folds the released QAT checkpoint with its **frozen** calibration into\n`model.bin`\n\n, verifies the desktop C engine byte-exact against the released\ngoldens, confirms the blob is byte-identical to `checkpoints/<model>/model.bin`\n\n,\nand builds the UF2 (needs the [Pico SDK](/cpldcpu/pico-faces/blob/main/firmware/README.md)).\n\n**Path B — full retrain (CUDA GPU, ~a day).** Dataset download → VAE →\ndecoder D → latents → DiT → calibration → distillation-QAT → path A. The\nstage-by-stage commands live in [train/README.md](/cpldcpu/pico-faces/blob/main/train/README.md) and\n[quant/README.md](/cpldcpu/pico-faces/blob/main/quant/README.md); training is seeded but GPU nondeterminism\nmeans your checkpoints (and CRCs) will differ.\n\n| dir | contents |\n|---|---|\n|\n\n`vae.yaml`\n\n, `dit.yaml`\n\n, `export.yaml`\n\n)[checkpoints/](/cpldcpu/pico-faces/blob/main/checkpoints)[data/](/cpldcpu/pico-faces/blob/main/data)[train/](/cpldcpu/pico-faces/blob/main/train)[quant/](/cpldcpu/pico-faces/blob/main/quant)[engine/](/cpldcpu/pico-faces/blob/main/engine)[firmware/](/cpldcpu/pico-faces/blob/main/firmware)[scripts/](/cpldcpu/pico-faces/blob/main/scripts)`finalize.sh`\n\n, `verify_model.sh`\n\n, `build_firmware.sh`\n\n, `train_model.sh`", "url": "https://wpnews.pro/news/show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu", "canonical_source": "https://github.com/cpldcpu/pico-faces", "published_at": "2026-08-29 12:41:34+00:00", "updated_at": "2026-08-29 12:48:29.496377+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "ai-research", "ai-products"], "entities": ["Pico-Faces", "RP2350", "Raspberry Pi Pico 2", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu", "markdown": "https://wpnews.pro/news/show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu.md", "text": "https://wpnews.pro/news/show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu.txt", "jsonld": "https://wpnews.pro/news/show-hn-pico-faces-a-diffusion-transformer-image-generator-on-a-rp-pico-2-mcu.jsonld"}}