Ubuntu 安装 stable-diffusion-webui-docker 常见问题处理方法

安装 Stable Diffusion WebUI Docker

工程地址

https://github.com/AbdBarho/stable-diffusion-webui-docker
第一步是 git clone 下来

Setup

阅读 README 中的 setup,进入页面 https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup

docker compose --profile download up --build
# wait until its done, then:
docker compose --profile [ui] up --build
# where [ui] is one of: auto | auto-cpu | comfy | comfy-cpu

所以,先确保安装了 docker compose,注意,不是 docker-compose

docker compose 安装方法

  1. 进入 docker compose release
  2. 找到对应的版本v2.33.1
  3. 运行安装命令
curl -L https://github.com/docker/compose/releases/download/v2.33.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/lib/docker/cli-plugins/docker-composechmod +x /usr/local/lib/docker/cli-plugins/docker-compose
  1. docker compose --version 验证

docker compose --profile download up --build

异常日志如下:

02/26 02:37:49 [NOTICE] Download complete: /data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
download-1  |
download-1  | Download Results:
download-1  | gid   |stat|avg speed  |path/URI
download-1  | ======+====+===========+=======================================================
download-1  | 142eb3|OK  |   283KiB/s|/data/models/RealESRGAN/RealESRGAN_x4plus.pth
download-1  | 3c541d|OK  |   1.0MiB/s|/data/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt
download-1  | 866f5f|OK  |   233KiB/s|/data/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
download-1  | 6a2f36|ERR |   739KiB/s|/data/models/GFPGAN/GFPGANv1.4.pth
download-1  | 70690b|ERR |       0B/s|/data/models/LDSR/project.yaml
download-1  | 4d1403|ERR |       0B/s|/data/models/LDSR/model.ckpt
download-1  | 466742|OK  |   3.3MiB/s|/data/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
download-1  | 849731|OK  |   2.7MiB/s|/data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
download-1  |
download-1  | Status Legend:
download-1  | (OK):download completed.(ERR):error occurred.
download-1  |
download-1  | aria2 will resume download if the transfer is restarted.
download-1  | If there are any errors, then see the log file. See '-l' option in help/man page for details.
download-1 exited with code 2

重复运行该命令,直至成功,成功日志如下:

02/26 02:50:02 [NOTICE] Download complete: /data/models/LDSR/model.ckpt
download-1  |
download-1  | Download Results:
download-1  | gid   |stat|avg speed  |path/URI
download-1  | ======+====+===========+=======================================================
download-1  | d12a9e|OK  |       0B/s|/data/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt
download-1  | 5e7060|OK  |       0B/s|/data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
download-1  | 00f3d6|OK  |       0B/s|/data/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
download-1  | 274faa|OK  |       0B/s|/data/models/RealESRGAN/RealESRGAN_x4plus.pth
download-1  | 5a2243|OK  |       0B/s|/data/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth
download-1  | b8ba07|OK  |   1.8MiB/s|/data/models/LDSR/project.yaml
download-1  | bcb67a|OK  |   880KiB/s|/data/models/GFPGAN/GFPGANv1.4.pth
download-1  | d31924|OK  |   4.3MiB/s|/data/models/LDSR/model.ckpt
download-1  |
download-1  | Status Legend:
download-1  | (OK):download completed.
download-1  | Checking SHAs...
download-1  | /data/models/LDSR/project.yaml: OK
download-1  | /data/models/RealESRGAN/RealESRGAN_x4plus_anime_6B.pth: OK
download-1  | /data/models/RealESRGAN/RealESRGAN_x4plus.pth: OK
download-1  | /data/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt: OK
download-1  | /data/models/GFPGAN/GFPGANv1.4.pth: OK
download-1  | /data/models/LDSR/model.ckpt: OK
download-1  | /data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt: OK
download-1  | /data/models/Stable-diffusion/sd-v1-5-inpainting.ckpt: OK
download-1  | By using this software, you agree to the following licenses:
download-1  | https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/LICENSE
download-1  | https://github.com/CompVis/stable-diffusion/blob/main/LICENSE
download-1  | https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/LICENSE.txt
download-1  | https://github.com/invoke-ai/InvokeAI/blob/main/LICENSE
download-1  | And licenses of all UIs, third party libraries, and extensions.
download-1 exited with code 0

docker compose --profile [ui] up --build

运行命令如下

docker compose --profile auto up --build

报错如下

./clone.sh stable-diffusion-stability-ai

=> ERROR [auto download 4/9] RUN . /clone.sh stable-diffusion-stability-ai https://github.com/Stability-AI/stablediffusion.git cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf   && rm -rf assets data/**/*.png data/**/*.jpg data/**/*.gif  75.8s
------> [auto download 4/9] RUN . /clone.sh stable-diffusion-stability-ai https://github.com/Stability-AI/stablediffusion.git cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf   && rm -rf assets data/**/*.png data/**/*.jpg data/**/*.gif:
2.567 + mkdir -p /repositories/stable-diffusion-stability-ai
2.568 + cd /repositories/stable-diffusion-stability-ai
2.568 + git init
2.570 hint: Using 'master' as the name for the initial branch. This default branch name
2.570 hint: is subject to change. To configure the initial branch name to use in all
2.570 hint: of your new repositories, which will suppress this warning, call:
2.570 hint:
2.570 hint:     git config --global init.defaultBranch <name>
2.570 hint:
2.570 hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2.570 hint: 'development'. The just-created branch can be renamed via this command:
2.570 hint:
2.570 hint:     git branch -m <name>
2.571 Initialized empty Git repository in /repositories/stable-diffusion-stability-ai/.git/
2.571 + git remote add origin https://github.com/Stability-AI/stablediffusion.git
2.573 + git fetch origin cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf '--depth=1'
75.70 error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
75.70 error: 3601 bytes of body are still expected
75.71 fetch-pack: unexpected disconnect while reading sideband packet
75.71 fatal: early EOF
75.71 fatal: fetch-pack: invalid index-pack output
------
failed to solve: executor failed running [/bin/sh -c . /clone.sh stable-diffusion-stability-ai https://github.com/Stability-AI/stablediffusion.git cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf   && rm -rf assets data/**/*.png data/**/*.jpg data/**/*.gif]: exit code: 128

详见 https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/657 ,需要修改两点:

  1. 编辑 /stable-diffusion-webui-docker/services/AUTOMATIC1111/Dockerfile,将 FROM alpine/git:2.36.2 修改为 FROM alpine/git:2.43.0
  2. 编辑 /stable-diffusion-webui-docker/services/AUTOMATIC1111/clone.sh,在行末加上 sleep 200s,如果还是不行,适当扩大 200s,取决于现场网络条件。

ImportError: cannot import name ‘TypeIs’ from ‘typing_extensions’

auto-1  |     from .plugin_registry import PluginRegistry
auto-1  |   File "/opt/conda/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 13, in <module>
auto-1  |     from typing_extensions import TypeIs
auto-1  | ImportError: cannot import name 'TypeIs' from 'typing_extensions' (/opt/conda/lib/python3.10/site-packages/typing_extensions.py)
auto-1 exited with code 1

解决方案详见 https://github.com/AbdBarho/stable-diffusion-webui-docker/issues/729
修改 /stable-diffusion-webui-docker/services/AUTOMATIC1111/Dockerfile, 如下

WORKDIR /
RUN --mount=type=cache,target=/root/.cache/pip \git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git && \cd stable-diffusion-webui && \git reset --hard v1.9.4 && \pip install -r requirements_versions.txt && \pip install --upgrade typing-extensions

The NVIDIA driver on your system is too old (found version 11040)

auto-1  | Installing extension dependencies (if any)
auto-1  | /opt/conda/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
auto-1  |   warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
auto-1  | no module 'xformers'. Processing without...
auto-1  | no module 'xformers'. Processing without...
auto-1  | No module 'xformers'. Proceeding without it.
auto-1  | The NVIDIA driver on your system is too old (found version 11040). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.: str
auto-1  | Traceback (most recent call last):
auto-1  |   File "/stable-diffusion-webui/modules/errors.py", line 98, in run
auto-1  |     code()
auto-1  |   File "/stable-diffusion-webui/modules/devices.py", line 106, in enable_tf32
auto-1  |     if cuda_no_autocast():
auto-1  |   File "/stable-diffusion-webui/modules/devices.py", line 28, in cuda_no_autocast
auto-1  |     device_id = get_cuda_device_id()
auto-1  |   File "/stable-diffusion-webui/modules/devices.py", line 40, in get_cuda_device_id
auto-1  |     ) or torch.cuda.current_device()
auto-1  |   File "/opt/conda/lib/python3.10/site-packages/torch/cuda/__init__.py", line 778, in current_device
auto-1  |     _lazy_init()
auto-1  |   File "/opt/conda/lib/python3.10/site-packages/torch/cuda/__init__.py", line 293, in _lazy_init
auto-1  |     torch._C._cuda_init()
auto-1  | RuntimeError: The NVIDIA driver on your system is too old (found version 11040). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.
auto-1  |
auto-1  | During handling of the above exception, another exception occurred:
auto-1  |
auto-1  | Traceback (most recent call last):
auto-1  |   File "/stable-diffusion-webui/webui.py", line 13, in <module>
auto-1  |     initialize.imports()
auto-1  |   File "/stable-diffusion-webui/modules/initialize.py", line 36, in imports
auto-1  |     shared_init.initialize()
auto-1  |   File "/stable-diffusion-webui/modules/shared_init.py", line 17, in initialize
auto-1  |     from modules import options, shared_options
auto-1  |   File "/stable-diffusion-webui/modules/shared_options.py", line 4, in <module>
auto-1  |     from modules import localization, ui_components, shared_items, shared, interrogate, shared_gradio_themes, util, sd_emphasis
auto-1  |   File "/stable-diffusion-webui/modules/interrogate.py", line 13, in <module>
auto-1  |     from modules import devices, paths, shared, lowvram, modelloader, errors, torch_utils
auto-1  |   File "/stable-diffusion-webui/modules/devices.py", line 113, in <module>
auto-1  |     errors.run(enable_tf32, "Enabling TF32")
auto-1  |   File "/stable-diffusion-webui/modules/errors.py", line 100, in run
auto-1  |     display(task, e)
auto-1  |   File "/stable-diffusion-webui/modules/errors.py", line 68, in display
auto-1  |     te = traceback.TracebackException.from_exception(e)
auto-1  |   File "/opt/conda/lib/python3.10/traceback.py", line 572, in from_exception
auto-1  |     return cls(type(exc), exc, exc.__traceback__, *args, **kwargs)
auto-1  | AttributeError: 'str' object has no attribute '__traceback__'
auto-1 exited with code 1

遇到这类报错的原因是,pytorch 与 服务器上的显卡驱动版本不一致,要么升级服务器显卡驱动,要么修改 /stable-diffusion-webui-docker/services/AUTOMATIC1111/Dockerfile 中的 pytorch 镜像

FROM pytorch/pytorch:2.3.0-cuda11.8-cudnn8-runtime

实际上,这一步应该放在第一步执行

WARNING[XFORMERS]: xFormers can’t load C++/CUDA extensions. xFormers was built for:

auto-1  | Installing extension dependencies (if any)
auto-1  | /opt/conda/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
auto-1  |   warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
auto-1  | WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
auto-1  |     PyTorch 2.3.0+cu121 with CUDA 1201 (you have 2.3.0)
auto-1  |     Python  3.10.14 (you have 3.10.14)
auto-1  |   Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
auto-1  |   Memory-efficient attention, SwiGLU, sparse and more won't be available.
auto-1  |   Set XFORMERS_MORE_DETAILS=1 for more details

出现这个异常报警一般是显卡和 xfomers 版本不一致导致,详见 https://github.com/facebookresearch/xformers#installing-xformers,找到正确的版本(比如 pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu118),修改

RUN --mount=type=cache,target=/root/.cache/pip \pip install pyngrok xformers==0.0.26.post1 \git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \git+https://github.com/mlfoundations/open_clip.git@v2.20.0

RUN --mount=type=cache,target=/root/.cache/pip \pip install pyngrok \git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \git+https://github.com/mlfoundations/open_clip.git@v2.20.0RUN --mount=type=cache,target=/root/.cache/pip pip install xformers==0.0.26.post1 --index-url https://download.pytorch.org/whl/cu118

再次运行 docker compose --profile auto up --build 后,启动正常

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/27533.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

JavaWeb-jdk17安装

下载jdk17 地址&#xff1a;https://www.oracle.com/java/technologies/downloads/#jdk17-windows 安装jdk 配置环境变量 右键点击我的电脑>属性>高级系统设置>环境变量 在系统变量Path变量中添加 测试 java -version javac -version

java后端开发day24--阶段项目(一)

&#xff08;以下内容全部来自上述课程&#xff09; GUI&#xff1a;Graphical User Interface 图形用户接口&#xff0c;采取图形化的方式显示操作界面 分为两套体系&#xff1a;AWT包&#xff08;有兼容问题&#xff09;和Swing包&#xff08;常用&#xff09; 拼图小游戏…

[Web 安全] PHP 反序列化漏洞 —— PHP 魔术方法

关注这个专栏的其他相关笔记&#xff1a;[Web 安全] 反序列化漏洞 - 学习笔记-CSDN博客 PHP 魔术方法 - 简介 - PHP 魔术方法 - 简单教程&#xff0c;简单编程PHP 中&#xff0c;以两个下划线 ( __ ) 开头方法称之为 「 魔术方法 」 这些 「 魔术方法 」 在 [PHP](/l/yufei/php…

【音视频】音频基础

一、音频基础 1.1 声音的物理性质 ——振动 声音是一种由物体振动引发的物理现象&#xff0c;如小提琴的弦声等。物体的振动使其四周空气的压强产生变化&#xff0c;这种忽强忽弱变化以波的形式向四周传播&#xff0c;当被人耳所接收时&#xff0c;我们就听见了声音。 1.2 声…

Hive-04之存储格式、SerDe、企业级调优

一、主题 hive表的数据压缩和文件存储格式hive的自定义UDF函数hive的JDBC代码操作hive的SerDe介绍和使用hive的优化 二、要点 1. hive表的文件存储格式 Hive支持的存储数的格式主要有&#xff1a;TEXTFILE&#xff08;行式存储&#xff09; 、SEQUENCEFILE(行式存储)、ORC&…

人工智能AI在汽车设计领域的应用探索

我是穿拖鞋的汉子&#xff0c;魔都中坚持长期主义的汽车电子工程师。 老规矩&#xff0c;分享一段喜欢的文字&#xff0c;避免自己成为高知识低文化的工程师&#xff1a; 简单&#xff0c;单纯&#xff0c;喜欢独处&#xff0c;独来独往&#xff0c;不易合同频过着接地气的生活…

基于SpringBoot的“数据驱动的资产管理系统站”的设计与实现(源码+数据库+文档+PPT)

基于SpringBoot的“数据驱动的资产管理系统站”的设计与实现&#xff08;源码数据库文档PPT) 开发语言&#xff1a;Java 数据库&#xff1a;MySQL 技术&#xff1a;SpringBoot 工具&#xff1a;IDEA/Ecilpse、Navicat、Maven 系统展示 系统功能结构图 局部E-R图 系统登录界…

矩阵压缩存储

矩阵压缩存储 特殊矩阵和稀疏矩阵 特殊矩阵:矩阵中很多值相同的元素并且分布具有一定规律。 稀疏矩阵:矩阵中有很多零元素。 压缩矩阵的基本思想&#xff1a; (1)为多个值相同的元素只分配一个存储空间&#xff1b; (2)对零元素不分配存储空间。 一.特殊矩阵的压缩存储 对…

算法系列之数据结构-二叉树

在计算机科学中&#xff0c;数据结构是组织和存储数据的方式&#xff0c;以便能够高效地访问和修改数据。树&#xff08;Tree&#xff09;是一种非常重要的非线性数据结构&#xff0c;广泛应用于各种算法和应用中。本文将详细介绍树的基本概念、常见类型以及用Java实现树的遍历…

Golang的数据库分库分表

# Golang的数据库分库分表 什么是数据库分库分表 数据库分库分表是指将单一的数据库拆分成多个库&#xff0c;每个库中包含多张表&#xff0c;以提高数据库的性能和可伸缩性。通常在大型应用中&#xff0c;单一的数据库往往无法满足高并发和海量数据的需求&#xff0c;因此需要…

FPGA开发,使用Deepseek V3还是R1(3):系统级与RTL级

以下都是Deepseek生成的答案 FPGA开发&#xff0c;使用Deepseek V3还是R1&#xff08;1&#xff09;&#xff1a;应用场景 FPGA开发&#xff0c;使用Deepseek V3还是R1&#xff08;2&#xff09;&#xff1a;V3和R1的区别 FPGA开发&#xff0c;使用Deepseek V3还是R1&#x…

探索Elasticsearch:文档的CRUD

在企业环境中&#xff0c;Elasticsearch对文档操作的支持不仅是实现高效搜索的关键&#xff0c;更是数据驱动决策的重要支柱。它通过强大的索引机制和灵活的查询语言&#xff0c;使企业能够实时处理和分析海量文档数据&#xff0c;迅速获取有价值的洞察&#xff0c;从而加速创新…

数组中的逆序对(C++)

目录 1 问题描述 1.1 输入描述&#xff1a; 1.2 示例1 1.3 示例2 2 解题思路 2.1 暴力解法 2.2 归并排序法 3 代码实现 3.1 暴力解法 3.2 归并排序法 4 代码解析 4.1 暴力解法 4.1.1 初始化 4.1.2 判断是否是逆序对 4.2 归并排序法 4.2.1 InversePairs 主函数 …

Spring Boot全局异常处理:“危机公关”团队

目录 一、全局异常处理的作用二、Spring Boot 实现全局异常处理&#xff08;附上代码实例&#xff09;三、总结&#xff1a; &#x1f31f;我的其他文章也讲解的比较有趣&#x1f601;&#xff0c;如果喜欢博主的讲解方式&#xff0c;可以多多支持一下&#xff0c;感谢&#x1…

数据集/API 笔记 新加坡相对湿度数据

data.gov.sg 数据时间范围&#xff1a;2016年11月 - 2025年3月 新加坡国家环境局 (NEA) 每分钟记录各个气象站的相对湿度数据&#xff0c;每五分钟更新一次。 数据由自动气象仪器采集&#xff0c;并在生成后立即自动发布。由于技术问题&#xff0c;数据可能会有缺失的情况。…

【前端基础】2、HTML的元素(基础说明)

一、元素概述 HTML本质是元素组成。 元素是网页的一部分。一个元素可以包含一个数据项&#xff0c;或者一块文本&#xff0c;或者一个图片&#xff0c;或者什么都不包含。 二、元素的组成 开始标签&#xff0c;结束标签&#xff0c;内容&#xff0c;组成一个完整元素。 三…

基于深度学习的网络摄像头图像实时分类实践:从理论到完整实现

引言&#xff1a;智能视觉感知的新可能 在人工智能技术蓬勃发展的今天&#xff0c;实时图像分类作为计算机视觉的基础任务之一&#xff0c;正在深刻改变着我们的生活。从智能手机的人脸解锁到无人超市的自动结算系统&#xff0c;从工业质检的缺陷检测到医疗影像的辅助诊断&…

Linux-计算机网络.udp

1.收发函数: read&#xff08;&#xff09;/write () ///通用文件读写&#xff0c;可以操作套接字。 recv(,0) /send(,0) ///TCP 常用套机字读写 recvfrom()/sendto() ///UDP 常用套接字读写 ssize_t recv(int sockfd, void *buf, size_t len, …

如何安装VM虚拟机

安装 VMware 附官方下载链接&#xff08;VM 17 pro&#xff09;&#xff1a;https://download3.vmware.com/software/WKST-1701-WIN/VMware-workstation-full-17.0.1-21139696.exe 打开下载好的VMware Workstation 17 Pro安装包&#xff1b; 点击下一步&#xff1b; 勾选我接…

js的简单介绍

一.javascript&#xff08;是什么&#xff09; 是一种运行在客户端(浏览器)的编程语言&#xff0c;实现人机交互效果 作用 网页特效&#xff08;监听客户的一些行为让网页做出对应的反馈&#xff09;表单验证(针对表格数据的合法性进行判断)数据交互(获取后台的数据&#xf…