Commodore 64 can run AI to generate images — takes 20 minutes per 90 iterations to make 64 pixels

Starting screen of the AI sprite generator that runs on Commodore 64.
Starting screen of the AI sprite generator that runs on Commodore 64. (Image credit: Nickbild on GitHub)

The August 1982 release of the Commodore 64 is historic, as Commodore's hit personal computer managed to be one of the best-selling PCs of all time — and, it turns out, this historic era of Commodore 64 computing has produced hardware that can do AI image generation — with caveats, of course.

Developer and hobbyist Nick Bild has successfully built and documented a Generative AI tool for Commodore 64 that can be used to create 8x8 sprites that are then displayed at 64x64 resolution. These are intended to help inspire game design concepts, but certainly aren't up to the level of generating entire sprite sheets off one prompt. There are much higher-end implementations of AI in existing games, as well.

In any case, it's fascinating that any kind of generative AI model can be run on hardware this old. It still takes twenty minutes to run 90 iterations for a final image, but that's not bad at all considering the age of the hardware. This also recalls a story from mid-April where the Commodore 64 managed to outperform a modern IBM QPU (Quantum Processing Unit) in a quantum utility experiment.

No reliance on something like OpenAI is needed, though the "probabilistic PCA algorithm" running on the Commodore 64 used for this project was actually trained on a modern computer. So while the model runs on Commodore 64 as advertised, a modern PC was still needed to get this up and running to begin with.

It seems that while the entry-level for "real" AI PCs is hotly up for debate by manufacturers, the ever-reliable Commodore 64 reminds us that the true entry-level starts wherever you, the end user, want it to. With skill, determination, and patience almost anything is possible, though of course, practicality is another question entirely. Even other Commodore 64 mods, like the Raspberry Pi C64 expansion cartridge playing Doom, may be more practical for end users than 8x8 pixel AI sprite generation running on 40-year-old PC hardware.

Freelance News Writer
  • ThomasKinsley
    Another article demonstrating that you don't need fundamentally special hardware to run generative AI.
    Reply
  • JarredWaltonGPU
    ThomasKinsley said:
    Another article demonstrating that you don't need fundamentally special hardware to run generative AI.
    Of course not, it's just math. What you do need is sufficient memory to do the math, which often becomes the limiting factor. The difference is that doing 8x8 pixel images is FAR easier than doing 512x512 images. And since we're doing math, there are approximately:

    1.158 X 10^77 unique 16-color 8x8 images you can theoretically generate on a C-64. Or if you prefer the exact number:
    115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

    So, how many unique 512x512 24-bit color images are there? Oh, not too many, just...
    9.384 X 10^3044820

    Here's the full number, which is a bit like calculating Pi to three million digits. LOL
    Reply
  • ThomasKinsley
    JarredWaltonGPU said:
    Of course not, it's just math. What you do need is sufficient memory to do the math, which often becomes the limiting factor. The difference is that doing 8x8 pixel images is FAR easier than doing 512x512 images. And since we're doing math, there are approximately:

    1.158 X 10^77 unique 16-color 8x8 images you can theoretically generate on a C-64. Or if you prefer the exact number:
    115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

    So, how many unique 512x512 24-bit color images are there? Oh, not too many, just...
    9.384 X 10^3044820

    Here's the full number, which is a bit like calculating Pi to three million digits. LOL
    For the record, I didn't mean it to come across as negatively as it may have seemed. I'm just trying to filter out the complications of NPUs and TOPS and other specs that do not appear to be critical to run AI.
    Reply
  • vern72
    One of the best selling home computers of all time? No, THE best selling home computer of all time!
    Reply
  • kyzarvs
    vern72 said:
    One of the best selling home computers of all time? No, THE best selling home computer of all time!
    I've no idea, but I would have guessed the Amiga / Atari ST wars would have generated more sales than the C64? Just curious as I defected from a Spectrum 128k +2 to the Commodore side of the pond with an Amiga back in the day...
    Reply
  • sitehostplus
    ThomasKinsley said:
    Another article demonstrating that you don't need fundamentally special hardware to run generative AI.
    Well, if you don't mind taking eons of time for your hardware to render a single frame, go for it!
    Reply
  • EvmhCanadian7
    JarredWaltonGPU said:
    Of course not, it's just math. What you do need is sufficient memory to do the math, which often becomes the limiting factor. The difference is that doing 8x8 pixel images is FAR easier than doing 512x512 images. And since we're doing math, there are approximately:

    1.158 X 10^77 unique 16-color 8x8 images you can theoretically generate on a C-64. Or if you prefer the exact number:
    115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

    So, how many unique 512x512 24-bit color images are there? Oh, not too many, just...
    9.384 X 10^3044820

    Here's the full number, which is a bit like calculating Pi to three million digits. LOL
    Actually, Stable Diffusion (as an example) generates images in a 64x64 "latent space" and at the end "upscales" to 512x512.
    Reply
  • JarredWaltonGPU
    vern72 said:
    One of the best selling home computers of all time? No, THE best selling home computer of all time!
    This all hinges around the definition of "home computer." I would argue that the modern consoles can basically be classified as a home computer. Certainly they're more flexible than a C-64 in a lot of ways, though you can't just run any old program. But can you surf the web on a PS5 or Xbox Series X? Sort of, and PS4 did have a fully functional web browser. That makes for a reasonably potent PC.

    And how many MacBooks are there? Well, millions (about 6~8 million per quarter) are sold these days. Those are absolutely in the same "home computer" category as the C-64 back in its heyday. Every MacBook might not be identical in configuration, but it's really mincing words to pretend that the C-64 — which according to wiki sold around 17 million units max. ("...listed in the Guinness World Records as the highest-selling single computer model of all time , with independent estimates placing the number sold between 12.5 and 17 million units."

    Basically, it only ranks high be virtue of not being at all configurable in many respects. If you have two Dell PCs that share all the same base hardware (motherboard, PSU, etc.) but differ in the CPU, RAM, GPU, storage, or any other area, they're not the "same" and thus don't count. In other words, C-64 by this token definition really was a console, with slightly more flexibility in some areas.
    Reply
  • JarredWaltonGPU
    EvmhCanadian7 said:
    Actually, Stable Diffusion (as an example) generates images in a 64x64 "latent space" and at the end "upscales" to 512x512.
    Hmmm... so only 2.836 X 10^29593 potential images, though then upscaling might not be fully deterministic. Doesn't SD do multiple iterations (upscaling passes?) to improve the end quality?
    Reply
  • vern72
    kyzarvs said:
    I've no idea, but I would have guessed the Amiga / Atari ST wars would have generated more sales than the C64? Just curious as I defected from a Spectrum 128k +2 to the Commodore side of the pond with an Amiga back in the day...
    The Amiga/Atari ST *family* might have sold more but the catch is that the C64 was not configurable. All the C64 came with one configuration (then eventually the C64C came along) and that's where the trick is.
    Reply