Skip to content

Instantly share code, notes, and snippets.

@nviet
Last active January 16, 2025 23:09
Show Gist options
  • Save nviet/a4296bae33cbc8738e274951e0a89d4a to your computer and use it in GitHub Desktop.
Save nviet/a4296bae33cbc8738e274951e0a89d4a 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

@goodasa
Copy link

goodasa commented Oct 31, 2024

Hi,
Is it possibe to use SD 3.5 medium gguf?
Thank you!

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