私有部署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

相关推荐
Tech Synapse1 小时前
深度解析3D模型生成器:基于StyleGAN3与PyTorch3D的多风格生成工具开发实战
人工智能·pytorch·深度学习·3d
scdifsn5 小时前
动手学深度学习12.6. 多GPU的简洁实现-笔记&练习(PyTorch)
pytorch·笔记·深度学习
缘友一世6 小时前
PyTorch可视化工具——使用Visdom进行深度学习可视化
人工智能·pytorch·深度学习
老唐7779 小时前
PyTorch的基本操作
人工智能·pytorch·python·深度学习·神经网络·机器学习·计算机视觉
lingxiao1688810 小时前
相机标定与图像处理涉及的核心坐标系
图像处理·计算机视觉·halcon
九章云极AladdinEdu10 小时前
光子神经网络加速器编程范式研究:光子矩阵乘法的误差传播模型构建
开发语言·人工智能·深度学习·神经网络·矩阵·负载均衡·transformer
缘友一世13 小时前
PyTorch图像建模(图像识别、分割和分类案例)
人工智能·pytorch·分类
鸭鸭鸭进京赶烤14 小时前
第六届电子通讯与人工智能国际学术会议(ICECAI 2025)
大数据·图像处理·人工智能·hadoop·机器学习·数据挖掘
莱茵菜苗15 小时前
Python打卡训练营day33——2025.05.22
人工智能·pytorch·神经网络
非小号16 小时前
sklearn分类场景案例01
人工智能·pytorch·python·机器学习·scikit-learn