I implemented a very tiny image generation model (latent flow transformer) on a RP2350 microcontroller - it can generate 128x128 images of faces [P]

Reddit r/MachineLearning Models

Summary

A tiny latent flow transformer with 2.4-4 million parameters, quantized to int8, implemented on an RP2350 microcontroller to generate 128x128 face images in approximately 20 seconds.

Its a 2.4-4 million parameter model, quantized to int8, that can be fully executed on the microcontroller in ~20s with the longest generation. The generated image will then be displayed on a monitor or transferred via usb. Its a latent flow transformer with 12 layers using AdaLN-Zero for conditioning. CFG is also supported and boosted the image quality a lot. The inference engine streams the weight via DMA from the flash while the previous layer is computed. Relu² activation was used to increase sparsity, which the engine can use to skip calculations. Took a lot of ablations to get it right and I am quite astonished I got so far with so few parameters. Will post the repo below https://preview.redd.it/psu567et66mh1.png?width=1167&format=png&auto=webp&s=8b69dfe5caf5a0cde79f03f23fb5843c940bf993
Original Article

Similar Articles

Trained an diffusion model that runs on 264KB of RAM [P]

Reddit r/MachineLearning

An individual trained a diffusion model to generate 32x32 pixel images on a Shrike lite microcontroller with only 264KB RAM, experimenting with FPGA acceleration that hit memory bottlenecks, resulting in noisy but sometimes interesting outputs.

Mage-Flow: An Efficient Native-Resolution Foundation Model for Image Generation and Editing

Hugging Face Daily Papers

Mage-Flow is a compact 4B-parameter generative stack for efficient text-to-image generation and instruction-based image editing, featuring a co-designed lightweight tokenizer (Mage-VAE) and a native-resolution multimodal diffusion transformer trained with rectified flow matching. It achieves competitive performance while enabling high-resolution generation at 0.59s on a single A100 GPU.