mlboydaisuke/Nitro-E-CoreML
019
1---2license: other3license_name: mit-and-llama3.2-community4license_link: https://huggingface.co/amd/Nitro-E5library_name: coreml6pipeline_tag: text-to-image7base_model: amd/Nitro-E8base_model_relation: quantized9tags:10 - coreml11 - core-ml12 - ios13 - macos14 - apple15 - on-device16 - text-to-image17 - diffusion18 - mmdit19 - few-step20---21 22# Nitro-E (4-Step) — Core ML23 24*AMD, 2025*25 26AMD'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<p><img src="https://huggingface.co/mlboydaisuke/Nitro-E-CoreML/resolve/main/media/595b2fd081.png" alt="Nitro-E (4-Step) demo"></p>29 30Core 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.31 32| | |33|---|---|34| Task | text to image |35| Upstream | [amd/Nitro-E](https://huggingface.co/amd/Nitro-E) |36| Packages | 3 |37| Download size | 987 MB |38| Minimum iOS | 18.0 |39| Peak RAM | ~2500 MB |40 41## Files42 43| File | Size | Compute units | SHA-256 |44|---|---:|---|---|45| `NitroE_TextEncoder.mlpackage.zip` | 545 MB | `cpuAndNeuralEngine` | `9b366b29d790ab98…` |46| `NitroE_EMMDiT.mlpackage.zip` | 283 MB | `cpuAndNeuralEngine` | `93a7ed971c5c419d…` |47| `NitroE_VAEDecoder.mlpackage.zip` | 153 MB | `cpuAndNeuralEngine` | `4837023736d82b49…` |48| `Llama3Vocab.json` | 2 MB | `-` | `f8f40517934d6f5d…` |49| `Llama3Merges.txt` | 3 MB | `-` | `0cd100e0ab7dbd83…` |50| **Total** | **987 MB** | | |51 52`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.53 54## Download55 56```bash57hf download mlboydaisuke/coreml-zoo --include "nitroe/*" --local-dir ./nitroe58unzip './nitroe/nitroe/*.zip' -d ./nitroe59```60 61## Use in Swift62 63```swift64import CoreML65 66let config = MLModelConfiguration()67config.computeUnits = .cpuAndNeuralEngine // as converted — see the table above68 69// Unzip the .mlpackage, drop it into your Xcode target and Xcode compiles it70// at build time:71let model = try NitroE_TextEncoder(configuration: config)72 73// ...or compile a downloaded .mlpackage at runtime:74let compiled = try await MLModel.compileModel(at: mlpackageURL)75let model = try MLModel(contentsOf: compiled, configuration: config)76```77 78> 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.79 80## Demo81 82- **Sample app** — [`sample_apps/NitroEDemo`](https://github.com/john-rocky/CoreML-Models/tree/master/sample_apps/NitroEDemo), a standalone SwiftUI project.83- **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.84 85## Conversion86 87- Script: [`convert_nitro_e_emmdit.py`](https://github.com/john-rocky/CoreML-Models/blob/master/conversion_scripts/convert_nitro_e_emmdit.py)88- 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)89- Model index: [CoreML-Models](https://github.com/john-rocky/CoreML-Models)90 91## License92 93The conversion inherits the upstream license: **MIT (Nitro-E) + Llama 3.2 Community License (text encoder)**.94See [https://huggingface.co/amd/Nitro-E](https://huggingface.co/amd/Nitro-E).95 96> Nitro-E itself is MIT; the bundled text encoder is Llama 3.2 and carries the Llama 3.2 Community License.97 98## Credits99 100- Upstream authors: [amd/Nitro-E](https://huggingface.co/amd/Nitro-E), 2025101- Core ML conversion: john-rocky (Daisuke Majima)102 103<!-- funnel:v1 -->104 105---106 107**More models in this format:** [Core ML Model Zoo](https://huggingface.co/collections/mlboydaisuke/core-ml-model-zoo-6a7078dc888e7b13efd35631) — 46 models, each with the recipe that produced it.108 109**Want a different model on-device?** [Open a request](https://github.com/john-rocky/on-device-requests) — free, open weights only; the export and its measured numbers get published publicly.110 111<!-- /funnel:v1 -->112 