• 首页 > 
  • AI技术 > 
  • 如何快速在Linux部署Stable Diffusion

如何快速在Linux部署Stable Diffusion

AI技术
小华
2025-08-06

以下是在Linux快速部署Stable Diffusion的方法:

Ubuntu系统

  1. 安装基础软件:sudo apt install git python3 python3-pip python3-venv。
  2. 克隆仓库:git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git。
  3. 创建并激活虚拟环境:python3 -m venv venv,source venv/bin/activate。
  4. 安装依赖:pip install -r requirements.txt。
  5. 下载模型:可从Hugging Face等网站下载,如wget -c https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors -O /models/Stable-diffusion/v1-5-pruned-emaonly.safetensors。
  6. 启动服务:./webui.sh。

CentOS系统

  1. 更新系统并安装依赖:sudo yum update -y,sudo yum install -y git python3 python3-pip等。
  2. 克隆仓库:git clone https://github.com/CompVis/stable-diffusion.git。
  3. 安装依赖库:pip install -r requirements.txt。
  4. 下载模型(可选):如wget https://huggingface.co/CompVis/stable-diffusion-v1-5/resolve/main/dreambooth-v2.1.pt。
  5. 启动Web服务器:python run.py --model dreambooth-v2.1.pt --port 8000。
亿速云提供售前/售后服务

售前业务咨询

售后技术保障

400-100-2938

7*24小时售后电话

官方微信小程序