| --- |
| library_name: coreml |
| pipeline_tag: image-to-image |
| base_model: neonforestmist/Clover-Image-Tiny-Inpaint |
| license: creativeml-openrail-m |
| tags: |
| - coreml |
| - ios |
| - inpainting |
| - stable-diffusion |
| --- |
| |
| # Clover Image Tiny Inpaint — Core ML |
|
|
| The production Core ML conversion of |
| [`neonforestmist/Clover-Image-Tiny-Inpaint`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint) |
| for fully local 512 × 512 inpainting on iPhone and iPad. It uses the same |
| trained nine-channel inpainting checkpoint as the Diffusers release; Core ML |
| changes the execution format, not the learned weights. |
|
|
| Use this model with |
| [`neonforestmist/Clover-Image-Tiny-iOS`](https://github.com/neonforestmist/Clover-Image-Tiny-iOS). |
| The app downloads, verifies, and installs the resources automatically. |
|
|
| ## Recommended release |
|
|
| The production entry point is [`manifest-pipeline.json`](manifest-pipeline.json). |
| It describes a **1.79 GB**, two-stage FP16 Core ML pipeline for iOS 18 or newer. |
| Core ML owns the handoff between the stages, which reduces the lifetime of |
| large intermediate tensors without changing the U-Net calculation. |
|
|
| | Resource | Purpose | Size | |
| |---|---|---:| |
| | `pipeline-v1/UnetPipeline.mlmodelc` | Full nine-channel FP16 inpainting U-Net | 1.72 GB | |
| | `VAEEncoder.mlmodelc` | Encodes the masked source image | 68.5 MB | |
| | `manifest-pipeline.json` | Pinned paths, sizes, and SHA-256 checksums | — | |
|
|
| The separate Clover installation is still required. Its approximately |
| **994.9 MB** runtime provides the tokenizer, text encoder, and VAE decoder, so |
| this repository does not download duplicate copies of those components. |
|
|
| The repository also retains compressed and stateful research artifacts for |
| comparison. The shipping iOS app uses `manifest-pipeline.json`, not the older |
| `manifest.json` entry point. |
|
|
| ## Runtime contract |
|
|
| - Minimum OS: iOS 18 |
| - Resolution: 512 × 512 |
| - U-Net sample input: Float16 `[1, 9, 64, 64]` |
| - Timestep input: Float16 `[1]` |
| - Text input: Float16 `[1, 768, 1, 77]` |
| - Noise prediction output: Float32 `[1, 4, 64, 64]` |
| - Channels: noisy latent (4) + mask (1) + masked-image latent (4) |
| - Mask semantics: white regenerates, black preserves |
| - Recommended scheduler: DPM-Solver++ multistep |
| - Recommended settings: 20 steps, guidance scale 6.0 |
|
|
| The selected source region is replaced by neutral gray before VAE encoding, |
| which becomes zero after normalization to `[-1, 1]`. For a small mask, the iOS |
| runtime uses a focused 512 × 512 crop with surrounding source context and then |
| composites the result through the exact user mask. Pixels outside the mask are |
| copied directly from the source image. |
|
|
| ## LoRA compatibility |
|
|
| LoRAs made for the regular Clover Create model target its four-channel U-Net |
| and cannot be applied directly to this nine-channel inpainting U-Net. To ship |
| an inpainting style, train or adapt it for the inpainting checkpoint and fuse |
| it before Core ML conversion. |
|
|
| ## Validation |
|
|
| The production bundle is checked in three ways: |
|
|
| - every file is verified against the byte count and SHA-256 in the schema-v3 manifest; |
| - the compiled pipeline passes a native macOS Core ML prediction smoke test with finite output and the expected tensor shape; |
| - the complete app flow was exercised on a physical iPhone 15 running iOS 26.6 using a 30-step masked edit. |
|
|
| The physical-device run completed successfully in about 73 seconds in the |
| XCTest/debug validation environment. That timing is a release smoke test, not |
| a formal performance benchmark; first-run Core ML compilation and device |
| thermal state can materially change latency. |
|
|
| ## Citation |
|
|
| ```bibtex |
| @software{lozadaperez2026cloverimagetinyinpaintcoreml, |
| author = {Lukas Lozada Perez}, |
| title = {Clover Image Tiny Inpaint Core ML}, |
| year = {2026}, |
| url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML} |
| } |
| ``` |
|
|
| Designed and developed independently by Lukas Lozada Perez. Model weights are |
| available under the CreativeML Open RAIL-M license. Inference runs completely |
| on device after installation. |
|
|