Who is this for?

This Learning Path is for Android and machine learning developers who want to run an optimized text-to-image generation model locally on an Arm-based Android device.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Install the Android command-line tools and required SDK packages.
  • Build TinySD Studio and run it on an Arm-based Android phone.
  • Download, package, and import the TinySD ExecuTorch model, then generate a 512 x 512 image.
  • Compare images generated from the same prompt with different seeds.
  • Understand how the application adapter works and choose a route for another model package.

Prerequisites

Before starting, you will need the following:

  • A development machine supported by Android Studio
  • An Arm-based Android phone with Android 9 or later and 4 GB of free storage, or a development machine that can run an Arm64 Android emulator
  • A USB data cable when using a physical phone
  • A Java 17 or later JDK
  • Git installed and available in your PATH
  • Python 3 with venv and pip support
  • On macOS or Linux, curl and unzip installed and available in your PATH
  • A Hugging Face account with access to the model repositories

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll run an Arm-optimized TinySD text-to-image model locally on an Arm64 Android phone with ExecuTorch and XNNPACK. You’ll install and verify the Android command-line tools, build TinySD Studio, and download and import the TinySD INT8 package. Then, you’ll generate and save a 512 x 512 image and compare another seed. You’ll also trace the adapter, package importer, tokenizer, denoising loop, and image decoder, then choose an executable route for another model package.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
Which model repository ID should I use?
Set MODEL_ID to Arm/tiny-sd-int8-xnnpack-executorch-vivo-x300, the Hugging Face repository for this application. Use the same value when you run the model downloader.
How do I check whether Android SDK Platform 35 is installed?
On macOS or Linux, run test -d "$ANDROID_HOME/platforms/android-35". In Windows PowerShell, run Test-Path "$env:ANDROID_HOME\platforms\android-35". The PowerShell check returns True when the platform directory exists.
Can I use an emulator instead of a physical phone?
You can use either a physical Arm64 Android phone or an Arm64 AVD. Use an emulator on a development computer with at least 16 GB of host memory, or use a physical phone with at least 7 GB of RAM.
What should I see after I generate an image?
The application tokenizes your prompt locally, reports progress through 25 denoising steps, and then displays a 512 x 512 image and the elapsed time. Select Save image to export the result as a PNG.
Where does the application tokenize the prompt and execute the model?
TinySdImageGenerationAdapter.java connects the shared application interface to ClipTokenizer.java, ModelImporter.java, and TinySdRunner.java. The tokenizer produces 77 CLIP token IDs, and the runner calls the ExecuTorch text encoder, UNet, and VAE decoder. ScheduleData.java loads the DPM-Solver++ values.
Next