CentOS安装Stable Diffusion教程

AI技术
小华
2025-04-18

在CentOS上安装Stable Diffusion涉及多个步骤,包括安装必要的软件包、配置环境、下载和运行Stable Diffusion WebUI等。以下是一个详细的安装教程:

安装前准备

  1. 更新系统
sudo yum update -y
  1. 安装Git
sudo yum install git -y
  1. 安装Python 3.10.6
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
  1. 安装Homebrew(用于安装其他依赖):
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
  1. 安装必要的依赖库
brew install cmake protobuf rust

安装Stable Diffusion WebUI

  1. 下载WebUI脚本
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
chmod +x webui.sh
  1. 运行WebUI安装脚本
./webui.sh
  1. 启动Stable Diffusion WebUI

进入stable-diffusion-webui目录,运行:

cd stable-diffusion-webui
./webui.sh

安装完成后,你可以在浏览器中访问http://127.0.0.1:7860来使用Stable Diffusion WebUI。
请注意,以上步骤是一个大致的指南,具体的安装过程可能会因系统配置和网络环境的不同而有所差异。如果在安装过程中遇到问题,可以参考相关的教程或在社区寻求帮助。

亿速云提供售前/售后服务

售前业务咨询

售后技术保障

400-100-2938

7*24小时售后电话

官方微信小程序