Stable Diffusion v1.5 for LiteRT NPUs (experimental)

LiteRT conversions of stable-diffusion-v1-5/stable-diffusion-v1-5 (v1-5-pruned-emaonly.safetensors, SHA-256 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa) for LLM Hub.

Status: experimental. These files have been compiled but not yet validated or benchmarked on a device. They need a non-Samsung MediaTek phone: Samsung's MediaTek firmware (e.g. Galaxy Tab S11) does not start MediaTek's NeuroPilot service for apps, so compiled NPU models cannot load there.

Files

Path Model Precision Target
mt6991/diffusion.tflite UNet, batch 2 (classifier-free guidance), 512×512 FP16 MediaTek Dimensity 9400 (MT6991), AOT-compiled
mt6991/decoder.tflite VAE decoder, 512×512 FP16 MT6991, AOT-compiled
mt6991/clip.tflite CLIP text encoder INT8 weights MT6991, AOT-compiled
mt6993/diffusion.tflite UNet FP16 MediaTek Dimensity 9500 (MT6993), AOT-compiled
mt6993/decoder.tflite VAE decoder FP16 MT6993, AOT-compiled
tensor_g5/diffusion.tflite, decoder.tflite, clip.tflite UNet, VAE decoder, CLIP text encoder FP16, FP16, INT8 weights Google Tensor G5 (Pixel 10), AOT-compiled with the Google Tensor SDK beta; every operator runs on the TPU
tensor_g6/diffusion.tflite, decoder.tflite, clip.tflite UNet, VAE decoder, CLIP text encoder FP16, FP16, INT8 weights Google Tensor G6 (Pixel 11), AOT-compiled with the Google Tensor SDK beta; every operator runs on the TPU
source/*.tflite Uncompiled models as above Any LiteRT NPU with on-device compilation, or CPU/GPU
tokenizer/vocab.json, tokenizer/merges.txt CLIP BPE tokenizer of Stable Diffusion v1.5 All builds

The INT8 CLIP encoder did not compile for MT6993 (Failed to identify model I/Os); use source/clip.tflite there. The public compiler rejects MT6886 (Dimensity 7200) as Not a valid platform.

Inputs

  • diffusion: latents [2, 4, 64, 64], context [2, 77, 768], time embedding [1, 320].
  • decode: latents [1, 4, 64, 64]; the model applies the SD1.5 latent scale factor (0.18215) itself.
  • encode (CLIP): token IDs [1, 77] (int32).

How these were built

  • litert-torch 0.9.4 Stable Diffusion example models, converted with the FP16 recipe. The example's INT8 recipe fails on the UNet (ai-edge-quantizer #472).
  • GroupNorm replaced by a [N*G, C/G, H, W] mean/variance form. The default lowering uses GATHER_ND, which left the UNet split into 184 NPU partitions; flattening each group into one axis exceeds MediaTek MDLA's 65535-element dimension limit. With the 4-D form the UNet and decoder each compile to a single NPU graph for MT6991 and MT6993.
  • Google Tensor builds: ai-edge-litert-sdk-google-tensor 2.3.0 with the Tensor SDK beta compiler; one partition per model.
  • AOT compilation with ai-edge-litert 2.3.0 and ai-edge-litert-sdk-mediatek 2.3.0. Public MediaTek AOT builds may be less optimized than Google's own (LiteRT #6462); compare with on-device compilation of source/.

License

The weights are derived from Stable Diffusion v1.5 and are distributed under the CreativeML OpenRAIL-M license, including its use-based restrictions, which apply to anyone using these files.

Downloads last month
229
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for timmyboy26/stable-diffusion-v1-5-LiteRT-NPU

Finetuned
(427)
this model