The ml-stable-diffusion repository is Apple's implementation of Stable Diffusion optimized for Apple Silicon devices using Core ML, Apple's machine learning framework. Written primarily in Python, the repository enables text-to-image generation directly on iPhones, iPads, and Mac computers without requiring cloud connectivity or external servers.
The repository comprises two main components. The python_coreml_stable_diffusion package handles conversion of PyTorch models to Core ML format and performs image generation using the Hugging Face diffusers library in Python. The StableDiffusion Swift package allows developers to integrate image generation capabilities into their Xcode projects as a dependency, relying on Core ML model files generated by the Python component. This dual-language approach bridges research-level Python tooling with production-ready Swift deployment.
System requirements are clearly specified for different use cases. Model conversion requires macOS 13.1, Python 3.8, and coremltools 7.0. Project building needs macOS 13.1, Xcode 14.3, and Swift 5.8. Target device runtime varies by capability, with basic support on macOS 13.1 and iOS/iPadOS 16.2, while memory-improved versions require macOS 14.0 and iOS/iPadOS 17.0. Hardware support spans M1 Macs, M1 iPads, and A14 iPhones as minimum generations.
Performance benchmarks demonstrate substantial speed improvements across device generations. For Stable Diffusion 2.1 base at 512x512 resolution, iPhone 14 Pro Max achieves 7.9 seconds end-to-end latency with 2.69 iterations per second, while iPad Pro M2 reaches 7.0 seconds with 3.07 iterations per second. For the larger Stable Diffusion XL base model at 768x768 resolution, iPhone 15 Pro Max completes generation in 31 seconds with 0.85 iterations per second. On desktop, Mac Studio M2 Ultra generates 1024x1024 images in 20 seconds at 1.11 iterations per second. These benchmarks employ weight compression to 6-bit precision and float16 activations, with attention implementation optimizations like SPLIT_EINSUM_V2 tuned per device.
GitGenius activity tracking reveals moderate engagement with a median issue and pull request response latency of 1238.8 hours and mean latency of 5253.6 hours across 48 tracked items. The most active contributors include atiorh with 10 events, rachelcenter with 8 events, and ZachNagengast with 5 events. The repository shares contributors with major projects including microsoft/vscode, microsoft/typescript, and rust-lang/rust, indicating crossover between Apple's machine learning work and broader open-source ecosystems.
The repository is classified across multiple domains reflecting its scope: art creation, AI-driven art, machine learning, image synthesis, art generation, model training, text-to-image generation, stable diffusion, deep learning, AI research, generative models, neural networks, creative technology, AI art, diffusion models, and generative AI. This comprehensive categorization underscores the project's position at the intersection of creative applications and technical machine learning infrastructure, enabling on-device generative AI capabilities for creative professionals and developers building AI-powered applications on Apple platforms.