Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ca4ti/de005f9bc4b65aae417c915094c98951 to your computer and use it in GitHub Desktop.
Save ca4ti/de005f9bc4b65aae417c915094c98951 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 and install PRoot. Then install and login to Ubuntu in PRoot

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

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