Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cagbal/6372f24c4d4f5af58852dded13cf15c9 to your computer and use it in GitHub Desktop.

Select an option

Save cagbal/6372f24c4d4f5af58852dded13cf15c9 to your computer and use it in GitHub Desktop.
Install stable-diffusion-webui on Termux (Android) + PRoot

Install stable-diffusion-webui on Termux (Android) + PRoot

This will guide you on installing AUTOMATIC1111/stable-diffusion-webui on Termux (Android) + PRoot Distro. Make sure that you have a high-end phone to actually make this usable. On my phone with 8GB RAM, launch the webui alone take at least ~ 2 GB RAM, thus making it impossible to load any model and process further.

1. Prerequisites

First you have to install Termux from F-Droid, Termux from Play store won't work and install PRoot.

Then install and login to Ubuntu in PRoot

proot-distro install ubuntu

proot-distro login ubuntu

2. Installing AUTOMATIC1111/stable-diffusion-webui

Run below commands sequentially as root user in Ubuntu

  1. Install basic tools

apt update && apt upgrade -y && apt-get install curl git gcc make build-essential python3 python3-dev python3-distutils python3-pip python3-venv python-is-python3 -y

  1. Install required extensions

apt-get install libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 -y

  1. Clone the repository

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

  1. Change the current directory

cd stable-diffusion-webui

  1. 'Fix' the issue with Python running in PRoot

export ANDROID_DATA=anything

  1. Install required Python packages

python3 -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt

  1. Install xformers. This package is not required, but is recommended to be installed

pip install xformers

  1. Launch the webui. It will take some time to complete first-time installation then everything should be fine

python launch.py --skip-torch-cuda-test --use-cpu interrogate --precision full --no-half --xformers --listen

  1. Navigate to the webui in your browser

http://127.0.0.1:7860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment