私有部署stable-diffusion-webui

1. 摘要

在Linux(显卡V100)上GPU部署stable-diffusion-webui v1.10.1。

在mac(不带GPU)上CPU部署stable-diffusion-webui v1.10.1。

2. 安装依赖

sudo apt update

sudo apt install git python3-venv libgl1 libglib2.0-0

3. 配置webui-user.sh

install_dir="/root/autodl-tmp/workspace"

clone_dir="stable-diffusion-webui"

export COMMANDLINE_ARGS="--medvram --autolaunch --deepdanbooru --xformers --enable-insecure-extension-access --api --listen --port 7860"

python_cmd="python3"

venv_dir="venv"

4. 配置webui-user-api.sh

如果想要api访问,需要配置webui-user-api.sh

install_dir="/root/autodl-tmp/workspace"

clone_dir="stable-diffusion-webui"

export COMMANDLINE_ARGS="--nowebui --medvram --autolaunch --deepdanbooru --xformers --enable-insecure-extension-access --api --listen --port 7861"

python_cmd="python3"

venv_dir="venv"

5. 开始安装

conda create -n sd-1.10.1 python=3.10.8

conda activate sd-1.10.1

bash ./webui-user.sh (如果是api安装,需要运行bash ./webui-user-api.sh )

bash ./webui.sh (第一次安装建议梯子,报错多为网络中断,需要重新运行多次)

6. 安装过程中可能出现的报错

ERROR: This script must not be launched as root, aborting...

方法一: 运行 bash webui.sh如果是root用户,需要注释掉webui.sh中关于root权限的判断。

在100行附近

方法二:bash ./webui.sh -f

6.1 远程打开页面

http://ip:7860

7. mac cpu安装

7.1 配置webui-macos-env.sh

####################################################################

#export install_dir="$HOME"

export install_dir="/Volumes/Elements/workspace"

#export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate"

#export PYTORCH_ENABLE_MPS_FALLBACK=1

export CUDA_VISIBLE_DEVICES=-1

export COMMANDLINE_ARGS="--use-cpu all --no-half --precision full --skip-torch-cuda-test"

if [[ "(sysctl -n machdep.cpu.brand_string)" =\~ \^.\*"Intel".\* ]]; then

export TORCH_COMMAND="pip install torch==2.1.2 torchvision==0.16.2"

else

export TORCH_COMMAND="pip install torch==2.3.1 torchvision==0.18.1"

fi

####################################################################

7.2 运行

sh webui-macos-env.sh

sh webui.sh (全程开梯子)

7.3 本地打开页面

http://127.0.0.1:7860

8. 文生图

best quality, photograph, lens flare,Far focal length,

On the sunny grassy edge, A pretty girl's face, long hair ,bright smile

missing fingers

相关推荐
API流转日记11 小时前
对接gemini-2.5-flash-image-preview教程
人工智能·gpt·ai·chatgpt·ai作画
Tiger Z15 小时前
《动手学深度学习v2》学习笔记 | 2.4 微积分 & 2.5 自动微分
pytorch·深度学习·ai
先做个垃圾出来………16 小时前
PyTorch 模型文件介绍
人工智能·pytorch·python
我不是小upper17 小时前
一文详解深度学习中神经网络的各层结构与功能!
人工智能·pytorch·深度学习
weixin_4684668518 小时前
电磁波成像(X射线、CT成像)原理简介
图像处理·相机·ct·视觉·pet·x射线·成像原理
LLM精进之路18 小时前
美团发布 | LongCat-Flash最全解读,硬刚GPT-4.1、Kimi!
人工智能·深度学习·机器学习·语言模型·transformer
钱彬 (Qian Bin)19 小时前
一文掌握工业缺陷检测项目实战(Pytorch算法训练、部署、C++ DLL制作、Qt集成)
c++·pytorch·python·qt·实战·工业缺陷检测·faster rcnn
THMAIL20 小时前
机器学习从入门到精通 - Transformer颠覆者:BERT与预训练模型实战解析
python·随机森林·机器学习·分类·bootstrap·bert·transformer
vvilkim20 小时前
PyTorch 中的循环神经网络 (RNN/LSTM):时序数据处理实战指南
pytorch·rnn·lstm
PixelMind21 小时前
【IQA技术专题】 多尺度的transformer网络IQA:MUSIQ
深度学习·transformer·图像质量评价·iqa