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

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

Built distribution (wheel)

Table of built distributions (wheels) for termux-diffusion 1.6.7
File Interpreter ABI Platform
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

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

This release

1.6.7 This release

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