Upload SD_install.sh
Browse files- SD_install.sh +59 -0
SD_install.sh
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Update and upgrade system packages
|
| 4 |
+
sudo apt update && sudo apt upgrade -y
|
| 5 |
+
|
| 6 |
+
# Remove unused packages
|
| 7 |
+
sudo apt autoremove -y
|
| 8 |
+
|
| 9 |
+
# Install software-properties-common
|
| 10 |
+
sudo apt install software-properties-common -y
|
| 11 |
+
|
| 12 |
+
# Add deadsnakes PPA
|
| 13 |
+
sudo add-apt-repository ppa:deadsnakes/ppa -y
|
| 14 |
+
|
| 15 |
+
# Install Python 3.10
|
| 16 |
+
sudo apt install python3.10
|
| 17 |
+
|
| 18 |
+
# Clone the stable-diffusion-webui repository
|
| 19 |
+
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
|
| 20 |
+
|
| 21 |
+
# Install google-perftools
|
| 22 |
+
sudo apt install -y google-perftools
|
| 23 |
+
|
| 24 |
+
# Check python versions
|
| 25 |
+
python --version
|
| 26 |
+
python3 --version
|
| 27 |
+
|
| 28 |
+
# Set up python alternatives
|
| 29 |
+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
|
| 30 |
+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
|
| 31 |
+
|
| 32 |
+
# Automatically select Python 3.10 for /usr/bin/python
|
| 33 |
+
echo 1 | sudo update-alternatives --config python
|
| 34 |
+
|
| 35 |
+
# Set up python3 alternatives
|
| 36 |
+
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
|
| 37 |
+
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
|
| 38 |
+
|
| 39 |
+
# Automatically select Python 3.10 for /usr/bin/python3
|
| 40 |
+
echo 1 | sudo update-alternatives --config python3
|
| 41 |
+
|
| 42 |
+
# Check python versions again
|
| 43 |
+
python3 --version
|
| 44 |
+
python --version
|
| 45 |
+
|
| 46 |
+
# Install python3.10 development and venv packages
|
| 47 |
+
sudo apt install python3.10-dev python3.10-venv
|
| 48 |
+
|
| 49 |
+
# Navigate to the cloned directory
|
| 50 |
+
cd stable-diffusion-webui/
|
| 51 |
+
|
| 52 |
+
# Update webui-user.sh using sed
|
| 53 |
+
sed -i 's/#export COMMANDLINE_ARGS=""/export COMMANDLINE_ARGS="--xformers"/' webui-user.sh
|
| 54 |
+
|
| 55 |
+
# Ensure the webui-user.sh script is executable
|
| 56 |
+
chmod +x webui-user.sh
|
| 57 |
+
|
| 58 |
+
# Execute the webui-user.sh script
|
| 59 |
+
./webui-user.sh
|