One-stop on-device diffusion image-generation engine for iOS / macOS / visionOS. Embeds stable-diffusion.cpp + ggml-metal behind a tight Swift API. Supports SD, SDXL, SD3, Flux, Chroma, Qwen-Image, ERNIE-Image, Z-Image, and anything else sd.cpp can load.
Mirage is a Swift library that lets app developers add AI image generation directly to iPhone, iPad, and Mac apps. Instead of sending prompts to cloud services, the AI runs entirely on the user's device using Apple's Metal GPU technology. Developers can choose from various AI models (like Z-Image-Turbo, Stable Diffusion, or Flux) and the library handles all the complex GPU programming behind a simple interface. This approach keeps user data private, works offline, and avoids per-request cloud costs. The library is designed for production use with memory management for large models and progress reporting for good user experience.
How It Works
You discover Mirage and realize you can add powerful AI image creation without sending data to cloud services.
With a few clicks in Xcode, Mirage becomes part of your app just like any other library.
You pick a model like Z-Image-Turbo and download it to your app's storage—the same way you'd download any large file.
You write a few lines of code to connect your model files, and Mirage sets everything up to run on your user's device.
Your user enters something like 'a golden retriever puppy in wildflowers' and taps generate—the AI creates the image right on their phone.
Your app displays 'Step 3 of 9' while the image builds, so users know something exciting is happening.
A beautiful 1024x1024 image appears, created entirely on-device—private, fast, and working even without internet.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.