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

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

Built distribution (wheel)

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

Total release size: 134.5 kB

Release files / termux_diffusion-1.6.8.tar.gz

Download URL termux_diffusion-1.6.8.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e10b2665dcf8d1b3ede6803395f2ee4ef0b55edd6d2ec10f4b5308856b978ea8
BLAKE2b-256 checksum
How to use checksums
688e5605d79c2f43d2993ef8657d3b5071f80b96b72647355ea6feea18e1bda9
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.8-py3-none-any.whl

Download URL termux_diffusion-1.6.8-py3-none-any.whl
Size 65.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ddce96499a80e582ed92c107edae16c4656f66d12cad052223026a4f947e711
BLAKE2b-256 checksum
How to use checksums
94c11f36668a251796c4167f40e6ce5ff5a3f25a1b3b464801614abd4146894c
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

This release

1.6.8 This release

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