# Mochi-Diffusion **Repository Path**: yot/Mochi-Diffusion ## Basic Information - **Project Name**: Mochi-Diffusion - **Description**: Mochi Diffusion 可在 Mac 上原生运行 Stable Diffusion,本应用内置 Apple 的 Core ML Stable Diffusion 框架 ,以 - **Primary Language**: Swift - **License**: GPL-3.0 - **Default Branch**: main - **Homepage**: https://www.oschina.net/p/mochi-diffusion - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2023-05-11 - **Last Updated**: 2023-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
Run Stable Diffusion on Mac natively
 ## Description This app uses [Apple's Core ML Stable Diffusion implementation](https://github.com/apple/ml-stable-diffusion) to achieve maximum performance and speed on Apple Silicon based Macs while reducing memory requirements. ## Features - Extremely fast and memory efficient (~150MB with Neural Engine) - Runs well on all Apple Silicon Macs by fully utilizing Neural Engine - Generate images locally and completely offline - Generate images based on an existing image (commonly known as Image2Image) - Generated images are saved with prompt info inside EXIF metadata (view in Finder's Get Info window) - Convert generated images to high resolution (using RealESRGAN) - Autosave & restore images - Use custom Stable Diffusion Core ML models - No worries about pickled models - macOS native app using SwiftUI ## Releases Download the latest version from the [releases](https://github.com/godly-devotion/MochiDiffusion/releases) page. ## Running 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. ## Compute Unit - `CPU & Neural Engine` provides a good balance between speed and low memory usage - `CPU & GPU` may be faster on M1 Max, Ultra and later but will use more memory Depending on the option chosen, you will need to use the correct model version (see Models section for details). ## Models You will need to convert or download Core ML models in order to use Mochi Diffusion. A few models have been converted and uploaded [here](https://huggingface.co/coreml). 1. [Convert](https://github.com/godly-devotion/MochiDiffusion/wiki/How-to-convert-Stable-Diffusion-models-to-Core-ML) 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 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: ```