在CentOS上安装Stable Diffusion涉及多个步骤,包括安装必要的软件包、配置环境、下载和运行Stable Diffusion WebUI等。以下是一个详细的安装教程:
sudo yum update -ysudo yum install -y git python3 python3-pip python3-devel gccpython3 -m venv stable-diffusion-env
source stable-diffusion-env/bin/activatepip install --upgrade pipgit clone https://github.com/CompVis/stable-diffusion.git
cd stable-diffusionpip 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://127.0.0.1:8000 即可使用Stable Diffusion WebUI。
echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
source ~/.bashrc通过以上步骤,你应该能够在CentOS上成功安装并运行Stable Diffusion。如果在过程中遇到问题,可以参考相关的教程或社区支持。