A builder known as Tim has produced an RP2350 image generation model that runs a latent flow diffusion transformer on a microcontroller, generating 128×128 RGB portraits of human faces in around 10 to 20 seconds, all from a 4 MB flash footprint.
A Full Diffusion Pipeline on a Microcontroller
The architecture is more involved than a simple lookup table or nearest-neighbour trick. Rather than producing pixels directly, the model generates a probability distribution in a latent space. A variational auto-encoder’s decoder component then translates that distribution into an actual image. Tim trained the auto-encoder in two stages: an encoder to compress an image into its latent-space representation, and a decoder to reconstruct it. Once training was complete, only the decoder needed to live on the device.
The generative side of the pipeline uses the latent flow diffusion transformer approach: the model starts with noise and iteratively predicts the changes required to steer it towards a coherent face. According to Circuit Digest, Tim built two variants of this transformer: a smaller model with 1.7 million parameters and a larger one with 2.9 million parameters. Both were trained on the FFHQ face dataset, and both had their weights quantised to 8-bit integers so the entire inference stack (both model variants plus the inference programme) fits within 4 MB of flash.
Quantising to 8-bit integers is the kind of engineering compromise that would feel familiar to anyone who remembers squeezing sprite data into a 48K Spectrum or coaxing a C64 SID chip to do something its designers never quite intended. The maths gets dirtier, but the results land on real hardware.
RP2350 Image Generation Model: Five Classes and Classifier-Free Guidance
Generation is not entirely unconstrained. The model accepts an output class as an input, which guides the diffusion process in a chosen direction. Circuit Digest reports that five generation classes are supported, based on gender, smiling, and an unconditional option. Classifier-Free Guidance (CFG) is used to strengthen whichever condition has been selected, giving the model a cleaner steer towards the intended result rather than producing a generic average face.
The hardware platform is a Waveshare RP2350 development board. Output can be sent over USB or displayed directly using a VGA adapter board. For a device built around Raspberry Pi‘s RP2350, which was designed squarely as an embedded microcontroller rather than any kind of graphics processor, routing a 128×128 RGB image to a VGA connector is already a small achievement in its own right.
The images produced are not photorealistic. Faces are recognisable as faces (the proportions are broadly right, the features are in the expected places) but there is a soft, slightly dreamlike quality that makes clear something unusual is doing the rendering. For a model that trains entirely on a fixed face dataset and runs inference on a microcontroller with no dedicated floating-point pipeline to speak of, that is a fair trade.
Why It Matters Beyond the Benchmark
Tim has open-sourced the project, which means the weights, the inference code, and the training approach are all available for others to build on. The interest in running AI models on local hardware has been growing steadily, driven by concerns about privacy, a desire for customisation without cloud dependency, and the straightforward economics of not paying per-inference fees to a remote service.
Most attempts at local AI inference still reach for a laptop GPU or, at minimum, a single-board computer with a meaningful amount of RAM. Fitting a working RP2350 image generation model into the same flash budget you might once have used to store a chiptune library is a different kind of demonstration entirely. It is less about the quality of the output and more about what is now possible at the absolute bottom of the compute stack.
Both model variants are available alongside the inference programme, giving builders the choice between the 1.7 million parameter faster model and the 2.9 million parameter version for anyone who prefers the extra capacity and can live with the longer generation time.

