darkmaniac7 commited on
Commit
42050da
·
verified ·
1 Parent(s): aceb786

Add model card with upstream attribution

Browse files
Files changed (1) hide show
  1. README.md +77 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: creativeml-openrail-m
3
+ tags:
4
+ - text-to-image
5
+ - stable-diffusion
6
+ - cyberrealistic
7
+ - photorealistic
8
+ - coreml
9
+ - apple-neural-engine
10
+ - palettized
11
+ - tokforge
12
+ base_model:
13
+ - cyberdelia/CyberRealistic
14
+ pipeline_tag: text-to-image
15
+ library_name: ml-stable-diffusion
16
+ ---
17
+
18
+ # TokForge — CyberRealistic V9 · CoreML 6-bit (Apple Neural Engine)
19
+
20
+ A **6-bit palettized Apple CoreML** conversion of **CyberRealistic V9**
21
+ ([cyberdelia/CyberRealistic](https://huggingface.co/cyberdelia/CyberRealistic), the
22
+ `CyberRealistic_V9_FP16` checkpoint by **cyberdelia** — an SD-1.5 photorealistic finetune
23
+ with best-in-class faces and an integrated VAE), built for on-device image generation in the
24
+ **[TokForge](https://tokforge.ai)** iOS app. Converted with Apple
25
+ **[`ml-stable-diffusion`](https://github.com/apple/ml-stable-diffusion)** (`torch2coreml`)
26
+ using **`SPLIT_EINSUM_V2`** attention and **`--quantize-nbits 6`** (6-bit palettized weights),
27
+ so it compiles **fast on the Apple Neural Engine**.
28
+
29
+ Part of the **[TokForge iOS · CoreML Image Models](https://huggingface.co/collections/darkmaniac7/tokforge-ios-coreml-image-models-6a38cca9b57803e6168ce232)** collection.
30
+
31
+ ## Files
32
+
33
+ | File | Size | Contents |
34
+ |------|------|----------|
35
+ | `Resources/` | ~913 MB | `TextEncoder.mlmodelc` / `Unet.mlmodelc` / `VAEDecoder.mlmodelc` / `VAEEncoder.mlmodelc` + `vocab.json` + `merges.txt` |
36
+
37
+ The `Resources/` tree holds the compiled `.mlmodelc` models plus the CLIP `vocab.json` +
38
+ `merges.txt` — the exact layout Apples `StableDiffusionPipeline` (and the TokForge installer)
39
+ loads.
40
+
41
+ ## Recommended render settings
42
+
43
+ ```
44
+ attention: split_einsum_v2 (Apple Neural Engine)
45
+ compute: .cpuAndNeuralEngine (palettized -> fast ANE compile)
46
+ steps: 25-30 (CyberRealistic photoreal sweet spot)
47
+ cfg-scale: 7.0
48
+ resolution: 512x512 (SD-1.5 native; baked into the compiled model)
49
+ ```
50
+
51
+ ## How this was built
52
+
53
+ 1. Loaded `CyberRealistic_V9_FP16.safetensors` from `cyberdelia/CyberRealistic` via diffusers
54
+ `StableDiffusionPipeline.from_single_file` and re-exported to SD-1.5 diffusers format.
55
+ 2. Converted UNet + text encoder + VAE decoder + VAE encoder to CoreML with Apple
56
+ `ml-stable-diffusion` `python_coreml_stable_diffusion.torch2coreml`,
57
+ `--attention-implementation SPLIT_EINSUM_V2`.
58
+ 3. Applied **6-bit palettization** (`--quantize-nbits 6`).
59
+ 4. Bundled the compiled resources for the Swift CLI (`--bundle-resources-for-swift-cli`).
60
+
61
+ Conversion peaked at ~10.5 GB RAM (no `--chunk-unet` needed). Runs on iOS **17+** (6-bit
62
+ palettized weights require the iOS-17 ANE runtime); on iOS-16 the app falls back to an FP16 model.
63
+
64
+ ## License & attribution
65
+
66
+ - **License:** [CreativeML OpenRAIL-M](https://huggingface.co/spaces/CompVis/stable-diffusion-license),
67
+ inherited from CyberRealistic / Stable Diffusion 1.5. Use is subject to the OpenRAIL-M restrictions.
68
+ - **Base model:** **CyberRealistic V9** by **cyberdelia** —
69
+ https://huggingface.co/cyberdelia/CyberRealistic. All credit for the model weights is cyberdelias.
70
+ - **Conversion tooling:** Apple **`ml-stable-diffusion`** —
71
+ https://github.com/apple/ml-stable-diffusion (6-bit palettization, `SPLIT_EINSUM_V2` attention).
72
+ - Built on top of Stable Diffusion 1.5 (Runway/CompVis/Stability).
73
+
74
+ This repository is a **redistribution for on-device use** — a format conversion (PyTorch ->
75
+ CoreML) and 6-bit palettization of cyberdelias CyberRealistic V9. No weights were retrained.
76
+ The original OpenRAIL-M terms and attribution requirements propagate to this conversion and any
77
+ images generated with it. No additional restrictions are imposed by this repackaging.