Skip to content

ShiftHackZ/Stable-Diffusion-Android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

493 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stable Diffusion AI (SDAI)

Google Play F-Droid App Store

Website | Google Play | F-Droid | App Store | Nightly Build | Telegram | Discord | 4PDA

Get it on Google Play Get it on F-Droid Download on the App Store

SDAI is an open-source, cross-platform AI image generation client for Android and iOS. It gives you one clean mobile workflow for self-hosted Stable Diffusion servers, hosted image APIs, crowdsourced generation, and platform-specific local generation where supported.

No ads. No telemetry. No lock-in to a single provider.

Project Documentation

Root-level Markdown documents:

Why SDAI

  • Choose the backend that fits the moment: your own AUTOMATIC1111 or SwarmUI server, AI Horde, Hugging Face, OpenAI, Stability AI, Fal.ai, ArliAI, or local diffusion where the platform supports it.
  • Generate with familiar Stable Diffusion controls: prompts, negative prompts where supported, seed, steps, CFG scale, image size, model selectors, LoRA, embeddings, and more.
  • Use one shared mobile experience across Android and iOS for remote generation workflows.
  • Work locally when privacy or connectivity matters with Android ONNX, MediaPipe, stable-diffusion.cpp SDXL, iOS Silicon Diffusion Core ML, or iOS Silicon Diffusion PrismML Bonsai.
  • Keep your creations in a local gallery with image details, zoom, sharing, native platform save flows, and zip export.
  • Check local-device fit before heavy runs with the on-device benchmark, then review storage and network usage from Settings.
  • Stay in control: the project is open source and the app does not include ads or telemetry.

Screenshots

SDAI screenshots: generation result, prompt controls, and provider selection

SDAI screenshots: image gallery, app settings, and generation details

Provider and Platform Matrix

Android builds are distributed in three flavors:

  • playstore: Google Play build.
  • full: full GitHub/release build.
  • foss: F-Droid friendly build.

iOS uses the shared mobile experience with remote generation providers, Silicon Diffusion Core ML, and Silicon Diffusion PrismML Bonsai for on-device generation on supported devices.

Provider / backend What it connects to iOS Android playstore Android full Android foss Notes
AUTOMATIC1111 WebUI Your own Stable-Diffusion-WebUI API server 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Own server, demo mode, txt2img, img2img, inpaint, models, LoRA, embeddings, hypernetworks.
SwarmUI Your own SwarmUI server 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Own server with SwarmUI model, LoRA, and embeddings discovery.
AI Horde Crowdsourced Stable Horde workers 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Works with the default anonymous key or your own Horde API key.
Hugging Face Inference API Hosted Hugging Face image models 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Requires a Hugging Face API key and selected model.
OpenAI Images API OpenAI image generation with GPT Image models 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Requires an OpenAI API key.
Stability AI Stability AI / DreamStudio image API 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Requires a Stability AI API key and engine selection.
Fal.ai Fal.ai hosted image generation endpoints 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Requires a Fal.ai API key. Supports compatible FLUX txt2img/img2img endpoints through the shared generation form.
ArliAI ArliAI SDNext-compatible hosted image API 🟢 Yes 🟢 Yes 🟢 Yes 🟢 Yes Alpha provider. Requires an ArliAI API key. Supports txt2img/img2img, checkpoint discovery, sampler selection, steps, CFG scale, negative prompt, and batch generation.
Local Diffusion: Microsoft ONNX Runtime On-device ONNX model inference 🔴 No 🟢 Yes 🟢 Yes 🟢 Yes Android-only txt2img. Custom local model paths are available outside the Play build.
Local Diffusion: Google AI MediaPipe On-device MediaPipe image generator 🔴 No 🟢 Yes 🟢 Yes 🔴 No Android-only txt2img. Excluded from the FOSS flavor.
Local Diffusion: stable-diffusion.cpp SDXL On-device SDXL-compatible model inference 🔴 No 🟢 Yes 🟢 Yes 🟢 Yes Android-only txt2img through stable-diffusion.cpp. Supports catalog GGUF/safetensors/ckpt models, CPU/OpenCL/Vulkan backend selection, and custom local model paths outside the Play build.
Silicon Diffusion Core ML On-device Core ML Stable Diffusion runtime 🟢 Yes 🔴 No 🔴 No 🔴 No iOS-only txt2img and img2img with explicit downloadable/imported Core ML model assets. SDXL catalog entries are disabled until device-gated QA is stable.
Silicon Diffusion PrismML Bonsai On-device PrismML Bonsai Image 4B MLX runtime 🟢 Yes 🔴 No 🔴 No 🔴 No iOS-only txt2img with downloadable PrismML Bonsai Ternary and Binary model archives.

AI Feature Matrix

AI-specific feature Supported providers Notes
Text to image AUTOMATIC1111, SwarmUI, AI Horde, Hugging Face, OpenAI, Stability AI, Fal.ai, ArliAI, Local ONNX, Local MediaPipe, Local SDXL, Silicon Diffusion Core ML, Silicon Diffusion PrismML Bonsai Core generation path exists for every provider exposed by the current platform/build.
Image to image AUTOMATIC1111, SwarmUI, AI Horde, Hugging Face, Stability AI, Fal.ai, ArliAI, Silicon Diffusion Core ML OpenAI and Android local diffusion providers are txt2img-only in the app. Core ML img2img requires a compatible downloaded model archive.
Inpaint mask controls AUTOMATIC1111 Mask image, mask blur, mask mode, masked content, inpaint area, and only-masked padding are mapped to the A1111 img2img API.
Negative prompt AUTOMATIC1111, SwarmUI, Hugging Face, Stability AI, ArliAI, Local ONNX, Local SDXL, Silicon Diffusion Core ML Horde, OpenAI, and MediaPipe flows do not expose/send a negative prompt.
Batch generation AUTOMATIC1111, SwarmUI, AI Horde, Hugging Face, OpenAI, Stability AI, Fal.ai, ArliAI Fal.ai uses native num_images; ArliAI uses the SDNext-compatible batch size field; local providers are treated as single-image generation flows.
Model or engine selection AUTOMATIC1111, SwarmUI, Hugging Face, OpenAI, Stability AI, Fal.ai, ArliAI, Local ONNX, Local MediaPipe, Local SDXL, Silicon Diffusion Core ML, Silicon Diffusion PrismML Bonsai Depending on provider, this selects an SD checkpoint, SwarmUI model, HF model, OpenAI model, Stability engine, Fal.ai endpoint, ArliAI checkpoint, or local model.
LoRA picker AUTOMATIC1111, SwarmUI Remote LoRA lists are fetched from the active compatible server.
Textual inversion / embeddings picker AUTOMATIC1111, SwarmUI Remote embeddings are fetched from the active compatible server.
Hypernetwork picker AUTOMATIC1111 Hypernetwork discovery is implemented for A1111.
Sampler selection AUTOMATIC1111, Stability AI, ArliAI, Local SDXL A1111 samplers are fetched from the server; Stability AI and ArliAI use provider-specific sampler lists; Local SDXL maps compatible samplers to stable-diffusion.cpp.
Restore faces AUTOMATIC1111 Exposed only for A1111 generation.
OpenAI model, size, and quality OpenAI Uses current GPT Image model options exposed by the Images API.
Stability style preset and clip guidance Stability AI Passed to Stability AI requests when selected.
NSFW flag AI Horde, Fal.ai, Silicon Diffusion Core ML Exposed for Horde requests, mapped to Fal.ai safety-checker settings, and mapped to the local Core ML safety checker.
Offline generation Local ONNX, Local MediaPipe, Local SDXL, Silicon Diffusion Core ML, Silicon Diffusion PrismML Bonsai Runs after the selected local model is available on the current platform.
On-device benchmark Local ONNX, Local MediaPipe, Local SDXL, Silicon Diffusion Core ML, Silicon Diffusion PrismML Bonsai Runs a safe inference-like CPU and memory workload, stores the latest local result, and recommends local provider settings without loading model files or starting AI runtimes.
Generation interrupt AUTOMATIC1111, AI Horde, Local ONNX, Local SDXL, Silicon Diffusion Core ML, Silicon Diffusion PrismML Bonsai Other providers rely on request completion when no platform-level interrupt is exposed.

Core Workflow

Generate

  • Txt2Img for all available providers.
  • Img2Img for providers that support image input.
  • Inpaint for A1111-powered Img2Img.
  • Prompt tagging, optional advanced controls, seed handling, steps, CFG scale, size controls, and provider-specific model options.

Save and Review

  • Local in-app gallery for generated images.
  • Detail screen with zoom, generation metadata, and sharing.
  • Optional auto-save of results.
  • Native platform save/share flows, including Android MediaStore and iOS Photos/share sheet where available.
  • Export one image or the full gallery as a zip archive.

Configure

  • Provider setup from first launch or settings.
  • Provider search, type/readiness/tag filters, and sorting for faster backend selection.
  • Server URL and credentials for own-server providers.
  • API keys for hosted providers.
  • Local model selection and download flow for supported local diffusion providers.
  • Hardware benchmark in AI Settings for local providers, including device score, acceleration availability, estimated generation time, and recommended local settings.
  • Server availability monitoring for compatible own-server modes.
  • Storage usage and network usage screens for gallery/cache/model files and provider traffic counters.

Setup

Option 1: AUTOMATIC1111 WebUI

Use this if you already run Stable-Diffusion-WebUI locally, on a server, or in a notebook environment.

  1. Follow the setup instructions in the WebUI repository.
  2. Start WebUI with API access enabled, for example with --api --listen.
  3. Copy the reachable server URL.
  4. Open SDAI setup, choose AUTOMATIC1111, enter the URL, and connect.

Demo mode is available from the setup screen if you want to explore the app without connecting to a real generator.

Option 2: SwarmUI

Use this if your generation environment is powered by SwarmUI. Start SwarmUI in server mode, copy the reachable URL, then choose SwarmUI during SDAI setup.

Option 3: AI Horde

AI Horde is a crowdsourced distributed cluster of image generation workers. SDAI can use the default anonymous key (0000000000) or your own key from stablehorde.net/register.

Option 4: Hugging Face Inference API

Hugging Face Inference API lets SDAI call hosted public or private image models. Create an API key in Hugging Face account settings, then select the Hugging Face provider in SDAI.

Option 5: OpenAI

OpenAI image generation in SDAI uses GPT Image models through the Images API. Create an API key in OpenAI API key settings, then select OpenAI in SDAI.

Option 6: Stability AI

Stability AI support uses the Stability image API. Create an API key on the Stability AI keys page, then select Stability AI and choose an engine in SDAI.

Option 7: Fal.ai

Fal.ai support uses the Fal.ai queue API for compatible FLUX text-to-image and image-to-image endpoints. Create an API key in the Fal.ai dashboard, then select Fal.ai in SDAI and choose the endpoint from the shared generation form.

Option 8: ArliAI

ArliAI support uses the ArliAI SDNext-compatible image API. Create an ArliAI API key, select ArliAI in SDAI, connect, and choose the checkpoint from the shared generation form after model discovery completes.

Option 9: Local Diffusion with Microsoft ONNX Runtime

Use this on Android for on-device txt2img generation. Download or provide a compatible ONNX local diffusion model, select it in setup, and generate without sending prompts to a remote service.

Option 10: Local Diffusion with Google AI MediaPipe

Use this on Android for on-device txt2img generation through Google AI MediaPipe. This provider is available only in playstore and full Android flavors.

Option 11: Local SDXL with stable-diffusion.cpp

Use this on Android for on-device SDXL-compatible txt2img generation through stable-diffusion.cpp. Download a supported model from the in-app SDXL catalog or provide a compatible local single-file model outside the Play build, then choose the runtime backend from Auto, CPU, OpenCL, or Vulkan. Mobile SDXL is memory-heavy, so the catalog starts with compact/quantized GGUF options such as SSD-1B / LCM-style models before larger desktop-class SDXL files.

Option 12: Silicon Diffusion Core ML

Use this on iOS for on-device Stable Diffusion generation through Core ML. Download a supported Core ML model from the in-app catalog or import a compatible local model package, select it during setup, and generate without sending prompts or source images to a remote service.

The first-party catalog intentionally starts with Apple/Hugging Face Stable Diffusion 1.x and 2.x palettized Core ML archives. SDXL archives are not exposed by default until memory and execution-plan compatibility are stable across a tested device matrix.

Option 13: Silicon Diffusion PrismML Bonsai

Use this on iOS for on-device text-to-image generation through the PrismML Bonsai Image 4B MLX runtime. Download a supported Bonsai Ternary or Binary model archive from the in-app catalog, select it during setup, and generate without sending prompts to a remote service.

This provider is beta while the custom KMP-to-Swift runtime bridge and model QA stabilize across real iPhone devices.

Build Flavor Notes

Android flavor availability is driven by the Gradle flavor configuration and runtime provider filtering. Most network providers are available everywhere; Google AI MediaPipe is intentionally unavailable in foss. Local SDXL through stable-diffusion.cpp is available in playstore, full, and foss; its model catalog is shared, and model files are downloaded or imported by the user rather than bundled into the app. The Play build avoids custom local model path selection for local diffusion models because broad file access is not generally accepted for Google Play distribution.

The iOS app is not split into Android-style flavors. It uses the shared mobile UI, remote-provider stack, Silicon Diffusion Core ML, and Silicon Diffusion PrismML Bonsai as iOS-only local providers. Android ONNX and MediaPipe local diffusion remain Android-specific.

For a historical overview of flavor policy, see the project wiki page: Build flavor difference.

Legacy Android 0.x.x Versions

The old Android-only 0.x.x release line is no longer maintained. It remains available for archival and reference purposes in the archive/version-0.x.x branch.

Supported Languages

SDAI uses the language provided by the OS when a translation is available.

Language Since version Status
English 0.1.0 Translated
Ukrainian 0.1.0 Translated
Turkish 0.4.1 Translated
Russian 0.5.5 Translated
Chinese (Simplified) 0.6.2 Translated

Translation contributions are welcome.

Donate

SDAI is open source and provided with no warranty. You are welcome to use it for free.

If you find the project useful and want to support the work, please check the current donation status at sdai.moroz.cc/donate.html.

Citation

If you mention SDAI in research, articles, benchmarks, tutorials, app collections, or public project documentation, please cite it as:

Stable Diffusion AI (SDAI), an open-source cross-platform AI image generation client by Dmitriy Moroz / Moroz Inc. https://github.com/ShiftHackZ/Stable-Diffusion-Android

BibTeX:

@software{sdai,
  title = {Stable Diffusion AI (SDAI)},
  author = {Moroz, Dmitriy},
  year = {2023},
  url = {https://github.com/ShiftHackZ/Stable-Diffusion-Android},
  note = {Open-source cross-platform AI image generation client}
}