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

相关推荐
朗锐智科_机器视觉6 小时前
钢铁冶金视觉检测实战:从高温连铸坯到冷轧带钢的完整方案设计
视觉检测·机器视觉·工业相机·硬件选型·朗锐智科·钢铁冶金
楚山之石8 小时前
【Lancet Neurology 】多发性硬化认知障碍的 SDMT 筛查、灰质萎缩标志与认知康复循证路径
图像处理·人工智能·学习·mri
燃烧的枫8 小时前
Windows 下 YOLO11 Det 的 TensorRT C++ 部署
pytorch·windows·tensorrt·关键点识别·yolo11
DevOps老兵9 小时前
Transformer拆解01:Transformer为什么出现,RNN到底卡在哪里
rnn·深度学习·大模型·transformer·注意力机制
沃达德软件13 小时前
智慧无人机图像识别分析技术
人工智能·目标检测·计算机视觉·目标跟踪·视觉检测·无人机
田里的水稻16 小时前
FA_CNN卷积神经网络十八---感知机到多层感知机PyTorch
人工智能·pytorch·python
听风吹等浪起17 小时前
第27章:EfficientNet全家桶|钢材表面6类缺陷分类完整Pytorch实现
pytorch·分类·数据挖掘
Ivanqhz18 小时前
MoE + LLM 应用
数据库·人工智能·pytorch·python·深度学习·算法·1024程序员节
江苏久众新视19 小时前
SOP流程AI视觉检测实战案例:基于安防相机与本地AI的产线防错防漏方案落地分享
人工智能·数码相机·视觉检测
TMedical1 天前
MedPlanning 截骨模拟矫形功能
c++·图像处理·人工智能·qt·健康医疗