gbadiff
A diffusion model sized for the Game Boy Advance. It draws a 96×96 butterfly from random noise, shown here on a simulated GBA screen and computed in your browser with the same int8 weights the cartridge will hold.
What is this?
Two small networks. A denoiser runs 16 DDIM steps in a latent space of 256 numbers, and a decoder turns that latent into a 96×96 color image. Their weights are stored as 8-bit integers so they fit in a GBA cartridge. On this page the same int8 weights run with WebGPU, or plain JavaScript where WebGPU is missing.
A GBA has an ARM7TDMI at 16.78 MHz and no floating point. We measured the integer inner loop in the mGBA emulator at 4.75 cycles per multiply-add on dense input, and less where inputs are zero. That puts one drawing at about a minute when every step is shown. Real GBA speed paces this page to that estimate.
How the screen is simulated
- 240×160 pixels, 5 bits per color channel.
- GBA · AGB-001: the original unlit, reflective LCD. Darker and less saturated colors (the higan/Talarubi color formula), a faint pixel grid, and a slow response that smears each change.
- GBA SP · AGS-101: the backlit screen. Closer to the source colors and faster. This one is an approximation.
- Raw pixels: exactly what the cartridge outputs.
Status
Work in progress. The cartridge build isn't finished: the GBA time is an estimate from the measured kernel, and the ROM will also round the activations to integers, so its drawings will differ slightly. The model is a test model trained on 9,213 photos of Smithsonian butterfly specimens. Some drawings come out as grey cards with a ruler, because the photos include those too.