Skip to content

Latest commit

 

History

History
103 lines (89 loc) · 3.54 KB

installing.md

File metadata and controls

103 lines (89 loc) · 3.54 KB

Install Automatic1111 Web UI on your Network Volume

  1. Create a RunPod Account.
  2. Create a RunPod Network Volume.
  3. Attach the Network Volume to a Secure Cloud GPU pod.
  4. Select a light-weight template such as RunPod Pytorch.
  5. Deploy the GPU Cloud pod.
  6. Once the pod is up, open a Terminal and install the required dependencies. This can either be done by using the installation script, or manually.

Automatic Installation Script

You can run this automatic installation script which will automatically install all of the dependencies that get installed manually below, and then you don't need to follow any of the manual instructions.

wget https://raw.githubusercontent.com/antonioglass/runpod-worker-a1111/main/scripts/install.sh
chmod +x install.sh
./install.sh

Manual Installation

You only need to complete the steps below if you did not run the automatic installation script above.

  1. Install the Automatic1111 WebUI and ControlNet extension:
# Clone the repo
cd /workspace
git clone --depth=1 https://github.com/antonioglass/stable-diffusion-webui.git

# Upgrade Python
apt update
apt -y upgrade

# Ensure Python version is 3.10.12
python3 -V

# Create and activate venv
cd stable-diffusion-webui
python -m venv /workspace/venv
source /workspace/venv/bin/activate

# Install Torch and xformers
pip install --no-cache-dir torch==2.0.1+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install --no-cache-dir xformers==0.0.22

# Install A1111 Web UI
wget https://raw.githubusercontent.com/antonioglass/runpod-worker-a1111/main/install-automatic.py
python -m install-automatic --skip-torch-cuda-test

# Clone the ControlNet Extension
git clone https://github.com/antonioglass/sd-webui-controlnet.git extensions/sd-webui-controlnet

# Install dependencies for ControlNet
cd extensions/sd-webui-controlnet
pip install -r requirements.txt
  1. Install the Serverless dependencies:
cd /workspace/stable-diffusion-webui
pip3 install huggingface_hub runpod>=0.10.0
  1. Download some models, for example epiCPhotoGasm - Y - Photoreal:
cd /workspace/stable-diffusion-webui/models/Stable-diffusion
wget https://civitai.com/api/download/models/197181 --content-disposition
  1. Download ControlNet model for poses OpenPose:
mkdir -p /workspace/stable-diffusion-webui/models/ControlNet
cd /workspace/stable-diffusion-webui/models/ControlNet
wget https://civitai.com/api/download/models/44811 --content-disposition
  1. Create logs directory:
mkdir -p /workspace/logs
  1. Install config files:
cd /workspace/stable-diffusion-webui
rm webui-user.sh config.json ui-config.json
wget https://raw.githubusercontent.com/antonioglass/runpod-worker-a1111/main/webui-user.sh
wget https://raw.githubusercontent.com/antonioglass/runpod-worker-a1111/main/config.json
wget https://raw.githubusercontent.com/antonioglass/runpod-worker-a1111/main/ui-config.json
  1. Run the Web UI:
deactivate
export HF_HOME="/workspace"
cd /workspace/stable-diffusion-webui
./webui.sh -f
  1. Wait for the Web UI to start up, and download the models. You shoud see something like this when it is ready:
Model loaded in 16.9s (calculate hash: 8.0s, load weights from disk: 0.4s, create model: 2.1s, apply weights to model: 2.6s, apply half(): 2.6s, move model to device: 0.7s, calculate empty prompt: 0.3s).
  1. Press Ctrl-C to exit, and then you can terminate the pod.