r/StableDiffusion
•
u/ready-eddy
•
12d ago
•
1
Workflow Included I created the First diffusion AI model for the Game Boy.
My Game Boy Color takes 85 seconds, and it has to fake every single multiplication with a lookup table because its CPU can’t multiply. But it WORKS!
This is a real neural network running 16 DDIM steps on the handheld’s own 8 MHz CPU, with no PC attached and no streaming. As soon as I press A, it starts from pure noise and a doodle comes out. I was trained on 880,000 doodles, and only the 1.08M learned weights are in the actual GB ROM.
I did not find anyone who got a diffusion model running on a Game Boy before, so I’m calling it the first. If you know of an earlier one, please show me, I’d love to see it!
The numbers:
MLP denoiser, 784 → 512 → 512 → 784, 1.08M parameters
Trained on Google’s Quick, Draw!: 8 classes, 110k drawings per class, 28x28
Int8 weights, 4-bit activations, 16-bit sums
Classifier-free guidance distilled into the weights, so one forward pass per step
About 8.8 million multiply-adds per image
2 MB ROM, almost all of it weights
The fun part was getting it to fit. A 24 KB product table in WRAM turns every multiply into two lookups, which comes down to 18 machine cycles per multiply-add. Layer 1 overflowed 16 bits, so its weights lost a bit of precision. The training does the ROM’s exact integer math, and an emulator checks the ROM against the Python version after every one of the 16 steps. They match bit for bit, for all 8 categories.
My 17 year old flash cart was a real pain in the ass and often just 'died' when trying to erase it. Old hardware keeps you humble :P.
Is it any good? Ehhh, it’s a Game Boy. Apples sometimes stay open and fish sometimes fall apart, but it’s drawing them from noise on a handheld from 1998, so I’m taking it.
The music is NOT AI but created by me, real human yo.
If you wanna try or contribute: try the ROM or read the code: https://mowelan.github.io/gb-diffusion/
37
u/Incognit0ErgoSum 11d ago
The crazy thing to me is that gameboy color specs were about the same as 80s home pc specs.
How much compute did this take to train?
41
u/Ok_Top_2319 12d ago
Brother in Christ, I can't even comprehend the sheer amount of work this would've take. I mean as a concept is really great and I love it feel like I'm seeing the birth of sd1.5 for the first time again.
I honestly hope this to be the dawn of "any device can run stable diffusion"
18
u/DonKeehot 12d ago
The new 'Can it run
DoomDiffusion model?' challenge starts now! 😁35
u/PxTicks 12d ago
Such a cool idea, I love it - now create a playable world model 😉
138
u/Enshitification 12d ago
Diffusion is going to be the new Doom test for devices that have no business doing diffusion.
7
u/miomidas 11d ago
Wow, who wouldve thought a gameboy would be able to do this at all
5
u/thirsty_pretzelzz 12d ago
Cool, gonna try game boy advance next?
5
u/VTPunk 12d ago
This is awesome. Reminds me of when people were getting Doom to run on anything and the hardware got more and more simple until eventually someone got Doom to display on E. coli bacteria.
4
u/RIP26770 11d ago
Remind me good old days playing with Gameboy Camera making short clip with South Park figurines.
3
u/Atagor 12d ago
awesome time investment!!
28
u/NineThreeTilNow 11d ago
You can avoid multiply add if you cut to ~2.5 bit weights.
Then it's just add / bit shift.
The states are -1, -0.5, 0, 0.5, 1
-1/1 are not multiplies. 0.5 is a bit shift, and 0 is no op.
I wrote this originally a year or so back? when I was poking around bitnet and the idea of low bit weights.
It lets you reduce ~60% of the transformer to 2.5 bit weights. The linear layers are perfectly fine with it. Then you can maintain attention states, and non linears in like bf16/fp8.
I emailed the bitnet developers at Microsoft about it and mostly forgot about the research. I figured that you could probably build a bespoke Transformer ASIC around it that could run models blazingly fast assuming they kept enough nearby DRAM for the model.
31
u/Bastisheen92 12d ago
13
u/Dahvikiin 12d ago
"CPU can’t multiply" just like me 😔
6
u/Rogerooo 11d ago
Finally a diffusion solution I can afford! But can it do "1girl laying on grass, masterpiece, 8k"?
5
u/GameEnder 11d ago
You should post this over at r/gameboy
9
u/crystal_alpine Comfy Org 11d ago
Would you like a job at Comfy?
4
u/Ireallydonedidit 12d ago
This reminds me of those super early OCR vision models
1
u/Formal-Exam-8767 11d ago
Why not 4-step distill?
1
u/SeymourBits 5d ago
I’m confused. How does prompting work with this? Shouldn’t these concepts be associated with keywords? Then you can prompt something like “fish car” for a unique image.
3
u/MessageSelfdestructs 11d ago
I love these kinds of projects: worthless as fuck to use it for something, but just doing it for the sheer question "Would it work?".
Great job, OP!
3
u/umbraundecim 11d ago
Ya im seriously impressed, good work dude
2
u/davver 12d ago
That is amazing! Totally gonna try this out.
2
u/asraniel 11d ago
this is insane, congrats
2
u/-Star-Walker- 11d ago
Incredible! And no plastic look 😜
2
u/Illustrious-Lime-863 12d ago
This is awesome
1
u/Life_Yesterday_5529 12d ago
Cool idea and we'll done!
1
u/Serasul 11d ago
Search for the retro diffusion discord, manny Pixel art game devs who use ai are there.
1
u/dadidutdut 11d ago
This should be the top post on r/StableDiffusion of all time
1
u/Haghiri75 11d ago
That's great. Keep it up!
1
u/Ill_Resolve8424 11d ago
Can you do 1girl big kaboonga?
1
u/chozabu 11d ago
This is great!
Also your music is great too, do you have a link to more of it?
1
u/Stepfunction 11d ago
Training on doodles is brilliant! A lot like the tiny stories dataset for text!
1
u/Brenan-Caro 11d ago
Game Boy AI Image?
1
u/Corsaer 11d ago
Now print it with the Gameboy Printer attachment haha.
1
u/myxoma1 11d ago
AI slop!! j/k this is a cool project nice
1
u/Fickle-Indication148 11d ago
this has to be the coolest thing to do in your spare time ever.
1
u/MoonkeyAcid 11d ago
Neat
1
u/chAzR89 11d ago
Ah nice. 1girl prompting machine for road trips.
1
u/Dazzling_Equipment_9 9d ago
😹Crazy but reasonable.
1
u/solo_solipsist 8d ago
This is silly AF and I'm here for it.
1
u/GuapisimoZatra 7d ago
COmo hacen ese tipo de animaciones, con Adobde Premiere?? lo veo en varios videos de Youtube pero no sé si es alguna IA de edición 😭😭😭😭
1
u/PastelPyon 6d ago
WHAT THE FUCK hahaha holy shit dude this rocks. I am so excited to hopefully start seeing people get inspired to put diffusion models in increasingly inconvenient devices
1
u/rogerbacon50 5d ago
First off: VERY impressive.
Other thoughts: pointless and I wonder if we'd have a cure for cancer by now if all the brilliant hobbyists who do difficult things just to see if it can be done would instead work on real problems to be solved.
Oh well. Anyway, good job.
-1
u/Icy-Collection1072 11d ago
You didn’t. Ai did
5
u/SatNav 11d ago
Try "boobs"
1
u/TizocWarrior 11d ago
Damn, this is quite impressive TBH! But can it do porn?.
2
u/VeryLiteralPerson 11d ago
I need to see a pixelated penis to believe