1.安装conda
我这用 minicoda
2.服务器配置
SD运行需要内存在12G左右,加上预留,总内存需要再16G,不够的需要配置下虚拟内存。
本机内存32G
3.拉取WebUI
$ git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
$ cd stable-diffusion-webui
4.安装依赖
pip install torch torchvision torchaudio
pip install -r requirements.txt
pip install xformers
yum install google-perftools
#更新git
yum -y remove git
yum -y remove git-*
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum -y install git
5.修改配置 webui.sh
use_venv=1 改为 use_venv=0 #使用conda环境不新建
can_run_as_root = 0 改为 can_run_as_root=1 #启用root运行
#在头部增加
export CUDA_VISIBLE_DEVICES=-1
export COMMANDLINE_ARGS="--use-cpu all --no-half --precision full --skip-torch-cuda-test --share --listen --port 7777 --enable-insecure-extension-access"
#--use-cpu CPU模式
# --no-half --precision 非半精度
#--skip-torch-cuda-test
#--share #公开
#--listen #开启监听
#--port 设定端口
#--enable-insecure-extension-access 开启扩展模块
6.启动
./webui.sh