在CentOS上安装和配置Stable Diffusion涉及多个步骤,以下是一个详细的指南:
sudo yum update -y
sudo yum install git python3 git-devel openssl-devel zlib-devel libffi-devel cmake protobuf rust -y
cd /usr/local
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz
tar -zxvf Python-3.10.6.tgz
cd Python-3.10.6
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl --with-openssl-rpathauto
make -j$(nproc)
sudo make install
sudo ln -s /usr/local/python3/bin/python3.10 /usr/bin/python3
sudo ln -s /usr/local/python3/bin/pip3.10 /usr/bin/pip3
pip3 install --upgrade pip
git clone https://github.com/CompVis/stable-diffusion.git
cd stable-diffusion
pip install -r requirements.txt
如果你希望直接使用预训练模型,可以下载并解压。例如,下载DreamBooth V2.1模型:
wget https://huggingface.co/CompVis/stable-diffusion-v1-5/resolve/main/dreambooth-v2.1.pt
在项目根目录下运行以下命令启动Web服务器:
python run.py --model dreambooth-v2.1.pt --port 8000
打开浏览器,访问 http://localhost:8000
即可使用Stable Diffusion WebUI。
可以从Stable Diffusion中文网下载秋叶整合包。
unzip Stable Diffusion_整合包.zip -d /path/to/destination
解压完成后,进入解压目录,运行以下命令启动WebUI:
cd /path/to/destination
./webui.sh
通过以上步骤,你应该能够在CentOS上成功安装并运行Stable Diffusion。如果在安装过程中遇到问题,可以参考相关的教程或社区支持。