Termux-Diffusion (Python)
Pure CPU Native On-Device Stable Diffusion Runtime for Android Termux & Samsung Galaxy.
Zero PRoot. Zero Virtualization. 100% Native ARM64 Bionic libc & NEON SIMD Vector Acceleration.
Installation & Native Engine Provisioning
# 1. Install Python package from PyPI
pip install termux-diffusion
# 2. Provision prebuilt Pure CPU native engine & OpenMP runtime
termux-diffusion install
Quickstart (Python SDK)
import termux_diffusion as td
# Generate image using pure CPU with LCM anime preset
image_path = td.generate(
prompt="cute polar bear in snow, high quality illustration",
model="anime",
steps=6,
device="cpu",
output_path="polar_bear.png"
)
print(f"Generated and saved to Android Gallery: {image_path}")
CLI Usage
termux-diffusion generate "cute dolphin, vibrant ocean" -m anime --cpu -o dolphin.png
Key Capabilities
- ARMv8.2-A DotProd & FP16 NEON SIMD: Native matrix acceleration compiled directly against Android Bionic libc.
- Built-in VAE Tiling: Reduces peak RAM consumption by ~70% during latent-to-pixel decoding to prevent Out-Of-Memory (OOM) aborts.
- Android MediaStore Auto-Indexing: Automatically synchronizes generated images into
Pictures/TermuxDiffusionand the native Samsung Gallery. - Fail-Fast Protection: Blocks unintended on-device compilation cycles to protect mobile devices from severe thermal throttling.
Hardware Benchmarks (Physical Android Devices)
| Device | AP / Architecture | Wall Time | Sampling Time | Peak RAM |
|---|---|---|---|---|
| Galaxy S25 | Snapdragon 8 Elite | 15m 52s (951s) | 11m 37s (697s) | ~2.5 GB |
| Galaxy S21 | Exynos 2100 | 53m 45s (3221s) | 7m 47s (467s) | ~2.4 GB |
Documentation & Repository
License
Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).
Metadata
Release files for termux-diffusion 1.6.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| termux_diffusion-1.6.7.tar.gz | 69.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| termux_diffusion-1.6.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.5 kB
Release files / termux_diffusion-1.6.7.tar.gz
| Download URL | termux_diffusion-1.6.7.tar.gz |
|---|---|
| Size | 69.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b8cc0a8a9d9d92791b0d6b0c4d5e5d35fa885b66876ddd15c3082042680b7e1
|
|
BLAKE2b-256 checksum How to use checksums |
1cba71748514a7a8f6996612f7b31bc8679bdf31561d041aee23e3409f51eb96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / termux_diffusion-1.6.7-py3-none-any.whl
| Download URL | termux_diffusion-1.6.7-py3-none-any.whl |
|---|---|
| Size | 65.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58422bad8743812fd084c1317c763f800d7295eb6d0e8ee3c4c3fde90459d0c0
|
|
BLAKE2b-256 checksum How to use checksums |
dcd3cca31d3d938ff5207494c08fb356d647950ee7ddc1720daf59ddb4414ac8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|