⚠️ Heads up: this tool's official website appears to be unreachable right now. It may be offline, rebranded, or temporarily down.
Maple Diffusion

Maple Diffusion

★ 3.6 🔖 600 saves 💰 Free GitHub

Maple Diffusion runs Stable Diffusion models locally on iOS and macOS devices, natively in Swift using Apple’s MPSGraph framework — no Python involved. Published on GitHub under the MIT license with about 824 stars, it was one of the earliest demonstrations that a phone could generate AI images entirely on-device. The project was last updated in late 2022 and is a compact, readable reference implementation of diffusion inference on Apple silicon.

Overview

Getting Stable Diffusion to run inside an iPhone’s 4 GB memory limit took real engineering: Maple Diffusion uses FP16 arithmetic with NHWC tensor layouts, aggressive operator fusion through MPSGraph, and swaps model weights to device storage to stay within budget. The results were striking for the time — roughly 2.3 seconds per step on an iPhone 13 Pro, producing a reasonable image in a minute or two, and under a second per step on macOS with its larger memory allowance. The author also documents how Apple’s own Core ML Stable Diffusion compared, making the repository a useful study in performance trade-offs between MPSGraph and Core ML approaches.

Key Features

  • Stable Diffusion inference fully on-device for iOS and macOS
  • Written in Swift on MPSGraph — no Python runtime
  • FP16, operator fusion, and weight swapping to fit iOS memory limits
  • About 2.3 seconds per step on an iPhone 13 Pro
  • Small, hackable reference implementation of diffusion sampling
  • Documented comparison with Apple’s Core ML approach

The repository also rewards reading as a performance case study. The author explains the memory tricks in plain language — why tensors are stored the way they are, where operator fusion wins time, and how close the implementation gets to the hardware’s limits. Engineers porting diffusion models to other accelerators will find the same lessons apply. Maple Diffusion helped kick off the wave of on-device generative AI on Apple platforms that has since become a standard feature category.

💳 Pricing

Maple Diffusion is completely free and open source under the MIT license.

Who Is It For

iOS and macOS developers who want to embed on-device image generation in their apps, and engineers studying how to squeeze large neural networks into tight mobile memory budgets.

🚀 Visit Maple Diffusion Official Site

🚩 Report an issue