Mochi Diffusion
Run Stable Diffusion and FLUX.2 Klein on Mac natively
Mochi Diffusion is a native macOS app for generating images locally using Apple's Core ML Stable Diffusion implementation to achieve maximum performance and speed with reduced memory requirements, and the Iris pipeline for running FLUX.2 (Klein) models with native Metal GPU acceleration
Features
- Generate images locally and completely offline
- Generated images are saved with prompt info inside EXIF metadata (view in Finder's Get Info window)
- Built-in gallery with import/save/sync support
- macOS native app using SwiftUI
Downloads
- Mochi Diffusion
- Core ML Stable Diffusion
- FLUX.2 Klein
Models
You will need Core ML Stable Diffusion or FLUX.2 Klein models in order to use Mochi Diffusion.
Core ML Stable Diffusion
Mochi Diffusion uses Stable Diffusion models which have been specially converted (Core ML) to run on Apple hardware. The advantage of this is that they are extremely fast and memory efficient, especially on Apple Silicon Macs with Neural Engine. The downside is that each model can only generate images of a fixed size which is baked in during the conversion.
Stable Diffusion allows generating images based on another “starting image”, or with ControlNet
Compute Unit
CPU & Neural Engineprovides a good balance between speed and low memory usageCPU & GPUmay be faster on M1 Max, Ultra and later but will use more memory
Usage
- Convert or download Core ML models
split_einsum version is compatible with all compute unit options including Neural Engine
- original version is only compatible with CPU & GPU option
- By default, the app's model folder will be created under your home directory. This location can be customized under Settings
- In the model folder, create a new folder with the name you'd like displayed in the app then move or extract the converted models here
- Your directory structure should look like this:
<Home Directory>/
└── MochiDiffusion/
└── models/
├── stable-diffusion-2-1_split-einsum_compiled/
│ ├── merges.txt
│ ├── TextEncoder.mlmodelc
│ ├── Unet.mlmodelc
│ ├── VAEDecoder.mlmodelc
│ ├── VAEEncoder.mlmodelc
│ └── vocab.json
├── ...
└── ...
When using a model for the very first time, it may take up to 2 minutes for the Neural Engine to compile a cached version. Afterwards, subsequent generations will be much faster.
FLUX.2 Klein
No conversion is required for FLUX.2 Klein models.
Klein can use up to 4 “input images” in generations. Due to pipeline constraints, it may be necessary to constrain input image dimensions to fit the attention budget. Mochi will automatically resize inputs and indicate the new sizes in the UI.
Usage
- Download
text_encoder,tokenizer,transformer, andvaefor a FLUX.2 Klein model from the Downloads links above (or usedownload_model.sh) - Place in MochiDiffusion's model folder
- Your directory structure should look like this:
<Home Directory>/
└── MochiDiffusion/
└── models/
├── flux-klein-4b/
│ ├── text_encoder/
│ ├── tokenizer/
│ ├── transformer/
│ └── vae/
├── ...
└── ...
(see iris.c issue #12) for specific guidance for flux-klein-4b)
Compatibility
- Apple Silicon (M1 and later)
- macOS 15.6 and later
- Xcode 26.0 or later (to build)
Building From Source
The project supports SharedXcodeSettings for local overrides to keep per-developer signing state out of the project file.
Create a sibling SharedXcodeSettings/DeveloperSettings.xcconfig next to this repository:
directory/
SharedXcodeSettings/
DeveloperSettings.xcconfig
MochiDiffusion/
Mochi Diffusion.xcodeproj
Example SharedXcodeSettings/DeveloperSettings.xcconfig:
CODE_SIGN_IDENTITY = Apple Development
DEVELOPMENT_TEAM = <Your Team ID>
CODE_SIGN_STYLE = Automatic
PROVISIONING_PROFILE_SPECIFIER =
PRODUCT_BUNDLE_IDENTIFIER = com.example.Mochi-Diffusion
Privacy
Mochi Diffusion doesn’t collect any data or telemetry. All generation happens locally and absolutely nothing is sent to the cloud.
Contributing
Mochi Diffusion is always looking for contributions, whether it's through bug reports, code, or new translations.
- If you find a bug, or would like to suggest a new feature or enhancement, try searching for your problem first as it helps avoid duplicates. If you can't find your issue, feel free to create a new issue. Don't create an issue for your question as those are for bugs and feature requests only.
- If you're looking to contribute code, feel free to open a Pull Request. I recommend installing swift-format to catch lint issues.
- If you'd like to translate Mochi Diffusion to your language, please visit the project page on Crowdin. You can create an account for free and start translating and/or approving.