stable-diffusion部署在centos
安装python环境
版本推荐python3.10.6
安装git
sudo apt install git
开始部署
到普通用户目录执行git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
把项目下载
执行./webui.sh下载依赖最后启动
注意
先安装pytorch
launch.py
找到torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117"),并修改
修改后:torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.13.1 torchvision==0.14.1")
ln -s /usr/local/bin/python3 /usr/bin/python
ln -s /usr/local/bin/pip3 /usr/bin/pip
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
COMMANDLINE_ARGS=--skip-torch-cuda-test --precision full --no-half --lowvram
weibu.py中将shared.demo.launch()第一行
改为share=True
pip install -r requirements.txt
pip install -r requirements_versions.txt
pip install basicsr
pip install facexlib
pip install -r requirements.txt
python setup.py develop
# If you want to enhance the background (non-face) regions with Real-ESRGAN,
# you also need to install the realesrgan package
pip install realesrgan
--skip-torch-cuda-test --upcast-sampling --use-cpu interrogate
./webui.sh --listen --no-half
add-apt-repository ppa:deadsnakes/ppa
apt update
apt install python3.10
Failed to build these modules: _ctypes
yum install libffi-devel
$ ./configure --prefix=/usr/local/python3 --enable-optimizations
$ make
$ make install
yum install -y xz-devel
pip install backports.lzma
yum install mesa-libGL
/home/hero/stable-diffusion-webui/venv/bin/python3 -m pip install --upgrade torchvision==0.2.2
systemctl status firewalld
systemctl stop firewalld
yum install -y iptables-services
systemctl start iptables
systemctl status iptables
cp -a /etc/sysconfig/iptables /etc/sysconfig/iptables.bak
iptables -I INPUT -p tcp --dport 7860 -m state --state NEW -j ACCEPT
iptables-save > /etc/sysconfig/iptables
systemctl enable iptables.service
systemctl enable iptables.service
systemctl reboot
netstat -tulpen
iptables -L
iptables -A INPUT -p tcp --dport 7860 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 7860 -j ACCEPT
~/stable-diffusion-webui/webui.sh --listen
vi /etc/sysconfig/iptables