本地部署StableDiffusion WebUI

1. 参考:

How To Run Stable Diffusion 2.0 On Your Local PC — No Code Guide
https://luminous-mapusaurus-1aa.notion.site/Stable-Diffusion-ce61d77468644806ab03a780f670df51
stable-diffusion-webui 安装_w3cschool
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

2. 安装步骤

2.1 conda换源

为了让conda执行下载指令加速,需要对conda换源操作,即将源由国外原始源,改为国内源;
Windows 用户无法直接创建名为 .condarc 的文件,可先执行 conda config --set show_channel_urls yes 生成该文件之后再修改。
.condarc文件编辑如下:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
ssl_verify: true

2.2 安装pytorch

注意如果需要pytorch, 还需要添加pytorch的镜像

$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

$ conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
https://luminous-mapusaurus-1aa.notion.site/Stable-Diffusion-ce61d77468644806ab03a780f670df51

2.3 安装python 3.10.6虚拟开发环境

$conda create --name python3106_sd2 python=3.10.6
...
#
# To activate this environment, use
#
#     $ conda activate python3106_sd2
#
# To deactivate an active environment, use
#
#     $ conda deactivate

2.4 pip安装依赖库

$pip install -r requirements_versions.txt # 执行此条命令前,请检查你的剩余磁盘空间

2.5 执行批处理

.\webui-user.bat 

3. FAQ

3.1 got an unexpected keyword argument ‘personalization_config’

[图片]

参考:
https://github.com/XavierXiao/Dreambooth-Stable-Diffusion/issues/92
[Fixed]
re-use pip install -e . work for me.

3.2 RuntimeError: CUDA out of memory. Tried to allocate 4.00 GiB (GPU 0; 12.00 GiB total capacity; 8.31 GiB already allocated; 1012.77 MiB free; 8.49 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

参考:
https://stackoverflow.com/questions/73747731/runtimeerror-cuda-out-of-memory-how-setting-max-split-size-mb
https://huggingface.co/spaces/stabilityai/stable-diffusion/discussions/21
[fixed]
try using --W 256 --H 256 as part your prompt.
在这里插入图片描述
在这里插入图片描述

3.3 AttributeError: module ‘signal’ has no attribute ‘SIGUSR1’

[图片]

[fixed]
https://github.com/rinongal/textual_inversion/issues/12
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

7.4 NameError: name ‘trainer’ is not defined
在这里插入图片描述

参考:
https://github.com/rinongal/textual_inversion/issues/84

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值