ONNX Model Zoo

Xlbully/staticplay-sd1-mobile-v2

By Xlbully · ↓ 0 · ♥ 0 · Updated 2026-02-12

What's in this repo

This page lists the files in Xlbully/staticplay-sd1-mobile-v2, including identity.onnx and more.

  • 2 ONNX models (.onnx files)
  • 77 files, including 15 .webp, 11 .xml, 9 .png, 5 .md, 5 .json, 5 .sh
  • Last updated 2026-02-12

ONNX files

File Size Download
android/app/src/main/assets/models/identity.onnx — Download
assets/models/identity.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

# Staticplay SD1 Mobile (On-Device, Android)

Goal: ship a real offline Android app (no servers, no cloud) that runs an SD1-class model on-device using NNAPI (via a native runtime).

This repo currently includes a working offline SD1.5 ONNX "pack" runner (unzip + inspect + generate).

Key points (no surprises)

  • Use a prebuild / native build (Expo Go won't cut it for native inference).
  • "Offline" means the model files are on the phone (bundled in the APK or copied into app storage).
  • ONNX Runtime is integrated via a tiny Android native module (no JSI auto-install).

Run (Android)

cd /home/tiny/projects/staticplay-sd1-mobile
export ANDROID_HOME=/home/tiny/Android/sdk
export PATH="$ANDROID_HOME/platform-tools:$PATH"
npx expo prebuild --clean
npx expo run:android   # debug (uses Metro)

For a fully offline build (no Metro), install the release build:

cd /home/tiny/projects/staticplay-sd1-mobile/android
NODE_ENV=production ./gradlew :app:installRelease

Then press "Test native ONNX (NNAPI -> CPU)" in the app.

Bundle With Expo (Windows, release APK)

Use these commands from this project root.

# 1) Install dependencies (once)
npm install

# 2) Regenerate native Android project if config/plugins changed
npx expo prebuild --platform android --clean

# 3) Build release APK
cd android
./gradlew.bat :app:assembleRelease

# 4) Install to connected phone (USB debugging on)
./gradlew.bat :app:installRelease

APK output path:

android/app/build/outputs/apk/release/app-release.apk

Notes:

  • This v2 build uses package id com.anonymous.staticplaysd1mobile.v2, so v1 can stay installed.
  • Some setup buttons can take longer than expected (especially inspect actions).
  • Generation works offline but is still being optimized for speed.
  • Website: https://staticplay.co.uk

SD1.5 pack + generation (offline)

  1. Put the SD1.5 ONNX pack zip at the app external directory as:

/storage/emulated/0/Android/data/com.anonymous.staticplaysd1mobile/files/sd15-onnx-pack.zip

  1. In the app:

    • (Optional) Show app external pack path (for sanity check)
    • Unzip SD15 pack from external (one-time; can take minutes)
    • Load tokenizer (bundled) (no external files required)
    • Toggle backend:
      • Backend: NNAPI (experimental) = fastest, can be unstable on some devices/drivers
      • Backend: CPU (safe) = slower, but avoids NNAPI driver issues
    • Generate 512x512 (quick 4) to prove the end-to-end pipeline
    • Generate 512x512 (quality 20) for higher quality (slower)
  2. Output images save to the same app external folder as sd_out_*.png.

SD1 plan (high level)

  1. Pick an SD1 distilled variant (LCM/Turbo-style) to keep steps ~4-8.
  2. Export components to ONNX (text encoder, UNet, VAE decoder).
  3. Quantize mostly UNet (INT8) + keep VAE in FP16/BF16.
  4. Run inference via a native runtime with NNAPI; fall back to CPU if NNAPI can't compile a node.
  5. Ship the ONNX files in-app (or as offline downloadable packs).

V2 notes (2026-02-12)

  • This branch installs as a separate app id (com.anonymous.staticplaysd1mobile.v2) so v1 stays on device.
  • Guided mode is enabled to show one button at a time for easier setup flow.
  • Some actions can take longer than expected, especially:
    • Inspect pack UNet
    • Inspect pack text_encoder
    • Inspect pack vae_decoder
    • first unzip/generation after launch
  • Overall generation is currently functional but still slower than target. Ongoing work is focused on speed improvements.
  • Public site: https://staticplay.co.uk

Model info

onnx region:us
↓ 0 ♥ 0

Created: 2026-02-12

Updated: 2026-02-12

View on Hugging Face

Files (77)

.gitignore
App.tsx
README.md
android/.gitignore
android/app/build.gradle
android/app/debug.keystore
android/app/proguard-rules.pro
android/app/src/debug/AndroidManifest.xml
android/app/src/debugOptimized/AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
android/app/src/main/assets/models/identity.onnx ONNX
android/app/src/main/java/com/anonymous/staticplaysd1mobile/MainActivity.kt
android/app/src/main/java/com/anonymous/staticplaysd1mobile/MainApplication.kt
android/app/src/main/java/com/anonymous/staticplaysd1mobile/ort/OrtModule.kt
android/app/src/main/java/com/anonymous/staticplaysd1mobile/ort/OrtPackage.kt
android/app/src/main/res/drawable-hdpi/splashscreen_logo.png
android/app/src/main/res/drawable-mdpi/splashscreen_logo.png
android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png
android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png
android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png
android/app/src/main/res/drawable/ic_launcher_background.xml
android/app/src/main/res/drawable/rn_edit_text_material.xml
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
android/app/src/main/res/mipmap-hdpi/ic_launcher.webp
android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
android/app/src/main/res/mipmap-mdpi/ic_launcher.webp
android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
android/app/src/main/res/values-night/colors.xml
android/app/src/main/res/values/colors.xml
android/app/src/main/res/values/strings.xml
android/app/src/main/res/values/styles.xml
android/build.gradle
android/gradle.properties
android/gradle/wrapper/gradle-wrapper.jar
android/gradle/wrapper/gradle-wrapper.properties
android/gradlew
android/gradlew.bat
android/settings.gradle
app.json
assets/adaptive-icon.png
assets/favicon.png
assets/icon.png
assets/models/identity.onnx ONNX
assets/splash-icon.png
assets/tokenizer/merges.txt
assets/tokenizer/vocab.json
assets/tokenizer/vocab.json.txt
clipTokenizer.ts
docs/SD15_ONNX_PACK.md
docs/SD1_ON_DEVICE_PLAN.md
docs/V2_USAGE_NOTES.md
index.ts
metro.config.js
package-lock.json
package.json
plugins/with-ort-native.js
tools/gen_identity_onnx.py
tools/sd1/README.md
tools/sd1/download_sd15.sh
tools/sd1/export_sd15_to_onnx.py
tools/sd1/make_sd15_pack_zip.sh
tools/sd1/push_sd15_pack_to_phone.sh
tools/sd1/push_tokenizer_to_phone.sh
tools/sd1/setup_venv.sh
tsconfig.json

Related models