Views
No views yet
stabilityai/sd-turbo,
compiled and quantized to run on-device on iPhone via the Apple Neural Engine.⚠️ The Stability AI Materials in this repository have been changed. SeeNOTICEfor the full list of modifications.
ORIGINAL attention), shipped uncompressed (fp16, ~2.5 GB), and locked to
resolutions we could not use. Those three properties are baked in at conversion
time and cannot be changed at runtime.| Parameter | Value | Why |
|---|---|---|
| Resolution | 384 × 384 (latent 48 × 48) | 512 renders subjects too small; 256 crops too tightly |
| Attention | SPLIT_EINSUM (v1) | Targets the Neural Engine. SPLIT_EINSUM_V2 requires the latent width to be a multiple of 512, so it cannot do 384 |
| Quantization | 6-bit palettized (text encoder + U-Net) | VAE decoder left at fp16 — it is small and quality-sensitive |
| U-Net batch size | 1 | sd-turbo does not use classifier-free guidance; batch 2 doubles the work for nothing (measured: 2.07× faster at batch 1) |
| VAE encoder | not included | Text-to-image only |
| Compute units | CPU_AND_NE |
apple/ml-stable-diffusion:python -m python_coreml_stable_diffusion.torch2coreml \
--model-version stabilityai/sd-turbo \
--convert-unet --convert-text-encoder --convert-vae-decoder \
--attention-implementation SPLIT_EINSUM \
--quantize-nbits 6 \
--latent-h 48 --latent-w 48 \
--unet-batch-one \
--bundle-resources-for-swift-cli \
--compute-unit CPU_AND_NE| Setting | Value |
|---|---|
| Scheduler | LCM (see the caveat below) |
| Steps | 4 |
| Guidance scale | 0.0 |
| Compute units | cpuAndNeuralEngine |
reduceMemory | true on iPhone |
⚠️ Upstream
apple/ml-stable-diffusionhas no LCM schedulerLCM support has been open and unmerged since 2024 (apple/ml-stable-diffusion#319). To use this model you needLCMScheduler.swift, which exists in keijiro's fork. Cherry-picking the single commitbd0cb9eonto currentapple/mainis enough — it is ~180 lines, and the three conflicts are each one extracasein aswitch.
├── manifest.json ← integrity + version metadata
├── TextEncoder.mlmodelc/ 304 MB
├── Unet.mlmodelc/ 620 MB
├── VAEDecoder.mlmodelc/ 94 MB
├── vocab.json
└── merges.txt.mlmodelc entries are directories, not files. They are stored here
unarchived so that a client can stream them file-by-file and reconstruct the
tree, rather than downloading a ~1 GB archive and needing ~2 GB of free space to
unpack it.manifest.json1{
2 "schemaVersion": 1,
3 "modelVersion": "1.0.0",
4 "totalBytes": 1072200142,
5 "files": [
6 { "path": "Unet.mlmodelc/weights/weight.bin", "bytes": 650117120, "sha256": "..." }
7 ]
8}modelVersion is
published. Files are served at:https://huggingface.co/jivenchy/sd-turbo-coreml-384-6bit/resolve/main/<path>LICENSE.mdNOTICE