Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Native Stable Diffusion inference on iOS / macOS using MPSGraph
| Date | Stars |
|---|---|
| 2026-07-31 | 495 |
| 2026-08-02 | 495 |
| 2026-08-06 | 495 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Native Diffusion Swift Package
[Join us on Discord](https://discord.gg/XNsw7x667a)
Native Diffusion runs Stable Diffusion models **locally** on macOS / iOS devices, in Swift, using the MPSGraph framework (not Python).
This is the Swift Package Manager wrapper of [Maple Diffusion](https://github.com/madebyollin/maple-diffusion). It adds image-to-image, Swift Package Manager package, and convenient ways to use the code, like Combine publishers and async/await versions. It also supports downloading weights from any local or remote URL, including the app bundle itself.
Would not be possible without
* [@madebyollin](https://github.com/madebyollin/) who wrote the Metal Performance Shader Graph pipeline
* [@GuiyeC](https://github.com/GuiyeC) who wrote the image-to-image implementation
# Features
Get started in 10 minutes
* Extremely simple API. Generate an image in one line of code.
Make it do what you want
* Flexible API. Pass in prompt, guidance scale, steps, seed, and an image.
* One-off conversion script from .ckpt to Native Diffusion's own memory-optimized format
* Supports Dreambooth models.
Built to be fun to code with
* Supports async/await, Combine publisher and classic callbacks.
* Optimized for SwiftUI, but can be used in any kind of project, including command line, UIKit, or AppKit
Built for end-user speed and great user experience
* 100% native. No Python, no environments, your user don't need to install anything first.
* Model download built in. Point it to a web address with the model files in a zip archive. The package will download and install the model for later use.
* As fast or faster than a server in the cloud on newer Macs
Commercial use allowed
* MIT Licensed (code). We'd love attribution, but it's not needed legally.
* Generated images are licensed under the [CreativeML Open RAIL-M](https://github.com/CompVis/stable-diffusion/blob/main/LICENSE) license, meaning you can use the images for virtually anything, including commercial use.
# Usage
## One-line diffusion
In its simplest form it's as simple as one line:
```swift
let image = try? await Diffusion.generate(localOrRemote: modelUrl, prompt: "cat astronaut")
```
You can give it a local or remote URL or both. If remote, the downloaded weights are saved for later.
The single line version is currently limited in terms of parameters.
See `examples/SingleLineDiffusion` for a working example.
## As an observable object
Let's add some UI. Here's an entire working image generator app in a single SwiftUI view:

```swift
struct ContentView: View {
// 1
@StateObject var sd = Diffusion()
@State var prompt = ""
@State var image : CGImage?
@State var imagePublisher = Diffusion.placeholderPublisher
@State var progress : Double = 0
var anyProgress : Double { sd.loadingProgress < 1 ? sd.loadingProgress : progress }
var body: some View {
VStack {
DiffusionImage(image: $image, progress: $progress)
Spacer()
TextField("Prompt", text: $prompt)
// 3
.onSubmit { self.imagePublisher = sd.generate(prompt: prompt) }
.disabled(!sd.isModelReady)
ProgressView(value: anyProgress)
.opacity(anyProgress == 1 || anyProgress == 0 ? 0 : 1)
}
.task {
// 2
let path = URL(string: "http://localhost:8080/Diffusion.zip")!
try! await sd.prepModels(remoteURL: path)
}
// 4
.onReceive(imagePublisher) { r in
self.image = r.image
self.progress = r.progress
}
.frame(minWidth: 200, minHeight: 200)
}
}
```
Here's what it does
1. Instantiate a `Diffusion` object
2. Prepare the models, download if needed
3. Submit a prompt for generation
4. Receive updates during generation
See `exampleExcerpt of 8,146 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:9889e8f13fbb47d2, desc:stable diffusion