AI on device

CoreDiffuse

Native Stable Diffusion image generation on iPhone, accelerated with Core ML.
SwiftUIDiffusion ModelsiOSCore ML
A stylized golden retriever generated by CoreDiffuse

Project story

I investigated the capabilities of running a Stable Diffusion model locally on my iPhone. I used the Apple Neural Engine to accelerate a SwiftUI app that runs completely on device.

Image generation takes around 15 seconds for 30 iterations with the palettized UNet architecture. The implementation supports Stable Diffusion 1.5 and 2.1 models.

This was my first iOS application and an opportunity to learn Swift development, the Core ML architecture, and diffusion models in depth.