Upload sd-turbo-coreml (CommuniDev LLC)
Browse files- LICENSE.md +1 -1
- NOTICE +5 -3
- README.md +13 -7
- SHA256SUMS +5 -0
- compiled/VAEEncoder.mlmodelc/analytics/coremldata.bin +3 -0
- compiled/VAEEncoder.mlmodelc/coremldata.bin +3 -0
- compiled/VAEEncoder.mlmodelc/metadata.json +80 -0
- compiled/VAEEncoder.mlmodelc/model.mil +0 -0
- compiled/VAEEncoder.mlmodelc/weights/weight.bin +3 -0
LICENSE.md
CHANGED
|
@@ -4,7 +4,7 @@ This repository is a Core ML conversion of [stabilityai/sd-turbo](https://huggin
|
|
| 4 |
made by CommuniDev LLC (format conversion and 6-bit palettization only; no retraining), plus an unmodified
|
| 5 |
safety checker. See `NOTICE` for exactly what was changed.
|
| 6 |
|
| 7 |
-
1. **Stability AI Community License** — covers `TextEncoder`, `Unet` and `
|
| 8 |
Full text, word for word: [`LICENSE-stability-ai-community.md`](LICENSE-stability-ai-community.md).
|
| 9 |
Use must follow Stability AI's Acceptable Use Policy: https://stability.ai/use-policy.
|
| 10 |
Commercial use requires registering with Stability AI (https://stability.ai/community-license) and is
|
|
|
|
| 4 |
made by CommuniDev LLC (format conversion and 6-bit palettization only; no retraining), plus an unmodified
|
| 5 |
safety checker. See `NOTICE` for exactly what was changed.
|
| 6 |
|
| 7 |
+
1. **Stability AI Community License** — covers `TextEncoder`, `Unet`, `VAEDecoder` and `VAEEncoder` (the SD-Turbo model).
|
| 8 |
Full text, word for word: [`LICENSE-stability-ai-community.md`](LICENSE-stability-ai-community.md).
|
| 9 |
Use must follow Stability AI's Acceptable Use Policy: https://stability.ai/use-policy.
|
| 10 |
Commercial use requires registering with Stability AI (https://stability.ai/community-license) and is
|
NOTICE
CHANGED
|
@@ -3,13 +3,15 @@ This Stability AI Model is licensed under the Stability AI Community License, Co
|
|
| 3 |
Powered by Stability AI.
|
| 4 |
|
| 5 |
Attributions that apply to the Stability AI Materials: the notice above applies to TextEncoder.mlmodelc,
|
| 6 |
-
Unet.mlmodelc and
|
|
|
|
| 7 |
|
| 8 |
Changes made by CommuniDev LLC (2026-10-10): the Stability AI Materials were converted from their fp16
|
| 9 |
safetensors to Core ML with Apple's ml-stable-diffusion converter (torch2coreml, commit 5a170d2),
|
| 10 |
attention SPLIT_EINSUM_V2, 512 x 512; the UNet and text encoder weights were palettized to 6 bits with
|
| 11 |
-
k-means (the text encoder's 77 x 77 attention-mask constant left uncompressed); the VAE decoder
|
| 12 |
-
everything was compiled to .mlmodelc. No retraining or fine-tuning. The VAE encoder
|
|
|
|
| 13 |
|
| 14 |
Other files, not Stability AI Materials:
|
| 15 |
- SafetyChecker.mlmodelc: CompVis stable-diffusion-safety-checker, in Apple's Core ML conversion from
|
|
|
|
| 3 |
Powered by Stability AI.
|
| 4 |
|
| 5 |
Attributions that apply to the Stability AI Materials: the notice above applies to TextEncoder.mlmodelc,
|
| 6 |
+
Unet.mlmodelc, VAEDecoder.mlmodelc and VAEEncoder.mlmodelc, which are derived from stabilityai/sd-turbo
|
| 7 |
+
(revision b261bac6).
|
| 8 |
|
| 9 |
Changes made by CommuniDev LLC (2026-10-10): the Stability AI Materials were converted from their fp16
|
| 10 |
safetensors to Core ML with Apple's ml-stable-diffusion converter (torch2coreml, commit 5a170d2),
|
| 11 |
attention SPLIT_EINSUM_V2, 512 x 512; the UNet and text encoder weights were palettized to 6 bits with
|
| 12 |
+
k-means (the text encoder's 77 x 77 attention-mask constant left uncompressed); the VAE decoder and
|
| 13 |
+
VAE encoder are fp16; everything was compiled to .mlmodelc. No retraining or fine-tuning. The VAE encoder
|
| 14 |
+
was added to this repository on 2026-10-19, from the same 2026-10-10 conversion run.
|
| 15 |
|
| 16 |
Other files, not Stability AI Materials:
|
| 17 |
- SafetyChecker.mlmodelc: CompVis stable-diffusion-safety-checker, in Apple's Core ML conversion from
|
README.md
CHANGED
|
@@ -8,6 +8,7 @@ tags:
|
|
| 8 |
- core-ml
|
| 9 |
- sd-turbo
|
| 10 |
- text-to-image
|
|
|
|
| 11 |
- ios
|
| 12 |
---
|
| 13 |
|
|
@@ -18,8 +19,9 @@ created by **Stability AI**: a fast, distilled version of Stable Diffusion 2.1 t
|
|
| 18 |
in 1–4 steps.
|
| 19 |
|
| 20 |
CommuniDev LLC did **not** train or fine-tune this model. We only changed its file format so it can run on
|
| 21 |
-
an iPhone. It is published so that our iOS
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
## What we changed
|
| 25 |
|
|
@@ -29,11 +31,12 @@ Converted with Apple's [ml-stable-diffusion](https://github.com/apple/ml-stable-
|
|
| 29 |
- Core ML, attention `SPLIT_EINSUM_V2` (Neural Engine layout), 512 × 512 images.
|
| 30 |
- UNet and text encoder: **6-bit palettized** weights (k-means). The text encoder's 77 × 77 causal
|
| 31 |
attention mask holds `-inf` and is left uncompressed.
|
| 32 |
-
- VAE decoder: fp16. The
|
|
|
|
| 33 |
- Safety checker: the CompVis Stable Diffusion safety checker in Apple's Core ML conversion, unmodified.
|
| 34 |
|
| 35 |
-
Modified files: `TextEncoder.mlmodelc`, `Unet.mlmodelc`
|
| 36 |
-
forms of the original checkpoint. Details are in `NOTICE`.
|
| 37 |
|
| 38 |
## Files
|
| 39 |
|
|
@@ -42,6 +45,7 @@ forms of the original checkpoint. Details are in `NOTICE`.
|
|
| 42 |
| `compiled/Unet.mlmodelc` | 623 MB |
|
| 43 |
| `compiled/TextEncoder.mlmodelc` | 304 MB |
|
| 44 |
| `compiled/VAEDecoder.mlmodelc` | 95 MB |
|
|
|
|
| 45 |
| `compiled/SafetyChecker.mlmodelc` | 580 MB |
|
| 46 |
| `compiled/vocab.json`, `compiled/merges.txt` | 1.3 MB |
|
| 47 |
|
|
@@ -51,7 +55,9 @@ forms of the original checkpoint. Details are in `NOTICE`.
|
|
| 51 |
|
| 52 |
With Apple's Swift `StableDiffusionPipeline`: DPM-Solver++ (linspace spacing, which starts at t = 999),
|
| 53 |
2–4 steps, guidance 1.0–2.0, seed-reproducible. At guidance 1.0 the negative prompt has no effect.
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
|
| 56 |
## Limitations
|
| 57 |
|
|
@@ -62,7 +68,7 @@ With Apple's Swift `StableDiffusionPipeline`: DPM-Solver++ (linspace spacing, wh
|
|
| 62 |
|
| 63 |
## Licence
|
| 64 |
|
| 65 |
-
`TextEncoder`, `Unet` and `
|
| 66 |
(`LICENSE-stability-ai-community.md`, word for word): use must follow Stability AI's
|
| 67 |
[Acceptable Use Policy](https://stability.ai/use-policy), and commercial use requires registration with
|
| 68 |
Stability AI. `SafetyChecker` is under **CreativeML Open RAIL-M** (`LICENSE-creativeml-openrail-m.txt`).
|
|
|
|
| 8 |
- core-ml
|
| 9 |
- sd-turbo
|
| 10 |
- text-to-image
|
| 11 |
+
- image-to-image
|
| 12 |
- ios
|
| 13 |
---
|
| 14 |
|
|
|
|
| 19 |
in 1–4 steps.
|
| 20 |
|
| 21 |
CommuniDev LLC did **not** train or fine-tune this model. We only changed its file format so it can run on
|
| 22 |
+
an iPhone. It is published so that our iOS apps can download it on first use and run it entirely on the
|
| 23 |
+
device: [CommuniDream](https://communidev.com) turns dream journal entries into pictures, and
|
| 24 |
+
[CommuniMuse](https://communidev.com) restyles the user's own photos (image-to-image).
|
| 25 |
|
| 26 |
## What we changed
|
| 27 |
|
|
|
|
| 31 |
- Core ML, attention `SPLIT_EINSUM_V2` (Neural Engine layout), 512 × 512 images.
|
| 32 |
- UNet and text encoder: **6-bit palettized** weights (k-means). The text encoder's 77 × 77 causal
|
| 33 |
attention mask holds `-inf` and is left uncompressed.
|
| 34 |
+
- VAE decoder and VAE encoder: fp16. The encoder (added 2026-10-19, from the same conversion run) turns a
|
| 35 |
+
starting picture into latents, for image-to-image.
|
| 36 |
- Safety checker: the CompVis Stable Diffusion safety checker in Apple's Core ML conversion, unmodified.
|
| 37 |
|
| 38 |
+
Modified files: `TextEncoder.mlmodelc`, `Unet.mlmodelc`, `VAEDecoder.mlmodelc` and `VAEEncoder.mlmodelc`
|
| 39 |
+
are converted, modified forms of the original checkpoint. Details are in `NOTICE`.
|
| 40 |
|
| 41 |
## Files
|
| 42 |
|
|
|
|
| 45 |
| `compiled/Unet.mlmodelc` | 623 MB |
|
| 46 |
| `compiled/TextEncoder.mlmodelc` | 304 MB |
|
| 47 |
| `compiled/VAEDecoder.mlmodelc` | 95 MB |
|
| 48 |
+
| `compiled/VAEEncoder.mlmodelc` | 65 MB |
|
| 49 |
| `compiled/SafetyChecker.mlmodelc` | 580 MB |
|
| 50 |
| `compiled/vocab.json`, `compiled/merges.txt` | 1.3 MB |
|
| 51 |
|
|
|
|
| 55 |
|
| 56 |
With Apple's Swift `StableDiffusionPipeline`: DPM-Solver++ (linspace spacing, which starts at t = 999),
|
| 57 |
2–4 steps, guidance 1.0–2.0, seed-reproducible. At guidance 1.0 the negative prompt has no effect.
|
| 58 |
+
For image-to-image, pass a 512 × 512 starting image and a strength; the steps actually run are
|
| 59 |
+
steps × strength, so keep that at 1 or more.
|
| 60 |
+
**The safety checker must stay on**: CommuniDream and CommuniMuse refuse to run without it.
|
| 61 |
|
| 62 |
## Limitations
|
| 63 |
|
|
|
|
| 68 |
|
| 69 |
## Licence
|
| 70 |
|
| 71 |
+
`TextEncoder`, `Unet`, `VAEDecoder` and `VAEEncoder` are under the **Stability AI Community License**
|
| 72 |
(`LICENSE-stability-ai-community.md`, word for word): use must follow Stability AI's
|
| 73 |
[Acceptable Use Policy](https://stability.ai/use-policy), and commercial use requires registration with
|
| 74 |
Stability AI. `SafetyChecker` is under **CreativeML Open RAIL-M** (`LICENSE-creativeml-openrail-m.txt`).
|
SHA256SUMS
CHANGED
|
@@ -18,5 +18,10 @@ ec4f6b87000f1f19c1237776aa4111d6c7e40832db3eee89eb2fa98fb3f686b5 compiled/VAEDe
|
|
| 18 |
6b63ca07bbbe2cc8c3533d6a07ba1bdf4b5d350111a435e88856f0d1759a72bf compiled/VAEDecoder.mlmodelc/metadata.json
|
| 19 |
e0447f4f41d531f94ce20e81d204f0aace02a79aad8d4c0fb3b982a0822e00a6 compiled/VAEDecoder.mlmodelc/model.mil
|
| 20 |
7cc4b185bde09496bc25e236de3a0da8d78ef83fc8a7e8fbe4435f3027413c6f compiled/VAEDecoder.mlmodelc/weights/weight.bin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
f526393189112391ce6f9795d4695f704121ce452c3aad1f5335cc41337eba85 compiled/merges.txt
|
| 22 |
5047b556ce86ccaf6aa22b3ffccfc52d391ea4accdab9c2f2407da5b742d4363 compiled/vocab.json
|
|
|
|
| 18 |
6b63ca07bbbe2cc8c3533d6a07ba1bdf4b5d350111a435e88856f0d1759a72bf compiled/VAEDecoder.mlmodelc/metadata.json
|
| 19 |
e0447f4f41d531f94ce20e81d204f0aace02a79aad8d4c0fb3b982a0822e00a6 compiled/VAEDecoder.mlmodelc/model.mil
|
| 20 |
7cc4b185bde09496bc25e236de3a0da8d78ef83fc8a7e8fbe4435f3027413c6f compiled/VAEDecoder.mlmodelc/weights/weight.bin
|
| 21 |
+
7f2c36edf7102be7e09080b79baa9fadce60af00404c2efc0966deaa264a7067 compiled/VAEEncoder.mlmodelc/analytics/coremldata.bin
|
| 22 |
+
43cd99c3612fd7b9df97eb9deea0c35050d66a488df8b4d56906685ab6649e95 compiled/VAEEncoder.mlmodelc/coremldata.bin
|
| 23 |
+
ea02a31f66ba79604813cda56622bb2cd0605432b445e02e0b866909c0fac022 compiled/VAEEncoder.mlmodelc/metadata.json
|
| 24 |
+
69a39088eceee9476f40145f0aff29e8d0ee9d6d017123f75f661551fac8957d compiled/VAEEncoder.mlmodelc/model.mil
|
| 25 |
+
993f3790072d02f4ba7baaa418b5135be56f99f280f05dfc33515be66dfb3b7d compiled/VAEEncoder.mlmodelc/weights/weight.bin
|
| 26 |
f526393189112391ce6f9795d4695f704121ce452c3aad1f5335cc41337eba85 compiled/merges.txt
|
| 27 |
5047b556ce86ccaf6aa22b3ffccfc52d391ea4accdab9c2f2407da5b742d4363 compiled/vocab.json
|
compiled/VAEEncoder.mlmodelc/analytics/coremldata.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7f2c36edf7102be7e09080b79baa9fadce60af00404c2efc0966deaa264a7067
|
| 3 |
+
size 243
|
compiled/VAEEncoder.mlmodelc/coremldata.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:43cd99c3612fd7b9df97eb9deea0c35050d66a488df8b4d56906685ab6649e95
|
| 3 |
+
size 782
|
compiled/VAEEncoder.mlmodelc/metadata.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"shortDescription" : "Stable Diffusion generates images conditioned on text and\/or other images as input through the diffusion process. Please refer to https:\/\/arxiv.org\/abs\/2112.10752 for details.",
|
| 4 |
+
"metadataOutputVersion" : "3.0",
|
| 5 |
+
"outputSchema" : [
|
| 6 |
+
{
|
| 7 |
+
"hasShapeFlexibility" : "0",
|
| 8 |
+
"isOptional" : "0",
|
| 9 |
+
"dataType" : "Float32",
|
| 10 |
+
"formattedType" : "MultiArray (Float32 1 × 8 × 64 × 64)",
|
| 11 |
+
"shortDescription" : "The latent embeddings from the unet model from the input image.",
|
| 12 |
+
"shape" : "[1, 8, 64, 64]",
|
| 13 |
+
"name" : "latent",
|
| 14 |
+
"type" : "MultiArray"
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
+
"version" : "sd-turbo",
|
| 18 |
+
"modelParameters" : [
|
| 19 |
+
|
| 20 |
+
],
|
| 21 |
+
"author" : "Please refer to the Model Card available at huggingface.co\/sd-turbo",
|
| 22 |
+
"specificationVersion" : 7,
|
| 23 |
+
"storagePrecision" : "Float16",
|
| 24 |
+
"license" : "OpenRAIL (https:\/\/huggingface.co\/spaces\/CompVis\/stable-diffusion-license)",
|
| 25 |
+
"mlProgramOperationTypeHistogram" : {
|
| 26 |
+
"Pad" : 3,
|
| 27 |
+
"Ios16.cast" : 1,
|
| 28 |
+
"Ios16.mul" : 2,
|
| 29 |
+
"Ios16.sub" : 22,
|
| 30 |
+
"Ios16.sqrt" : 22,
|
| 31 |
+
"Transpose" : 6,
|
| 32 |
+
"Ios16.square" : 22,
|
| 33 |
+
"Ios16.add" : 34,
|
| 34 |
+
"Ios16.reduceMean" : 44,
|
| 35 |
+
"Ios16.realDiv" : 22,
|
| 36 |
+
"Ios16.conv" : 28,
|
| 37 |
+
"Ios16.linear" : 4,
|
| 38 |
+
"Ios16.matmul" : 2,
|
| 39 |
+
"Ios16.batchNorm" : 21,
|
| 40 |
+
"Ios16.softmax" : 1,
|
| 41 |
+
"Ios16.reshape" : 49,
|
| 42 |
+
"Ios16.silu" : 21
|
| 43 |
+
},
|
| 44 |
+
"computePrecision" : "Mixed (Float16, Float32, Int32)",
|
| 45 |
+
"stateSchema" : [
|
| 46 |
+
|
| 47 |
+
],
|
| 48 |
+
"isUpdatable" : "0",
|
| 49 |
+
"availability" : {
|
| 50 |
+
"macOS" : "13.0",
|
| 51 |
+
"tvOS" : "16.0",
|
| 52 |
+
"visionOS" : "1.0",
|
| 53 |
+
"watchOS" : "9.0",
|
| 54 |
+
"iOS" : "16.0",
|
| 55 |
+
"macCatalyst" : "16.0"
|
| 56 |
+
},
|
| 57 |
+
"modelType" : {
|
| 58 |
+
"name" : "MLModelType_mlProgram"
|
| 59 |
+
},
|
| 60 |
+
"inputSchema" : [
|
| 61 |
+
{
|
| 62 |
+
"hasShapeFlexibility" : "0",
|
| 63 |
+
"isOptional" : "0",
|
| 64 |
+
"dataType" : "Float16",
|
| 65 |
+
"formattedType" : "MultiArray (Float16 1 × 3 × 512 × 512)",
|
| 66 |
+
"shortDescription" : "The input image to base the initial latents on normalized to range [-1, 1]",
|
| 67 |
+
"shape" : "[1, 3, 512, 512]",
|
| 68 |
+
"name" : "x",
|
| 69 |
+
"type" : "MultiArray"
|
| 70 |
+
}
|
| 71 |
+
],
|
| 72 |
+
"userDefinedMetadata" : {
|
| 73 |
+
"com.github.apple.coremltools.version" : "7.2",
|
| 74 |
+
"com.github.apple.coremltools.source_dialect" : "TorchScript",
|
| 75 |
+
"com.github.apple.coremltools.source" : "torch==2.2.2"
|
| 76 |
+
},
|
| 77 |
+
"generatedClassName" : "Stable_Diffusion_version_sd_turbo_vae_encoder",
|
| 78 |
+
"method" : "predict"
|
| 79 |
+
}
|
| 80 |
+
]
|
compiled/VAEEncoder.mlmodelc/model.mil
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
compiled/VAEEncoder.mlmodelc/weights/weight.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:993f3790072d02f4ba7baaa418b5135be56f99f280f05dfc33515be66dfb3b7d
|
| 3 |
+
size 68338112
|