Skip to main content

Termux-Diffusion (Python)

PyPI Python License

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/TermuxDiffusion and 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.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for termux-diffusion 1.6.9
File Size Uploaded
termux_diffusion-1.6.9.tar.gz 69.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for termux-diffusion 1.6.9
File Interpreter ABI Platform
termux_diffusion-1.6.9-py3-none-any.whl Python 3 none any Details

Total release size: 134.6 kB

Release files / termux_diffusion-1.6.9.tar.gz

Download URL termux_diffusion-1.6.9.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f1ee199da6b09fc51dcbc169ea39a4af0e2a8afbd481e51273ed713e4f5de4a7
BLAKE2b-256 checksum
How to use checksums
4de1ebc451450d03f314a1c35de64d954ecf85ddc679c85f5c3ce9e1a7b12671
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.9-py3-none-any.whl

Download URL termux_diffusion-1.6.9-py3-none-any.whl
Size 65.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3df0ab75a06ecc30150cd5d48e0fec53a8b737ef198add5f23b171de10a3c03
BLAKE2b-256 checksum
How to use checksums
1cbf7f72ad515422e1bff8ce6c5e70f64b90268235f0cea3f5fa46fa8e09d4d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

2.0.1

2 release files

2.0.0

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.0

2 release files

This release

1.6.9 This release

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.5

2 release files

1.4.3

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

1 release file

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page