local-dream  by xororz

Stable Diffusion for Android with NPU acceleration

Created 7 months ago
312 stars

Top 86.3% on SourcePulse

GitHubView on GitHub
Project Summary

Local Dream enables Stable Diffusion image generation on Android devices, leveraging Snapdragon NPU acceleration for high performance. It targets users who want to run advanced AI art tools locally on their mobile devices, offering features like text-to-image, image-to-image, and inpainting.

How It Works

The project utilizes the Qualcomm QNN SDK for NPU acceleration, employing W8A16 static quantization for optimal performance on supported Snapdragon chipsets. For broader compatibility, it also supports CPU and GPU inference via the MNN framework, using W8 dynamic quantization and allowing flexible input resolutions.

Quick Start & Requirements

  • Install: Download the APK from Releases or Google Play.
  • Prerequisites: Snapdragon 8 Gen 1 or newer for NPU acceleration. ~2GB available RAM for CPU/GPU. Building requires Rust, Ninja, CMake, Android NDK, and Qualcomm QNN SDK.
  • Build: Follow platform-specific build scripts (build.sh or build.bat) in app/src/main/cpp/ after cloning the repository and configuring SDK paths.
  • Docs: GitHub Releases

Highlighted Details

  • NPU acceleration offers extremely fast inference speeds.
  • Supports importing local SD1.5 safetensor models for CPU/GPU.
  • NPU mode supports high-resolution generation (768x768, 1024x1024) via patches.
  • Seed settings guarantee reproducible results on NPU and CPU modes.

Maintenance & Community

The project is open-sourced and seeks sponsorship for continued development, model integrations, new features, and bug fixes.

Licensing & Compatibility

The project's licensing is not explicitly stated in the README, but it uses libraries with various open-source licenses (e.g., MIT, Apache 2.0). Commercial use compatibility would require verification of all dependencies.

Limitations & Caveats

NPU acceleration is limited to specific Snapdragon chipsets. High-resolution NPU generation may result in poor image layout. CPU/GPU mode results can vary between devices.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
9
Star History
39 stars in the last 30 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), Lianmin Zheng Lianmin Zheng(Coauthor of SGLang, vLLM), and
2 more.

HunyuanVideo by Tencent-Hunyuan

0.2%
11k
PyTorch code for video generation research
Created 9 months ago
Updated 3 weeks ago
Feedback? Help us improve.