# Repository Briefing: MochiDiffusion/MochiDiffusion
> Source: https://repoforai.com/repo/MochiDiffusion/MochiDiffusion (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/MochiDiffusion/MochiDiffusion
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Swift
- **License**: GPL-3.0
- **Engineering Health**: A (83/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 11/20)
- **Latest Release**: v7.0 (2026-11-15) — https://github.com/MochiDiffusion/MochiDiffusion/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Local AI, GPU
- **Momentum**: 7,977 ★ total (+0 24h / +1 7d) · 377 forks
- **Topics**: `ane`, `apple`, `apple-silicon`, `coreml`, `macos`, `neural-engine`, `stable-diffusion`, `swift`, `swiftui`
- **When to Use**: Best for: Apple Silicon users who want offline image generation, control over model files, and reusable PNG generation metadata, with the option to run inference on a trusted LAN server. Skip if: You want a managed service with no model setup, need Draw Things’ unsupported image-editing models through Mochi, or require reliable Z-Image Turbo inference on a 16 GB Mac.

## Overview
```text
### Architecture & Core Mechanics
Mochi Diffusion is a native SwiftUI macOS app that presents three inference paths through one model picker. Apple’s Core ML Stable Diffusion implementation loads converted model bundles and offers compute-unit selection. Iris (iris.c) runs FLUX.2 Klein and Z-Image Turbo through Metal on the local GPU. The selected model therefore determines not just the weights, but also the execution device, input modes, and available controls.

Draw Things is a separate server-backed path, not another in-process runtime. Mochi browses the model inventory over gRPC and submits generation to either the Draw Things app or its standalone gRPC server. The server can run on the same Mac or another machine on the LAN; its hardware performs inference, and Mochi does not use Draw Things cloud compute.

### Key Capabilities & Differentiators
The Core ML Stable Diffusion path supports generation from a starting image and ControlNet with compatible models, but output dimensions are baked into each conversion. Iris runs FLUX.2 Klein without conversion and accepts up to four input images, resizing them when necessary to fit the attention budget and displaying the resulting dimensions. The Iris Z-Image Turbo pipeline is text-to-image only.

Draw Things exposes text-to-image models, starting-image input, LoRAs where supported, and reference images for FLUX.2. It does not expose image-editing models such as FLUX.1 Kontext and Qwen-Image-Edit. The built-in gallery supports import, save, and sync. PNG exports embed generation settings in an AUTOMATIC1111-compatible format that Civitai can read, while Musubi lets the app read metadata from other common generators.

### Trade-offs & Limitations
Compared with Midjourney’s managed workflow, Mochi gives users control over local model files and can generate offline once the weights are installed. The trade-off is maintaining model files, choosing the right conversion variant, and sizing the machine for the selected backend. Core ML’s memory-efficient path comes with fixed output dimensions, and compute selection depends on the bundle: split_einsum works with Neural Engine options, whereas original requires CPU & GPU.

For a 16 GB Mac, Core ML with CPU & Neural Engine is the sensible starting point, not a sizing guarantee for the Iris backends. The recommended full-precision Z-Image Turbo download is about 32 GB on disk and may fail on Macs with less than 24 GB of RAM. A LAN Draw Things server shifts that inference load to another machine but does not give Mochi access to all of Draw Things’ editing workflows. GPL-3.0 obligations apply when distributing the app; model weights have separate licensing terms to check.

### Hardware & Deployment Guide
Run a release build on Apple Silicon (M1 or later) with macOS 15.6 or later. Start with ~/MochiDiffusion/models/ or change the location in Settings. Put each model in its own subfolder: the Core ML example uses compiled components such as TextEncoder.mlmodelc and Unet.mlmodelc, while FLUX.2 Klein uses text_encoder/, tokenizer/, transformer/, and vae/. A model’s first Neural Engine run can spend up to two minutes compiling a cached version.

Source builds require Xcode 27 or later; signing overrides can live in a sibling SharedXcodeSettings/DeveloperSettings.xcconfig. For self-hosting, enable gRPC and Model Browsing in Draw Things, then configure the host, port, TLS, and shared secret in Mochi. Use a trusted network: TLS encrypts traffic but does not verify server identity. Release v6.2 added broader metadata interoperability, v6.3 added Iris Z-Image Turbo support and fixed FLUX Klein memory retention after generation, and v7.0 added Draw Things integration and filterable model and LoRA pickers.
```

## Key Capabilities
```text
- Inference paths: Core ML runs converted Stable Diffusion models, Iris uses Metal for FLUX.2 Klein and Z-Image Turbo, and Draw Things serves models over gRPC.
- Core ML packaging: split_einsum supports Neural Engine compute options; original is CPU & GPU only. Output dimensions are fixed at conversion.
- Reference images: FLUX.2 Klein accepts up to four inputs and resizes them when needed to fit its attention budget; the Iris Z-Image Turbo pipeline is text-to-image only.
- Local server integration: v7.0 adds Draw Things model browsing and generation, with per-model controls and LoRAs where supported.
- Metadata interoperability: Musubi reads common generator metadata formats, and PNG exports carry AUTOMATIC1111-compatible generation settings.
- Deployment sizing: Apple Silicon and macOS 15.6 or later are required; Z-Image Turbo may fail below 24 GB of RAM.
```

## Quick Start / Clone
```bash
git clone --depth 1 https://github.com/MochiDiffusion/MochiDiffusion.git
cd MochiDiffusion
```
