Core ML Stable Diffusion

Core ML Stable Diffusion

โ˜… 4.2 ๐Ÿ”– 4000 saves ๐Ÿ’ฐ Free GitHub

Core ML Stable Diffusion is Apple’s official open-source implementation of Stable Diffusion optimized for Apple Silicon. It converts the PyTorch diffusion models into Core ML format so image generation runs fast and efficiently on the Neural Engine and GPU of Macs, iPhones and iPads. Released alongside Apple’s machine learning research in late 2022, it has earned about 18,000 stars on GitHub.

Overview

The repository has two halves: a Python package that converts and compresses PyTorch Stable Diffusion models (including SDXL and Stable Diffusion 3) into Core ML format using Hugging Face diffusers, and a Swift package that developers add to Xcode projects to run image generation natively in their apps. Apple put serious work into optimization: attention implementations tuned per device, and weight palettization that compresses models to 6-bit or even lower precision so they fit and run on phones, with published benchmarks showing 512×512 generation in seconds on recent iPhones. Ready-made converted models are also published on the Hugging Face Hub, and ControlNet models are supported.

Key Features

  • Official Apple conversion of Stable Diffusion, SDXL and SD3 to Core ML
  • Swift package for embedding on-device image generation in macOS and iOS apps
  • Neural Engine and GPU acceleration tuned per Apple Silicon device
  • Advanced weight compression (palettization down to a few bits) and activation quantization
  • Ready-made Core ML models on Hugging Face Hub and ControlNet support
  • Detailed per-device performance benchmarks published by Apple and Hugging Face

๐Ÿ’ณ Pricing

Core ML Stable Diffusion is completely free and open source under the MIT license. The underlying Stable Diffusion model weights carry their own licenses, which you should check for your use case.

Who Is It For

This is for Apple platform developers who want private, offline, on-device text-to-image generation in their Mac, iPhone or iPad apps without any server or API dependency.

๐Ÿš€ Visit Core ML Stable Diffusion Official Site

๐Ÿšฉ Report an issue