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

相关推荐
wyg_03111312 小时前
从0搭建极简transformer大模型
人工智能·深度学习·transformer
杰瑞学AI21 小时前
一个回答需要10分钟:飞书问答机器人踩坑实录——纯Agent自由检索,差点让我们的机器人“难产”
人工智能·机器人·prompt·transformer·飞书·ai-native
Microvision维视智造1 天前
行业洞察系列 06 | 汽车制造的视觉革命
人工智能·计算机视觉·汽车·视觉检测·制造·机器视觉
(轻舟已过万重山)1 天前
第14章 框架实操:用 PyTorch 跑通一个完整深度学习项目
人工智能·pytorch·深度学习
sali-tec2 天前
C# 基于OpenCv的视觉工作流-章99-换背景
图像处理·人工智能·opencv·算法·计算机视觉
Xiaok10182 天前
NumPy 数组 vs PyTorch Tensor
人工智能·pytorch·numpy
程序猿编码2 天前
用 C++ 从零写一个能训练的 GPT:标量自动微分 + Arena 内存池
开发语言·c++·gpt·transformer·模型推理
小燕子~~2 天前
PS 怎么调整图片尺寸?4 种方法避免拉伸变形与放大失真
图像处理·人工智能·ai·aigc·photoshop
hans汉斯3 天前
计算机科学与应用|改进MeanShift算法在智能监控视频中的应用研究
图像处理·人工智能·功能测试·深度学习·算法·音视频
tiger从容淡定是人生3 天前
生态入口之战:GPT、Gemini、Copilot与DeepSeek的战略分野
图像处理·人工智能·chatgpt·copilot·软件构建