MochiDiffusion/MochiDiffusion

★ 7,978⑂ 366

Run Stable Diffusion on Mac natively

About MochiDiffusion/MochiDiffusion

MochiDiffusion/MochiDiffusion is an open-source project on GitHub, mainly written in Swift. Run Stable Diffusion on Mac natively It currently holds 7,978 stars and 366 forks with 3 open issues, and was last pushed on 2026-11-02 (repository created 2022-12-15).

Project Overview

Git Homed tracks it on the Image Trending board and on the AI Image Trending list.

GitHub Repository Details

Repository MochiDiffusion/MochiDiffusion · default branch main · size 105200 KB · watchers 58 · source: GitHub REST API and repository README

README

Mochi Diffusion

Run Stable Diffusion and FLUX.2 Klein on Mac natively

English, 한국어, 中文

Screenshot

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 and Z-Image Turbo models with native Metal GPU acceleration

Features

Downloads

Models

You will need model files. Mochi Diffusion supports Core ML Stable Diffusion, FLUX.2 Klein, and Z-Image Turbo.

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

Depending on the option chosen, you will need to use the correct model version.

Usage

1. Convert or download Core ML models

2. By default, the app's model folder will be created under your home directory. This location can be customized under Settings 3. 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 4. Your directory structure should look like this:

/
└── 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

1. Download text_encoder, tokenizer, transformer, and vae for a FLUX.2 Klein model from the Downloads links above (or use download_model.sh) 2. Place in MochiDiffusion's model folder 3. Your directory structure should look like this:

/
└── MochiDiffusion/
    └── models/
        ├── flux-klein-4b/
        │   ├── text_encoder/
        │   ├── tokenizer/
        │   ├── transformer/
        │   └── vae/
        ├── ...
        └── ...        

(see iris.c issue #12) for specific guidance for flux-klein-4b)

Z-Image Turbo

No conversion is required for Z-Image Turbo. It does not use input images or starting image; its iris pipeline only supports t2i.

The "recommended" full precision download of Z-Image Turbo is large, about 32 GB. iris.c has not been optimized to read Z-Image Turbo model weights from disk, and so may fail to run on Macs with less than 24GB RAM (iris.c/issues/37)

Usage

1. Download the files for Z-Image Turbo from the Downloads links above (or use download_model.py) 2. Place a subfolder containing the model files in MochiDiffusion's model folder 3. Your directory structure should look like this:

/
└── MochiDiffusion/
    └── models/
        ├── z-image-turbo/
        │   ├── text_encoder/
        │   ├── tokenizer/
        │   ├── transformer/
        │   ├── vae/
        │   └── model_index.json
        ├── ...
        └── ...        

Compatibility

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 = 
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.

Credits

GitHub Stars & Activity

7,978Stars
366Forks
3Open issues
SwiftLanguage

GitHub Popularity

GitHub stars7,978
Forks366
Open issues3
Primary languageSwift
LicenseGPL-3.0
Stars gained today0
Created2022-12-15
Last pushed2026-11-02

Trending History

Trending statusnot on today's boards

Related GitHub Projects

1
→
2

Comfy-Org / ComfyUI

Python★ 146,291⑂ 0
→
3

opencv / opencv

C++★ 91,529⑂ 0
→
4

unslothai / unsloth

Python★ 79,319⑂ 0
→
5

ultralytics / ultralytics

Python★ 63,293⑂ 0
→
6

ultralytics / yolov5

Python★ 58,259⑂ 0
→
7

roboflow / supervision

Python★ 51,591⑂ 0
→
8

mudler / LocalAI

Go★ 50,311⑂ 0
→

More Trending Repositories