-
Get a Gcloud instance with GPU and Debian 12 (spot instances are cheaper but can be interrupted)
-
Add a VPC firewall rule to enable 7860 port. Add this rule to the Compute Instance (edit -> networking)
-
Open a screen:
screen
. It is always a good idea to use screen, because if the connection interrupts, it will preserve the opened process. Next time when you connect, typescreen -r
to reopen orscreen -rd
to force reopen after an interruption. -
Install and verify GPU driver:
curl https://raw.githubusercontent.com/GoogleCloudPlatform/compute-gpu-installation/main/linux/install_gpu_driver.py --output install_gpu_driver.py
sudo python3 install_gpu_driver.py
sudo nvidia-smi
- Connect to the VM by clicking the SSH button on the instance, and enter Y when it asks to install the GPU driver.
sudo apt update && apt upgrade
- Install Stable Diffusion WebUI dependencies:
sudo apt install wget git python3-venv
sudo apt install python3-pip
sudo apt install libsm6 libxext6
- Navigato to a folder install the WebUI (I'll use this auto install script for now):
bash <(wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
- Exit when you see
Model loaded in ...
and restart with
bash webui.sh --listen
The
--listen
argument will make the UI publicly available on the internet.
Open ip:7860