File size: 1,655 Bytes
bfa9b0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash

# Update and upgrade system packages
sudo apt update && sudo apt upgrade -y

# Remove unused packages
sudo apt autoremove -y

# Install software-properties-common
sudo apt install software-properties-common -y

# Add deadsnakes PPA
sudo add-apt-repository ppa:deadsnakes/ppa -y

# Install Python 3.10
sudo apt install python3.10

# Clone the stable-diffusion-webui repository
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

# Install google-perftools
sudo apt install -y google-perftools

# Check python versions
python --version
python3 --version

# Set up python alternatives
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1

# Automatically select Python 3.10 for /usr/bin/python
echo 1 | sudo update-alternatives --config python

# Set up python3 alternatives
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

# Automatically select Python 3.10 for /usr/bin/python3
echo 1 | sudo update-alternatives --config python3

# Check python versions again
python3 --version
python --version

# Install python3.10 development and venv packages
sudo apt install python3.10-dev python3.10-venv

# Navigate to the cloned directory
cd stable-diffusion-webui/

# Update webui-user.sh using sed
sed -i 's/#export COMMANDLINE_ARGS=""/export COMMANDLINE_ARGS="--xformers"/' webui-user.sh

# Ensure the webui-user.sh script is executable
chmod +x webui-user.sh

# Execute the webui-user.sh script
./webui-user.sh