--- license: creativeml-openrail-m tags: - text-to-image - stable-diffusion - realistic-vision - coreml - apple-neural-engine - palettized - tokforge base_model: - SG161222/Realistic_Vision_V5.1_noVAE pipeline_tag: text-to-image library_name: ml-stable-diffusion --- ## TokForge - **Website:** https://tokforge.ai - **Discord:** https://discord.gg/Acv3CBtfVm - **Google Play:** https://play.google.com/store/apps/details?id=dev.tokforge - **iOS TestFlight:** https://testflight.apple.com/join/jnufjzRr Runs on-device in the TokForge app. # TokForge — Realistic Vision 5.1 · CoreML 6-bit (Apple Neural Engine) A **6-bit palettized Apple CoreML** conversion of **[Realistic Vision V5.1](https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE)** (SG161222, SD-1.5 photoreal finetune), built for on-device image generation in the **[TokForge](https://tokforge.ai)** iOS app. Converted with Apple **[`ml-stable-diffusion`](https://github.com/apple/ml-stable-diffusion)** (`torch2coreml`) using **`SPLIT_EINSUM_V2`** attention and **`--quantize-nbits 6`** — 6-bit palettized weights compile **fast on the Apple Neural Engine** (the ANE-fast photoreal path, vs the FP16 finetunes >11-min ANE graph compile). Part of the **[TokForge iOS · CoreML Image Models](https://huggingface.co/collections/darkmaniac7/tokforge-ios-coreml-image-models-6a38cca9b57803e6168ce232)** collection. ## Files | File | Size | Contents | |------|------|----------| | `RealisticVision-5.1_palettized_split_einsum_v2_compiled.zip` | ~874 MB | The compiled Swift-CLI resource bundle (a single ZIP of `Resources/`) | | `Resources/` | ~913 MB | `TextEncoder.mlmodelc` / `Unet.mlmodelc` / `VAEDecoder.mlmodelc` / `VAEEncoder.mlmodelc` + `vocab.json` + `merges.txt` | ## Recommended render settings (standard SD-1.5, photoreal) ``` attention: split_einsum_v2 (Apple Neural Engine) compute: .cpuAndNeuralEngine (palettized -> fast ANE compile) steps: 20 (8 = fast floor, 40 = extra refinement) cfg-scale: 7.5 resolution: 512x512 (SD-1.5 native; baked into the compiled model) ``` ## How this was built 1. Loaded `SG161222/Realistic_Vision_V5.1_noVAE` (SD-1.5 diffusers; the diffusers conversion bundles a working VAE). 2. Converted UNet + text encoder + VAE decoder + VAE encoder to CoreML with Apple `ml-stable-diffusion` `python_coreml_stable_diffusion.torch2coreml`, `--attention-implementation SPLIT_EINSUM_V2`. 3. Applied **6-bit palettization** (`--quantize-nbits 6`) for the fast iOS-17 ANE compile. 4. Bundled the compiled resources for the Swift CLI (`--bundle-resources-for-swift-cli`). Conversion peaked at ~10.9 GB RAM (no `--chunk-unet` needed); iOS **17+** (6-bit palettized). ## License & attribution - **License:** [CreativeML OpenRAIL-M](https://huggingface.co/spaces/CompVis/stable-diffusion-license) (inherited from Realistic Vision V5.1 / Stable Diffusion 1.5). Subject to OpenRAIL-M restrictions. - **Base model:** **Realistic Vision V5.1** by **SG161222** — https://huggingface.co/SG161222/Realistic_Vision_V5.1_noVAE (an SD-1.5 finetune). All credit for the model weights is SG161222s. - **Conversion tooling:** Apple **`ml-stable-diffusion`** — https://github.com/apple/ml-stable-diffusion (6-bit palettization, `SPLIT_EINSUM_V2`). - Built on top of Stable Diffusion 1.5 (Runway/CompVis/Stability). This repository is a **redistribution for on-device use** — a format conversion (PyTorch -> CoreML) and 6-bit palettization of SG161222s Realistic Vision V5.1. No weights were retrained. The original OpenRAIL-M terms and attribution requirements propagate to this conversion and any images generated with it. No additional restrictions are imposed by this repackaging.