mlboydaisuke commited on
Commit
61c9a26
·
verified ·
1 Parent(s): e061448

Add model card

Browse files
Files changed (1) hide show
  1. README.md +99 -0
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: mit-and-llama3.2-community
4
+ license_link: https://huggingface.co/amd/Nitro-E
5
+ library_name: coreml
6
+ pipeline_tag: text-to-image
7
+ base_model: amd/Nitro-E
8
+ base_model_relation: quantized
9
+ tags:
10
+ - coreml
11
+ - core-ml
12
+ - ios
13
+ - macos
14
+ - apple
15
+ - on-device
16
+ - text-to-image
17
+ - diffusion
18
+ - mmdit
19
+ - few-step
20
+ ---
21
+
22
+ # Nitro-E (4-Step) — Core ML
23
+
24
+ *AMD, 2025*
25
+
26
+ AMD's 304M E-MMDiT text-to-image model (Oct 2025). 4-step distilled variant, 512×512. Llama 3.2 1B text encoder + E-MMDiT denoiser + DC-AE VAE decoder. ~1.04 GB bundled after INT4/INT8 palettization. ~2–3 s / image on iPhone 15+.
27
+
28
+ Core ML conversion of [amd/Nitro-E](https://huggingface.co/amd/Nitro-E) for on-device inference on iPhone, iPad and Mac. Converted with `coremltools`; the packages are stateless, so all sequencing and buffering lives in your Swift code.
29
+
30
+ | | |
31
+ |---|---|
32
+ | Task | text to image |
33
+ | Upstream | [amd/Nitro-E](https://huggingface.co/amd/Nitro-E) |
34
+ | Packages | 3 |
35
+ | Download size | 987 MB |
36
+ | Minimum iOS | 18.0 |
37
+ | Peak RAM | ~2500 MB |
38
+
39
+ ## Files
40
+
41
+ | File | Size | Compute units | SHA-256 |
42
+ |---|---:|---|---|
43
+ | `NitroE_TextEncoder.mlpackage.zip` | 545 MB | `cpuAndNeuralEngine` | `9b366b29d790ab98…` |
44
+ | `NitroE_EMMDiT.mlpackage.zip` | 283 MB | `cpuAndNeuralEngine` | `93a7ed971c5c419d…` |
45
+ | `NitroE_VAEDecoder.mlpackage.zip` | 153 MB | `cpuAndNeuralEngine` | `4837023736d82b49…` |
46
+ | `Llama3Vocab.json` | 2 MB | `-` | `f8f40517934d6f5d…` |
47
+ | `Llama3Merges.txt` | 3 MB | `-` | `0cd100e0ab7dbd83…` |
48
+ | **Total** | **987 MB** | | |
49
+
50
+ `compute_units` is not a suggestion -- it is the configuration the conversion was verified against. Moving a package to a different compute unit can silently change the numerics (FP16 attention overflow) or crash on the GPU.
51
+
52
+ ## Download
53
+
54
+ ```bash
55
+ hf download mlboydaisuke/coreml-zoo --include "nitroe/*" --local-dir ./nitroe
56
+ unzip './nitroe/nitroe/*.zip' -d ./nitroe
57
+ ```
58
+
59
+ ## Use in Swift
60
+
61
+ ```swift
62
+ import CoreML
63
+
64
+ let config = MLModelConfiguration()
65
+ config.computeUnits = .cpuAndNeuralEngine // as converted — see the table above
66
+
67
+ // Unzip the .mlpackage, drop it into your Xcode target and Xcode compiles it
68
+ // at build time:
69
+ let model = try NitroE_TextEncoder(configuration: config)
70
+
71
+ // ...or compile a downloaded .mlpackage at runtime:
72
+ let compiled = try await MLModel.compileModel(at: mlpackageURL)
73
+ let model = try MLModel(contentsOf: compiled, configuration: config)
74
+ ```
75
+
76
+ > This model is split into 3 Core ML packages that are driven in sequence from Swift. Load them one at a time, copy the outputs out of the `MLMultiArray` buffers and release each model before loading the next — two large Core ML models resident at once will OOM on an iPhone.
77
+
78
+ ## Demo
79
+
80
+ - **Sample app** — [`sample_apps/NitroEDemo`](https://github.com/john-rocky/CoreML-Models/tree/master/sample_apps/NitroEDemo), a standalone SwiftUI project.
81
+ - **Models Zoo** — this model is downloadable and runnable inside the [Models Zoo app](https://apps.apple.com/app/id6762083207) on the App Store, no build required.
82
+
83
+ ## Conversion
84
+
85
+ - Script: [`convert_nitro_e_emmdit.py`](https://github.com/john-rocky/CoreML-Models/blob/master/conversion_scripts/convert_nitro_e_emmdit.py)
86
+ - Pitfalls hit during conversion (FP16 overflow, ANE buffer limits, stride handling): [`docs/coreml_conversion_notes.md`](https://github.com/john-rocky/CoreML-Models/blob/master/docs/coreml_conversion_notes.md)
87
+ - Model index: [CoreML-Models](https://github.com/john-rocky/CoreML-Models)
88
+
89
+ ## License
90
+
91
+ The conversion inherits the upstream license: **MIT (Nitro-E) + Llama 3.2 Community License (text encoder)**.
92
+ See [https://huggingface.co/amd/Nitro-E](https://huggingface.co/amd/Nitro-E).
93
+
94
+ > Nitro-E itself is MIT; the bundled text encoder is Llama 3.2 and carries the Llama 3.2 Community License.
95
+
96
+ ## Credits
97
+
98
+ - Upstream authors: [amd/Nitro-E](https://huggingface.co/amd/Nitro-E), 2025
99
+ - Core ML conversion: john-rocky (Daisuke Majima)