amv-diffusion 2.1.0__tar.gz → 3.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amv_diffusion-3.0.1/MANIFEST.in +2 -0
- {amv_diffusion-2.1.0/amv_diffusion.egg-info → amv_diffusion-3.0.1}/PKG-INFO +180 -180
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/README.md +5 -5
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/README.pypi.md +139 -139
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/__init__.py +185 -185
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/__main__.py +7 -7
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/_version.py +1 -1
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/adapter.py +41 -41
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/canvas.py +2 -2
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/cli.py +492 -492
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/cluster.py +340 -340
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/control/__init__.py +5 -5
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/control/component.py +309 -309
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/control/status.py +15 -15
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/core.py +2936 -2936
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/data/bootstrap-manifest.json +15 -15
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/data/release-public-keys.json +9 -9
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/data/validated-vulkan-profiles.json +297 -297
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/detailer.py +283 -283
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/doctor.py +128 -128
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/downloader.py +111 -111
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/engine.py +226 -226
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/exceptions.py +158 -158
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/hardware.py +985 -985
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/hub.py +686 -686
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/installer.py +499 -499
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/locking.py +134 -134
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/manifest.py +128 -128
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/npu.py +267 -267
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/platform.py +533 -533
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/purger.py +1 -1
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/safety.py +1 -1
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/selftest.py +178 -178
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/web.py +3370 -3370
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/workflow.py +1345 -1345
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1/amv_diffusion.egg-info}/PKG-INFO +180 -180
- amv_diffusion-3.0.1/amv_diffusion.egg-info/SOURCES.txt +67 -0
- amv_diffusion-3.0.1/amv_diffusion.egg-info/entry_points.txt +7 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/amv_diffusion.egg-info/top_level.txt +1 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/pyproject.toml +8 -8
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/setup.cfg +4 -4
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/setup.py +11 -11
- amv_diffusion-3.0.1/termux_diffusion/__init__.py +55 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_canvas_studio.py +1 -1
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_core.py +554 -554
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_detailer.py +159 -159
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_doctor.py +15 -15
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_engine.py +100 -100
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_gpu_runtime_guard.py +92 -92
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_hardware.py +178 -178
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_hub.py +136 -136
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_installer.py +117 -117
- amv_diffusion-3.0.1/tests/test_legacy_import_alias.py +30 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_npu.py +109 -109
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_platform.py +53 -53
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_presets.py +130 -130
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_progress.py +205 -205
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_prompt_cache.py +118 -118
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_rpc.py +358 -358
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_safe_mode.py +99 -99
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_safety_and_purger.py +2 -2
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_vram_policy.py +122 -122
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_web.py +309 -309
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/tests/test_workflow.py +594 -594
- amv_diffusion-2.1.0/MANIFEST.in +0 -2
- amv_diffusion-2.1.0/amv_diffusion.egg-info/SOURCES.txt +0 -65
- amv_diffusion-2.1.0/amv_diffusion.egg-info/entry_points.txt +0 -7
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/LICENSE +0 -0
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/data/prompt_cache/108a7149c4e70550.json +0 -0
- {amv_diffusion-2.1.0/termux_diffusion → amv_diffusion-3.0.1/amv_diffusion}/py.typed +0 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/amv_diffusion.egg-info/dependency_links.txt +0 -0
- {amv_diffusion-2.1.0 → amv_diffusion-3.0.1}/amv_diffusion.egg-info/requires.txt +0 -0
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: amv-diffusion
|
|
3
|
-
Version:
|
|
4
|
-
Summary: AmfyUI (ComfyUI Mobile DAG Studio) & Z-Image Turbo (6.0B DiT) On-Device Diffusion Runtime for Android Termux
|
|
5
|
-
Home-page: https://github.com/uno-km/
|
|
6
|
-
Author: uno-km (AMEVA Foundation)
|
|
7
|
-
Author-email: "uno-km (AMEVA Foundation)" <zhfldk014745@naver.com>
|
|
8
|
-
License: Apache-2.0
|
|
9
|
-
Project-URL: Homepage, https://
|
|
10
|
-
Project-URL: Documentation, https://
|
|
11
|
-
Project-URL: npm Package, https://www.npmjs.com/package/amv-diffusion
|
|
12
|
-
Project-URL: Bug Tracker, https://github.com/uno-km/amv-diffusion/issues
|
|
13
|
-
Project-URL: Source, https://github.com/uno-km/amv-diffusion
|
|
14
|
-
Keywords: stable-diffusion,diffusion,termux,android,samsung-galaxy,edge-ai,on-device-ai,image-generation,text-to-image,gguf,arm64,aarch64,neon,simd,bionic-libc,vae-tiling,galaxy-s25,galaxy-s21
|
|
15
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
-
Classifier: Intended Audience :: Developers
|
|
17
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
-
Classifier: Operating System :: Android
|
|
20
|
-
Classifier: Programming Language :: Python :: 3
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
27
|
-
Classifier: Topic :: Multimedia :: Graphics
|
|
28
|
-
Requires-Python: >=3.8
|
|
29
|
-
Description-Content-Type: text/markdown
|
|
30
|
-
License-File: LICENSE
|
|
31
|
-
Provides-Extra: gpu
|
|
32
|
-
Requires-Dist: ameva-runtime>=2.0.0; extra == "gpu"
|
|
33
|
-
Provides-Extra: detailer
|
|
34
|
-
Requires-Dist: numpy>=1.20.0; extra == "detailer"
|
|
35
|
-
Requires-Dist: Pillow>=8.0.0; extra == "detailer"
|
|
36
|
-
Dynamic: author
|
|
37
|
-
Dynamic: classifier
|
|
38
|
-
Dynamic: home-page
|
|
39
|
-
Dynamic: license-file
|
|
40
|
-
Dynamic: requires-python
|
|
41
|
-
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
[](https://github.com/uno-km/
|
|
47
|
-
|
|
48
|
-
> **Official Z-Image Turbo (6.0B DiT) & Pure Native On-Device Diffusion Acceleration for Android Termux & Samsung Galaxy.**
|
|
49
|
-
> *Zero PRoot. Zero Virtualization. 100% Native ARM64 Bionic libc, Khronos Vulkan 1.1+ GPU Shaders & NEON SIMD Vector Engine.*
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## What's New in v2.1.0 — Mobile Canva Studio & SurfaceFlinger Shield
|
|
54
|
-
|
|
55
|
-
- Added Mobile Canva Studio Suite: Magic Eraser (magic_eraser), Magic Grab (magic_grab), Magic Expand (magic_expand), and Magic Layers (decompose_layers).
|
|
56
|
-
- Implemented SurfaceFlinger Crash Shield with GPU duty-cycle throttling and safe-mode protection.
|
|
57
|
-
- Added Safe Memory Purger with automatic OOM safety budget management.
|
|
58
|
-
- Unified GPU acceleration dispatch through ameva-runtime HAL.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## 🚀 Major Breakthrough: 6.0B DiT (Z-Image Turbo) Sovereign Mobile Execution
|
|
63
|
-
|
|
64
|
-
`
|
|
65
|
-
|
|
66
|
-
### 🌟 Tri-Engine Asymmetric Architecture
|
|
67
|
-
* **Text Encoder (CPU 4-Core)**: 4.0B LLM (`Qwen3-4B-Instruct-2507-Q2_K.gguf`) performs dense context embedding on CPU Big/Prime cores (`clip_on_cpu=True`).
|
|
68
|
-
* **DiT Denoising Backbone (Vulkan GPU)**: 6.0B Diffusion Transformer (`z_image_turbo-Q2_K.gguf`) accelerated via Khronos Vulkan compute shaders with Tiled Flash Attention (`diffusion_fa=True`).
|
|
69
|
-
* **Ultra-Fast VAE Decoder (CPU)**: 10MB Tiny AutoEncoder for FLUX.1 (`taef1.safetensors`) completes latent decoding rapidly without memory spikes (`vae_on_cpu=True`).
|
|
70
|
-
* **Layer Streaming (`stream_layers=True`)**: Breaks through mobile memory limits by streaming layers into Vulkan VRAM sequentially, maintaining a strict **1.0 GB VRAM footprint** (`max_vram="vulkan0=1"`) and completely eliminating Android Low Memory Killer (LMK) aborts.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 📸 Sovereign Physical Verification: Galaxy S21 DiT 8-Step Output
|
|
75
|
-
|
|
76
|
-
* **Verification Image**: [Galaxy S21 Z-Image Turbo 8-Step PNG Artifact](https://raw.githubusercontent.com/uno-km/
|
|
77
|
-
* **Verification Prompt (Ground Truth)**:
|
|
78
|
-
```text
|
|
79
|
-
"A cinematic photo of a neon cybernetic tiger walking in Seoul street at night"
|
|
80
|
-
```
|
|
81
|
-
* **Verified Input Parameter Engineering**:
|
|
82
|
-
* `steps=8` (Full numerical convergence ODE solver)
|
|
83
|
-
* `cfg_scale=1.0` (Optimal guidance for distilled DiT architecture)
|
|
84
|
-
* `sampler="euler"` (1st-order Ordinary Differential Equation solver)
|
|
85
|
-
* `device="vulkan"` (Physical GPU acceleration)
|
|
86
|
-
* `diffusion_fa=True` (Tiled Flash Attention enabled)
|
|
87
|
-
* `stream_layers=True` (Layer residency streaming over AXI bus)
|
|
88
|
-
* `max_vram="vulkan0=1"` (Strict 1.0 GB VRAM ceiling, Zero-LMK protection)
|
|
89
|
-
* `clip_on_cpu=True` (Offloads LLM prompt embedding to CPU Big/Prime cores)
|
|
90
|
-
* `vae_on_cpu=True` (Prevents GPU VRAM allocation collisions during decoding)
|
|
91
|
-
* `taesd="auto"` (Ultra-fast 10MB FLUX.1 latent decoder)
|
|
92
|
-
* **Optical Realism**: Specular light scattering from neon signboards on wet Seoul asphalt road surfaces, razor-sharp cybernetic armor plates, and micro-texture whiskers cleanly isolated from background noise.
|
|
93
|
-
* **Runtime Stability**: 100% completion achieved with zero Out-of-Memory (LMK) aborts and zero thermal throttling termination.
|
|
94
|
-
|
|
95
|
-
### 🔬 Academic Research & Lab Report Reference
|
|
96
|
-
* **Full Technical Research Report**: [Galaxy S21 Z-Image Turbo Vulkan Research Report](https://github.com/uno-km/
|
|
97
|
-
* **Academic Research Paper**: [AMEVA Labs | Sovereign On-Device AI Research, Newsletter & Discussion](https://uno-km.vercel.app/labs/index.html?menu=research-papers&post=33)
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## 💻 Python SDK Installation & Practical User Manual
|
|
102
|
-
|
|
103
|
-
### 1. Installation & Provisioning
|
|
104
|
-
```bash
|
|
105
|
-
pkg update && pkg install -y python clang termux-api
|
|
106
|
-
pip install
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 2. Python API Practical Code Example
|
|
111
|
-
|
|
112
|
-
```python
|
|
113
|
-
import
|
|
114
|
-
|
|
115
|
-
# 1. Official Z-Image Turbo 6.0B DiT Synthesis via Python API
|
|
116
|
-
image_path = td.generate(
|
|
117
|
-
prompt="A cinematic photo of a neon cybernetic tiger walking in Seoul street at night",
|
|
118
|
-
preset="z-image-turbo",
|
|
119
|
-
steps=8,
|
|
120
|
-
cfg_scale=1.0,
|
|
121
|
-
sampler="euler",
|
|
122
|
-
device="vulkan",
|
|
123
|
-
diffusion_fa=True,
|
|
124
|
-
stream_layers=True,
|
|
125
|
-
max_vram="vulkan0=1",
|
|
126
|
-
clip_on_cpu=True,
|
|
127
|
-
vae_on_cpu=True,
|
|
128
|
-
taesd="auto",
|
|
129
|
-
output_path="/sdcard/Pictures/TermuxDiffusion/cyber_tiger_dit.png"
|
|
130
|
-
)
|
|
131
|
-
print(f"Generated via 6.0B DiT Tri-Engine: {image_path}")
|
|
132
|
-
|
|
133
|
-
# 2. Fast UNet Standard Inference (DreamShaper 8 LCM 6-Step)
|
|
134
|
-
lcm_path = td.generate(
|
|
135
|
-
prompt="A cinematic photo of a neon cybernetic tiger walking in Seoul street at night",
|
|
136
|
-
model="anime",
|
|
137
|
-
steps=6,
|
|
138
|
-
cfg_scale=1.5,
|
|
139
|
-
sampler="lcm",
|
|
140
|
-
device="vulkan",
|
|
141
|
-
diffusion_fa=True,
|
|
142
|
-
vae_on_cpu=True,
|
|
143
|
-
output_path="/sdcard/Pictures/TermuxDiffusion/cyber_tiger_lcm.png"
|
|
144
|
-
)
|
|
145
|
-
print(f"Generated via DreamShaper 8 LCM: {lcm_path}")
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## 🎛️ Python API Parameter Reference
|
|
151
|
-
|
|
152
|
-
| Argument | Type | Default | Engineering Purpose |
|
|
153
|
-
| :--- | :---: | :---: | :--- |
|
|
154
|
-
| `prompt` | `str` | *Required* | Text conditioning prompt |
|
|
155
|
-
| `width`, `height` | `int` | `512` | Image dimensions (multiples of 64) |
|
|
156
|
-
| `steps` | `int` | `8` (DiT) / `6` (LCM) | Numerical solver sampling iterations |
|
|
157
|
-
| `cfg_scale` | `float` | `1.0` (DiT) / `1.5` (LCM) | Classifier-Free Guidance scale weight |
|
|
158
|
-
| `sampler` | `str` | `"euler"` | Denoising ODE solver algorithm |
|
|
159
|
-
| `device` | `str` | `"vulkan"` | Accelerator device (`"vulkan"`, `"cpu"`) |
|
|
160
|
-
| `preset` | `str` | `"z-image-turbo"` | Verified configuration bundle |
|
|
161
|
-
| `stream_layers` | `bool` | `True` (DiT) | Enables dynamic layer streaming over AXI bus |
|
|
162
|
-
| `max_vram` | `str` | `"vulkan0=1"` | GPU memory ceiling (1.0 GB) to avert OS LMK aborts |
|
|
163
|
-
| `diffusion_fa` | `bool` | `True` | Flash Attention $O(N)$ memory reduction |
|
|
164
|
-
| `clip_on_cpu` | `bool` | `True` | Keeps LLM text encoder on CPU cores |
|
|
165
|
-
| `vae_on_cpu` | `bool` | `True` | Offloads VAE decode from GPU to host CPU |
|
|
166
|
-
| `taesd` | `str` | `"auto"` | Tiny AutoEncoder for ultra-fast latent decoding |
|
|
167
|
-
| `output_path` | `str` | `None` | Path to save output PNG artifact |
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 🌐 Official Documentation & Ecosystem Links
|
|
172
|
-
- [Official Architecture & API Reference](https://uno-km.vercel.app/lib/diffusion/)
|
|
173
|
-
- [Advanced Parameters Handbook](https://uno-km.vercel.app/lib/diffusion/advanced-parameters.html)
|
|
174
|
-
- [GitHub Repository](https://github.com/uno-km/
|
|
175
|
-
- [AMEVA Open-Source Foundation Portal](https://uno-km.vercel.app/foundation/index.html)
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## 📄 License
|
|
180
|
-
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)).
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: amv-diffusion
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: AmfyUI (ComfyUI Mobile DAG Studio) & Z-Image Turbo (6.0B DiT) On-Device Diffusion Runtime for Android Termux
|
|
5
|
+
Home-page: https://github.com/uno-km/amv-diffusion
|
|
6
|
+
Author: uno-km (AMEVA Foundation)
|
|
7
|
+
Author-email: "uno-km (AMEVA Foundation)" <zhfldk014745@naver.com>
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Project-URL: Homepage, https://ameva.pro/lib/diffusion/
|
|
10
|
+
Project-URL: Documentation, https://ameva.pro/lib/diffusion/
|
|
11
|
+
Project-URL: npm Package, https://www.npmjs.com/package/amv-diffusion
|
|
12
|
+
Project-URL: Bug Tracker, https://github.com/uno-km/amv-diffusion/issues
|
|
13
|
+
Project-URL: Source, https://github.com/uno-km/amv-diffusion
|
|
14
|
+
Keywords: stable-diffusion,diffusion,termux,android,samsung-galaxy,edge-ai,on-device-ai,image-generation,text-to-image,gguf,arm64,aarch64,neon,simd,bionic-libc,vae-tiling,galaxy-s25,galaxy-s21
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Operating System :: Android
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
27
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
28
|
+
Requires-Python: >=3.8
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Provides-Extra: gpu
|
|
32
|
+
Requires-Dist: ameva-runtime>=2.0.0; extra == "gpu"
|
|
33
|
+
Provides-Extra: detailer
|
|
34
|
+
Requires-Dist: numpy>=1.20.0; extra == "detailer"
|
|
35
|
+
Requires-Dist: Pillow>=8.0.0; extra == "detailer"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: classifier
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
Dynamic: requires-python
|
|
41
|
+
|
|
42
|
+
# AMV-Diffusion (Python)
|
|
43
|
+
|
|
44
|
+
[](https://pypi.org/project/amv-diffusion/)
|
|
45
|
+
[](https://pypi.org/project/amv-diffusion/)
|
|
46
|
+
[](https://github.com/uno-km/amv-diffusion)
|
|
47
|
+
|
|
48
|
+
> **Official Z-Image Turbo (6.0B DiT) & Pure Native On-Device Diffusion Acceleration for Android Termux & Samsung Galaxy.**
|
|
49
|
+
> *Zero PRoot. Zero Virtualization. 100% Native ARM64 Bionic libc, Khronos Vulkan 1.1+ GPU Shaders & NEON SIMD Vector Engine.*
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## What's New in v2.1.0 — Mobile Canva Studio & SurfaceFlinger Shield
|
|
54
|
+
|
|
55
|
+
- Added Mobile Canva Studio Suite: Magic Eraser (magic_eraser), Magic Grab (magic_grab), Magic Expand (magic_expand), and Magic Layers (decompose_layers).
|
|
56
|
+
- Implemented SurfaceFlinger Crash Shield with GPU duty-cycle throttling and safe-mode protection.
|
|
57
|
+
- Added Safe Memory Purger with automatic OOM safety budget management.
|
|
58
|
+
- Unified GPU acceleration dispatch through ameva-runtime HAL.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 🚀 Major Breakthrough: 6.0B DiT (Z-Image Turbo) Sovereign Mobile Execution
|
|
63
|
+
|
|
64
|
+
`amv-diffusion v1.8.0` introduces official production support for **Z-Image Turbo**, empowering mobile devices to execute modern **6.0 Billion Parameter Diffusion Transformers (DiT)** natively on-device.
|
|
65
|
+
|
|
66
|
+
### 🌟 Tri-Engine Asymmetric Architecture
|
|
67
|
+
* **Text Encoder (CPU 4-Core)**: 4.0B LLM (`Qwen3-4B-Instruct-2507-Q2_K.gguf`) performs dense context embedding on CPU Big/Prime cores (`clip_on_cpu=True`).
|
|
68
|
+
* **DiT Denoising Backbone (Vulkan GPU)**: 6.0B Diffusion Transformer (`z_image_turbo-Q2_K.gguf`) accelerated via Khronos Vulkan compute shaders with Tiled Flash Attention (`diffusion_fa=True`).
|
|
69
|
+
* **Ultra-Fast VAE Decoder (CPU)**: 10MB Tiny AutoEncoder for FLUX.1 (`taef1.safetensors`) completes latent decoding rapidly without memory spikes (`vae_on_cpu=True`).
|
|
70
|
+
* **Layer Streaming (`stream_layers=True`)**: Breaks through mobile memory limits by streaming layers into Vulkan VRAM sequentially, maintaining a strict **1.0 GB VRAM footprint** (`max_vram="vulkan0=1"`) and completely eliminating Android Low Memory Killer (LMK) aborts.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📸 Sovereign Physical Verification: Galaxy S21 DiT 8-Step Output
|
|
75
|
+
|
|
76
|
+
* **Verification Image**: [Galaxy S21 Z-Image Turbo 8-Step PNG Artifact](https://raw.githubusercontent.com/uno-km/amv-diffusion/main/docs/research/s21_z_image_turbo_8step.png)
|
|
77
|
+
* **Verification Prompt (Ground Truth)**:
|
|
78
|
+
```text
|
|
79
|
+
"A cinematic photo of a neon cybernetic tiger walking in Seoul street at night"
|
|
80
|
+
```
|
|
81
|
+
* **Verified Input Parameter Engineering**:
|
|
82
|
+
* `steps=8` (Full numerical convergence ODE solver)
|
|
83
|
+
* `cfg_scale=1.0` (Optimal guidance for distilled DiT architecture)
|
|
84
|
+
* `sampler="euler"` (1st-order Ordinary Differential Equation solver)
|
|
85
|
+
* `device="vulkan"` (Physical GPU acceleration)
|
|
86
|
+
* `diffusion_fa=True` (Tiled Flash Attention enabled)
|
|
87
|
+
* `stream_layers=True` (Layer residency streaming over AXI bus)
|
|
88
|
+
* `max_vram="vulkan0=1"` (Strict 1.0 GB VRAM ceiling, Zero-LMK protection)
|
|
89
|
+
* `clip_on_cpu=True` (Offloads LLM prompt embedding to CPU Big/Prime cores)
|
|
90
|
+
* `vae_on_cpu=True` (Prevents GPU VRAM allocation collisions during decoding)
|
|
91
|
+
* `taesd="auto"` (Ultra-fast 10MB FLUX.1 latent decoder)
|
|
92
|
+
* **Optical Realism**: Specular light scattering from neon signboards on wet Seoul asphalt road surfaces, razor-sharp cybernetic armor plates, and micro-texture whiskers cleanly isolated from background noise.
|
|
93
|
+
* **Runtime Stability**: 100% completion achieved with zero Out-of-Memory (LMK) aborts and zero thermal throttling termination.
|
|
94
|
+
|
|
95
|
+
### 🔬 Academic Research & Lab Report Reference
|
|
96
|
+
* **Full Technical Research Report**: [Galaxy S21 Z-Image Turbo Vulkan Research Report](https://github.com/uno-km/amv-diffusion/blob/main/docs/research/s21_z_image_turbo_vulkan_research_report.md)
|
|
97
|
+
* **Academic Research Paper**: [AMEVA Labs | Sovereign On-Device AI Research, Newsletter & Discussion](https://uno-km.vercel.app/labs/index.html?menu=research-papers&post=33)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 💻 Python SDK Installation & Practical User Manual
|
|
102
|
+
|
|
103
|
+
### 1. Installation & Provisioning
|
|
104
|
+
```bash
|
|
105
|
+
pkg update && pkg install -y python clang termux-api
|
|
106
|
+
pip install amv-diffusion
|
|
107
|
+
amv-diffusion install
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 2. Python API Practical Code Example
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import amv_diffusion as td
|
|
114
|
+
|
|
115
|
+
# 1. Official Z-Image Turbo 6.0B DiT Synthesis via Python API
|
|
116
|
+
image_path = td.generate(
|
|
117
|
+
prompt="A cinematic photo of a neon cybernetic tiger walking in Seoul street at night",
|
|
118
|
+
preset="z-image-turbo",
|
|
119
|
+
steps=8,
|
|
120
|
+
cfg_scale=1.0,
|
|
121
|
+
sampler="euler",
|
|
122
|
+
device="vulkan",
|
|
123
|
+
diffusion_fa=True,
|
|
124
|
+
stream_layers=True,
|
|
125
|
+
max_vram="vulkan0=1",
|
|
126
|
+
clip_on_cpu=True,
|
|
127
|
+
vae_on_cpu=True,
|
|
128
|
+
taesd="auto",
|
|
129
|
+
output_path="/sdcard/Pictures/TermuxDiffusion/cyber_tiger_dit.png"
|
|
130
|
+
)
|
|
131
|
+
print(f"Generated via 6.0B DiT Tri-Engine: {image_path}")
|
|
132
|
+
|
|
133
|
+
# 2. Fast UNet Standard Inference (DreamShaper 8 LCM 6-Step)
|
|
134
|
+
lcm_path = td.generate(
|
|
135
|
+
prompt="A cinematic photo of a neon cybernetic tiger walking in Seoul street at night",
|
|
136
|
+
model="anime",
|
|
137
|
+
steps=6,
|
|
138
|
+
cfg_scale=1.5,
|
|
139
|
+
sampler="lcm",
|
|
140
|
+
device="vulkan",
|
|
141
|
+
diffusion_fa=True,
|
|
142
|
+
vae_on_cpu=True,
|
|
143
|
+
output_path="/sdcard/Pictures/TermuxDiffusion/cyber_tiger_lcm.png"
|
|
144
|
+
)
|
|
145
|
+
print(f"Generated via DreamShaper 8 LCM: {lcm_path}")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🎛️ Python API Parameter Reference
|
|
151
|
+
|
|
152
|
+
| Argument | Type | Default | Engineering Purpose |
|
|
153
|
+
| :--- | :---: | :---: | :--- |
|
|
154
|
+
| `prompt` | `str` | *Required* | Text conditioning prompt |
|
|
155
|
+
| `width`, `height` | `int` | `512` | Image dimensions (multiples of 64) |
|
|
156
|
+
| `steps` | `int` | `8` (DiT) / `6` (LCM) | Numerical solver sampling iterations |
|
|
157
|
+
| `cfg_scale` | `float` | `1.0` (DiT) / `1.5` (LCM) | Classifier-Free Guidance scale weight |
|
|
158
|
+
| `sampler` | `str` | `"euler"` | Denoising ODE solver algorithm |
|
|
159
|
+
| `device` | `str` | `"vulkan"` | Accelerator device (`"vulkan"`, `"cpu"`) |
|
|
160
|
+
| `preset` | `str` | `"z-image-turbo"` | Verified configuration bundle |
|
|
161
|
+
| `stream_layers` | `bool` | `True` (DiT) | Enables dynamic layer streaming over AXI bus |
|
|
162
|
+
| `max_vram` | `str` | `"vulkan0=1"` | GPU memory ceiling (1.0 GB) to avert OS LMK aborts |
|
|
163
|
+
| `diffusion_fa` | `bool` | `True` | Flash Attention $O(N)$ memory reduction |
|
|
164
|
+
| `clip_on_cpu` | `bool` | `True` | Keeps LLM text encoder on CPU cores |
|
|
165
|
+
| `vae_on_cpu` | `bool` | `True` | Offloads VAE decode from GPU to host CPU |
|
|
166
|
+
| `taesd` | `str` | `"auto"` | Tiny AutoEncoder for ultra-fast latent decoding |
|
|
167
|
+
| `output_path` | `str` | `None` | Path to save output PNG artifact |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 🌐 Official Documentation & Ecosystem Links
|
|
172
|
+
- [Official Architecture & API Reference](https://uno-km.vercel.app/lib/diffusion/)
|
|
173
|
+
- [Advanced Parameters Handbook](https://uno-km.vercel.app/lib/diffusion/advanced-parameters.html)
|
|
174
|
+
- [GitHub Repository](https://github.com/uno-km/amv-diffusion)
|
|
175
|
+
- [AMEVA Open-Source Foundation Portal](https://uno-km.vercel.app/foundation/index.html)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 📄 License
|
|
180
|
+
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)).
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
### 🔬 Academic Research & Lab Milestone Report
|
|
92
92
|
* **Full Technical Research Report**: [Galaxy S21 Z-Image Turbo Vulkan Research Report](docs/research/s21_z_image_turbo_vulkan_research_report.md)
|
|
93
|
-
* **AMEVA Edge Systems Lab (AESL)**: [https://
|
|
93
|
+
* **AMEVA Edge Systems Lab (AESL)**: [https://ameva.pro/labs/index.html?menu=research-papers&post=33](https://ameva.pro/labs/index.html?menu=research-papers&post=33)
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
@@ -153,7 +153,7 @@ sd-cli-vulkan \
|
|
|
153
153
|
### 3. Python SDK Manual (pip install amv-diffusion)
|
|
154
154
|
|
|
155
155
|
```python
|
|
156
|
-
import
|
|
156
|
+
import amv_diffusion as td
|
|
157
157
|
|
|
158
158
|
# Official Z-Image Turbo 6.0B DiT Synthesis via Python API
|
|
159
159
|
image_path = td.generate(
|
|
@@ -229,10 +229,10 @@ main().catch(console.error);
|
|
|
229
229
|
---
|
|
230
230
|
|
|
231
231
|
## 🌐 Official Ecosystem Documentation
|
|
232
|
-
- [Official Architecture & API Reference](https://
|
|
233
|
-
- [Advanced Parameters Handbook](https://
|
|
232
|
+
- [Official Architecture & API Reference](https://ameva.pro/lib/diffusion/)
|
|
233
|
+
- [Advanced Parameters Handbook](https://ameva.pro/lib/diffusion/advanced-parameters.html)
|
|
234
234
|
- [Galaxy S21 Z-Image Turbo Research Report](docs/research/s21_z_image_turbo_vulkan_research_report.md)
|
|
235
|
-
- [AMEVA Open-Source Foundation Portal](https://
|
|
235
|
+
- [AMEVA Open-Source Foundation Portal](https://ameva.pro/foundation/index.html)
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|