This project is now open sourced and completely free. Hope you enjoy it!
If you like it, please consider sponsor this project.
Non-flagship chips are now experimentally supported. It should work on NPUs that are Hexagon V68 or above.
Try our NPU Model Conversion Guide if you want to run your own models on npu.
You can join our telegram group for discussion or help with testing.
- Download: Get the APK from Releases or Google Play(NSFW filtered)
- Install: Install the APK on your Android device
- Select Models: Open the app and download the model(s) you want to use
- π¨ txt2img - Generate images from text descriptions
- πΌοΈ img2img - Transform existing images
- π inpaint - Redraw selected areas of images
Note: Building on Linux/WSL is recommended. Other platforms are not verified.
The following tools are required for building:
- Rust - Install rustup, then run:
rustup default stable rustup target add aarch64-linux-android
- Ninja - Build system
- CMake - Build configuration
git clone --recursive https://github.com/xororz/local-dream.git
- Download QNN SDK: Get QNN_SDK_2.39 and extract
- Download Android NDK: Get Android NDK and extract
- Configure paths:
- Update
QNN_SDK_ROOT
inapp/src/main/cpp/CMakeLists.txt
- Update
ANDROID_NDK_ROOT
inapp/src/main/cpp/CMakePresets.json
- Update
π§ Linux
cd app/src/main/cpp/
bash ./build.sh
πͺ Windows
# Install dependencies if needed:
# winget install Kitware.CMake
# winget install Ninja-build.Ninja
# winget install Rustlang.Rustup
cd app\src\main\cpp\
# Convert patch file (install dos2unix if needed: winget install -e --id waterlan.dos2unix)
dos2unix SampleApp.patch
.\build.bat
π macOS
# Install dependencies with Homebrew:
# brew install cmake rust ninja
# Fix CMake version compatibility
sed -i '' '2s/$/ -DCMAKE_POLICY_VERSION_MINIMUM=3.5/' build.sh
bash ./build.sh
Open this project in Android Studio and navigate to: Build β Generate App Bundles or APKs β Generate APKs
- SDK: Qualcomm QNN SDK leveraging Hexagon NPU
- Quantization: W8A16 static quantization for optimal performance
- Resolution: Fixed 512Γ512 model shape
- Performance: Extremely fast inference speed
- Framework: Powered by MNN framework
- Quantization: W8 dynamic quantization
- Resolution: Flexible sizes (128Γ128, 256Γ256, 384Γ384, 512Γ512)
- Performance: Moderate speed with high compatibility
After downloading a 512 resolution model, you can download patches to enable 768Γ768 and 1024Γ1024 image generation. Please note that quantized high-resolution models may produce images with poor layout. We recommend first generating at 512 resolution, then using the high-resolution model for img2img (which is essentially Highres.fix). The suggested img2img denoise_strength is around 0.8.
Compatible with devices featuring:
- Snapdragon 8 Gen 1
- Snapdragon 8+ Gen 1
- Snapdragon 8 Gen 2
- Snapdragon 8 Gen 3
- Snapdragon 8 Elite
- Snapdragon 8 Elite Gen 5
- Non-flagship chips with Hexagon V68 or above (e.g., Snapdragon 7 Gen 1, 8s Gen 3)
Note: Other devices cannot download NPU models
- RAM Requirement: ~2GB available memory
- Compatibility: Most Android devices from recent years
Now supports importing from local SD1.5 based safetensor for CPU/GPU.
Now you can import your own NPU models converted using our easy-to-follow NPU Model Conversion Guide. And you can also download some pre-converted models from xororz/sd-qnn or Mr-J-369. Download _min
if you are using non-flagship chips. Download _8gen1
if you are using 8gen1. Download _8gen2
if you are using 8gen2/3/4/5. We recommend checking the instructions on the original model page to set up prompts and parameters.
Model | Type | CPU/GPU | NPU | Clip Skip | Source |
---|---|---|---|---|---|
Anything V5.0 | SD1.5 | β | β | 2 | CivitAI |
ChilloutMix | SD1.5 | β | β | 1 | CivitAI |
Absolute Reality | SD1.5 | β | β | 2 | CivitAI |
QteaMix | SD1.5 | β | β | 2 | CivitAI |
CuteYukiMix | SD1.5 | β | β | 2 | CivitAI |
Stable Diffusion 2.1 | SD2.1 | β | β | 1 | HuggingFace |
Custom seed support for reproducible image generation:
- CPU Mode: Seeds guarantee identical results across different devices with same parameters
- GPU Mode: Results may differ from CPU mode and can vary between different devices
- NPU Mode: Seeds ensure consistent results only on devices with identical chipsets
- Qualcomm QNN SDK - NPU model execution
- alibaba/MNN - CPU model execution
- xtensor-stack - Tensor operations & scheduling
- mlc-ai/tokenizers-cpp - Text tokenization
- yhirose/cpp-httplib - HTTP server
- nothings/stb - Image processing
- facebook/zstd - Model compression
- nlohmann/json - JSON processing
- coil-kt/coil - Image loading & processing
- MoyuruAizawa/Cropify - Image cropping
- AOSP, Material Design, Jetpack Compose - UI framework
- bhky/opennsfw2 - NSFW content filtering
If you find Local Dream useful, please consider supporting its development:
- Additional Models - More AI model integrations
- New Features - Enhanced functionality and capabilities
- Bug Fixes - Continuous improvement and maintenance
Your sponsorship helps maintain and improve Local Dream for everyone!