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.6

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.6
File Size Uploaded
termux_diffusion-1.6.6.tar.gz 69.5 kB Details

Built distribution (wheel)

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

Total release size: 134.5 kB

Release files / termux_diffusion-1.6.6.tar.gz

Download URL termux_diffusion-1.6.6.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce68b7dc698fd43c7e67993dd63ab4129dccd6e483580a3b5bfca7eb912edde5
BLAKE2b-256 checksum
How to use checksums
80a92892cdff8f144cb42ee3baced50289863653a5b6065b9041f6a61d1bfcdd
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.6-py3-none-any.whl

Download URL termux_diffusion-1.6.6-py3-none-any.whl
Size 65.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3a29098b5bd6df4cbec1de800a5a21ff5ad59851ae021e0aeac7494e88f3092
BLAKE2b-256 checksum
How to use checksums
bb06dc6ce93649570219ab5d4d602e6774961e66487e969bae1388cb1dc93242
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

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

This release

1.6.6 This release

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