qidao123.com技术社区-IT企服评测·应用市场

标题: “【Stable Diffusion】详解安装过程中的常见故障及办理战略“ [打印本页]

作者: 一给    时间: 2024-11-23 14:02
标题: “【Stable Diffusion】详解安装过程中的常见故障及办理战略“
前言:

在探索AI图像生成技能的过程中,Stable Diffusion webui以其强大的功能和用户友爱的界面受到了广泛接待。然而,安装和使用过程中不免会遇到各种报错问题,这些难题往往让初学者望而却步。本文旨在为广大用户提供一份详尽的Stable Diffusion webui安装使用报错指南,通过分析常见问题及其办理方案,帮助您顺利克服障碍,轻松驾御这一强大的图像生成工具,让创意无穷延伸。以下是我们的经验分享,盼望能为您带来启示。
怎样查看报错

在你安装时可能经常遇到各种各样的问题,但是对于一堆陌生的英文和各种各样的错误,大家可能经常无从下手,下面我将会教大家怎样查看报错。
  1. (base) C:\OpenAI.Wiki\stable-diffusion-webui>webui-user.bat
  2. venv “C:\OpenAI.Wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: 955df7751eef11bb7697e2d77f6b8a6226b21e13
  5. Installing clip
  6. Installing open_clip
  7. Cloning Stable Diffusion into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai…
  8. Cloning Taming Transformers into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\taming-transformers…
  9. Cloning K-diffusion into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\k-diffusion…
  10. Cloning CodeFormer into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer…
  11. Traceback (most recent call last):
  12. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 351, in
  13. prepare_environment()
  14. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 287, in prepare_environment
  15. git_clone(codeformer_repo, repo_dir(‘CodeFormer’), “CodeFormer”, codeformer_commit_hash)
  16. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 151, in git_clone
  17. run(f'”{git}” clone “{url}” “{dir}”‘, f”Cloning {name} into {dir}…”, f”Couldn’t clone {name}”)
  18. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 97, in run
  19. raise RuntimeError(message)
  20. RuntimeError: Couldn’t clone CodeFormer.
  21. Command: “git” clone “https://github.com/sczhou/CodeFormer.git” “C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer”
  22. Error code: 128
  23. stdout:
  24. stderr: Cloning into ‘C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer’…
复制代码
我们先看一下第一行内容(base) C:\OpenAI.Wiki\stable-diffusion-webui>webui-user.bat,前面的(base)是使用conda创建的虚拟环境名称,代表我们目前正在使用哪一个虚拟环境,很显然这与本站所提供的教程是不同等的,正常来说应该是(D:\openai.wiki\stable-diffusion-webui\automatic),这一串路径就是虚拟环境的名称。
第5行和第6行分别是Installing clip和Installing open_clip,这是两个依靠库。这里没有报错,因为背面是是Cloning一些其它的依靠库。
第11行Traceback (most recent call last):,这就是代表出现问题了,我们在出现问题的前一行中可以看到内容为Cloning CodeFormer into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer…,这就是代表是一步堕落了。
   这份完整版的SD整合包已经上传CSDN,朋侪们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】

网络问题
  
办理方法

本部分内容基本都是因为网络问题,大部分安装问题可以通过使用国内镜像源来办理。
比方:我们需要在执行安装requirements.txt文件时,我们可以实行使用pip install -i https://mirrors.aliyun.com/pypi/simple/ -r D:/openai.wiki/stable-diffusion-webui/requirements.txt。
这段代码可以理解为不使用官方下载地点,而是国内阿里云的镜像地点下载相干依靠组件。
如果还是不能办理,请自行搜索CMD魔法上网,有一些魔法工具即便可以访问Youtube、Google等网站,也不代表它能够在CMD中是可以正常使用的,因为有一些魔法工具无法在CMD中被继承。
Stable-Diffusion-Stability-AI
  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
  4. Cloning Stable Diffusion into D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai…
  5. Traceback (most recent call last):
  6. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 355, in
  7. prepare_environment()
  8. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 288, in prepare_environment
  9. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_commit_hash)
  10. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 151, in git_clone
  11. run(f'”{git}” clone “{url}” “{dir}”‘, f”Cloning {name} into {dir}…”, f”Couldn’t clone {name}”)
  12. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 97, in run
  13. raise RuntimeError(message)
  14. RuntimeError: Couldn’t clone Stable Diffusion.
  15. Command: “git” clone “https://github.com/Stability-AI/stablediffusion.git” “D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai”
  16. Error code: 128
  17. stdout:
  18. stderr: Cloning into ‘D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai’…
  19. fatal: unable to access ‘https://github.com/Stability-AI/stablediffusion.git/’: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
复制代码
脚本在执行git clone https://github.com/Stability-AI/stablediffusion.git命令时无法下载Stable-Diffusion-Stability-AI库。
PyPI错误

  1. note: This error originates from a subprocess, and is likely not a problem with pip.
  2. error: metadata-generation-failed
  3. Encountered error while generating package metadata.
  4. See above for output.
  5. note: This is an issue with the package mentioned above, not pip.
  6. hint: See above for details.
复制代码
PyPI元数据包有问题,可以实行执行pip cache purge清理缓存。
哈希值不正确

  1. (base) tianjihuideMBP:stable-diffusion-webui color$ ./webui.sh
  2. ################################################################
  3. Install script for stable-diffusion + Web UI
  4. Tested on Debian 11 (Bullseye)
  5. ################################################################
  6. ################################################################
  7. Running on color user
  8. ################################################################
  9. ################################################################
  10. Repo already cloned, using it as install directory
  11. ################################################################
  12. ################################################################
  13. Create and activate python venv
  14. ################################################################
  15. ################################################################
  16. Launching launch.py…
  17. ################################################################
  18. Python 3.10.10 (v3.10.10:aad5f6a891, Feb 7 2023, 08:47:40) [Clang 13.0.0 (clang-1300.0.29.30)]
  19. Commit hash:
  20. Traceback (most recent call last):
  21. File “/Users/color/stable-diffusion-webui/launch.py”, line 378, in
  22. prepare_environment()
  23. File “/Users/color/stable-diffusion-webui/launch.py”, line 315, in prepare_environment
  24. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”,
  25. File “/Users/color/stable-diffusion-webui/launch.py”, line 152, in git_clone
  26. current_hash = run(f'”{git}” -C “{dir}” rev-parse HEAD’, None,
  27. File “/Users/color/stable-diffusion-webui/launch.py”, line 105, in run
  28. raise RuntimeError(message)
  29. RuntimeError: Couldn’t determine Stable Diffusion’s hash: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e.
  30. Command: “git” -C “repositories/stable-diffusion-stability-ai” rev-parse HEAD
  31. Error code: 128
  32. stdout: HEAD
  33. stderr: fatal: ambiguous argument ‘HEAD’: unknown revision or path not in the working tree.
  34. Use ‘–‘ to separate paths from revisions, like this:
  35. ‘git […] — […]’
  36. (base) tianjihuideMBP:stable-diffusion-webui color$
复制代码
这个错误似乎是在运行一个 Python 脚本时出现的。根据输出信息来看,该脚本实行克隆一个名为 Stable Diffusion 的 git 堆栈,但是它无法确定该堆栈的哈希值。
发起删除整个项目,然后重新安装摆设。
组件不匹配

  1. ERROR: Could not find a version that satisfies the requirement opencv-contrib-python (from versions: none)
  2. ERROR: No matching distribution found for opencv-contrib-python
复制代码
这个错误信息意味着在当前使用的Python环境下,没有找到匹配的opencv-contrib-python版本。这可能是因为在PyPI上没有发布所需的版本或版本不兼容。请实行使用pip search命令来搜索可用的版本,并实行安装兼容的版本。
按道理来说,如果根据教程来安装是不会出现这个问题的,只管删除后重新来过,严酷遵守每一步。
CodeFormer

  1. (base) C:\OpenAI.Wiki\stable-diffusion-webui>webui-user.bat
  2. venv “C:\OpenAI.Wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: 955df7751eef11bb7697e2d77f6b8a6226b21e13
  5. Installing clip
  6. Installing open_clip
  7. Cloning Stable Diffusion into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai…
  8. Cloning Taming Transformers into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\taming-transformers…
  9. Cloning K-diffusion into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\k-diffusion…
  10. Cloning CodeFormer into C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer…
  11. Traceback (most recent call last):
  12. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 351, in
  13. prepare_environment()
  14. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 287, in prepare_environment
  15. git_clone(codeformer_repo, repo_dir(‘CodeFormer’), “CodeFormer”, codeformer_commit_hash)
  16. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 151, in git_clone
  17. run(f'”{git}” clone “{url}” “{dir}”‘, f”Cloning {name} into {dir}…”, f”Couldn’t clone {name}”)
  18. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 97, in run
  19. raise RuntimeError(message)
  20. RuntimeError: Couldn’t clone CodeFormer.
  21. Command: “git” clone “https://github.com/sczhou/CodeFormer.git” “C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer”
  22. Error code: 128
  23. stdout:
  24. stderr: Cloning into ‘C:\OpenAI.Wiki\stable-diffusion-webui\repositories\CodeFormer’…
复制代码
这里看起来是在克隆CodeFormer时出了问题。错误信息表明Git无法克隆该堆栈。请确保您的计算机可以访问 https://github.com/sczhou/CodeFormer.git ,并且您有权访问该堆栈。您可以实行手动克隆该堆栈以查看是否存在任何错误。
无法链接SD库

  1. venv “C:\OpenAI.Wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash: 64da5c46ef0d68b9048747c2e0d46ce3495f9f29
  4. Fetching updates for Stable Diffusion…
  5. Traceback (most recent call last):
  6. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 351, in
  7. prepare_environment()
  8. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 284, in prepare_environment
  9. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_com
  10. mit_hash)
  11. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 147, in git_clone
  12. run(f'”{git}” -C “{dir}” fetch’, f”Fetching updates for {name}…”, f”Couldn’t fetch {name}”)
  13. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 97, in run
  14. raise RuntimeError(message)
  15. RuntimeError: Couldn’t fetch Stable Diffusion.
  16. Command: “git” -C “C:\OpenAI.Wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai” fetch
  17. Error code: 128
  18. stdout:
  19. stderr: fatal: unable to access ‘https://github.com/AUTOMATIC1111/stable-diffusion-webui.git/’: OpenSSL SSL_read: Connec
  20. tion was reset, errno 10054
复制代码
这个错误信息看起来是从 Github 下载 Stable Diffusion 的时候堕落了,可能是网络毗连问题。发起查抄网络毗连是否能够正常使用魔法,
SD库不完整

  1. venv “C:\OpenAI.Wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash: 64da5c46ef0d68b9048747c2e0d46ce3495f9f29
  4. Fetching updates for Stable Diffusion…
  5. Checking out commit for Stable Diffusion with hash: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e…
  6. Traceback (most recent call last):
  7. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 351, in
  8. prepare_environment()
  9. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 284, in prepare_environment
  10. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_com
  11. mit_hash)
  12. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 148, in git_clone
  13. run(f'”{git}” -C “{dir}” checkout {commithash}’, f”Checking out commit for {name} with hash: {commithash}…”, f”Cou
  14. ldn’t checkout commit {commithash} for {name}”)
  15. File “C:\OpenAI.Wiki\stable-diffusion-webui\launch.py”, line 97, in run
  16. raise RuntimeError(message)
  17. RuntimeError: Couldn’t checkout commit 47b6b607fdd31875c9279cd2f4f16b92e4ea958e for Stable Diffusion.
  18. Command: “git” -C “C:\OpenAI.Wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai” checkout 47b6b607fd
  19. d31875c9279cd2f4f16b92e4ea958e
  20. Error code: 128
  21. stdout:
  22. stderr: fatal: reference is not a tree: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e
复制代码
这个错误体如今检出 Stable Diffusion 时出现问题。可能是由于该库的某些文件或依靠项已更改或已移除,导致无法找到所需的提交。请实行扫除当地库并重新克隆 Stable Diffusion,然后再次运行代码。
未找到pip

  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
  3. Commit hash: 4c1ad743e3baf1246db0711aa0107debf036a12b
  4. Installing torch and torchvision
  5. D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe: No module named pip
  6. Traceback (most recent call last):
  7. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 351, in
  8. prepare_environment()
  9. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 253, in prepare_environment
  10. run(f'”{python}” -m {torch_command}’, “Installing torch and torchvision”, “Couldn’t install torch”, live=True)
  11. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 81, in run
  12. raise RuntimeError(f”””{errdesc or ‘Error running command’}.
  13. RuntimeError: Couldn’t install torch.
  14. Command: “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 –extra-index-url https://download.pytorch.org/whl/cu117
  15. Error code: 1
复制代码
根据错误日记,似乎在运行 launch.py 文件实行安装 torch 和 torchvision。然而,这个命令在运行时出现了错误,错误信息是 No module named pip。
这可能是因为 Python 环境中没有安装 pip,所以在运行 pip 命令时出现了问题。
你可以实行先安装 pip,然后再运行 launch.py。你可以使用以下命令来安装 pip:
python get-pip.py
这应该会在你的 Python 环境中安装 pip。然后你可以再次运行启动文件即可。
open_clip

  1. F:\openai.wiki\stable-diffusion-webui>webui-user.bat
  2. venv “F:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
  5. Installing open_clip
  6. Traceback (most recent call last):
  7. File “F:\openai.wiki\stable-diffusion-webui\launch.py”, line 380, in
  8. prepare_environment()
  9. File “F:\openai.wiki\stable-diffusion-webui\launch.py”, line 296, in prepare_environment
  10. run_pip(f”install {openclip_package}”, “open_clip”)
  11. File “F:\openai.wiki\stable-diffusion-webui\launch.py”, line 145, in run_pip
  12. return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
  13. File “F:\openai.wiki\stable-diffusion-webui\launch.py”, line 113, in run
  14. raise RuntimeError(message)
  15. RuntimeError: Couldn’t install open_clip.
  16. Command: “F:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b –prefer-binary
  17. Error code: 1
  18. stdout: Collecting git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
  19. Cloning https://github.com/mlfoundations/open_clip.git (to revision bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b) to c:\users\administrator\appdata\local\temp\pip-req-build-0bs_j2f1
  20. stderr: Running command git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\Administrator\AppData\Local\Temp\pip-req-build-0bs_j2f1’
  21. error: RPC failed; curl 18 HTTP/2 stream 3 was not closed cleanly before end of the underlying stream
  22. fatal: expected flush after ref listing
  23. error: subprocess-exited-with-error
  24. git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\Administrator\AppData\Local\Temp\pip-req-build-0bs_j2f1’ did not run successfully.
  25. exit code: 128
  26. See above for output.
  27. note: This error originates from a subprocess, and is likely not a problem with pip.
  28. error: subprocess-exited-with-error
  29. git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\Administrator\AppData\Local\Temp\pip-req-build-0bs_j2f1’ did not run successfully.
  30. exit code: 128
  31. See above for output.
  32. note: This error originates from a subprocess, and is likely not a problem with pip.
  33. [notice] A new release of pip available: 22.3.1 -> 23.0.1
  34. [notice] To update, run: F:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
复制代码
这个错误提示是在运行一个名为“webui-user.bat”的文件时出现的。错误提示表明程序试图安装名为“open_clip”的包,但是安装失败了。下面是详细的错误信息:
  1. Running command git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\Administrator\AppData\Local\Temp\pip-req-build-0bs_j2f1’
  2. error: RPC failed; curl 18 HTTP/2 stream 3 was not closed cleanly before end of the underlying stream
  3. fatal: expected flush after ref listing
  4. error: subprocess-exited-with-error
  5. git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\Administrator\AppData\Local\Temp\pip-req-build-0bs_j2f1’ did not run successfully.
  6. exit code: 128
  7. See above for output.
  8. note: This error originates from a subprocess, and is likely not a problem with pip.
复制代码
根据错误信息分析,程序在安装“open_clip”包时,实行从GitHub上克隆代码堆栈,但是克隆失败了,可能是由于网络毗连问题或GitHub服务器出现问题导致的。您可以实行重新运行程序,或稍后再试,看看能否成功安装该包。
SD库不正确

  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
  3. Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
  4. Fetching updates for Stable Diffusion…
  5. Checking out commit for Stable Diffusion with hash: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e…
  6. Traceback (most recent call last):
  7. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 380, in
  8. prepare_environment()
  9. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 315, in prepare_environment
  10. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_commit_hash)
  11. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 164, in git_clone
  12. run(f'”{git}” -C “{dir}” checkout {commithash}’, f”Checking out commit for {name} with hash: {commithash}…”, f”Couldn’t checkout commit {commithash} for {name}”)
  13. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 113, in run
  14. raise RuntimeError(message)
  15. RuntimeError: Couldn’t checkout commit 47b6b607fdd31875c9279cd2f4f16b92e4ea958e for Stable Diffusion.
  16. Command: “git” -C “D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai” checkout 47b6b607fdd31875c9279cd2f4f16b92e4ea958e
  17. Error code: 128
  18. stdout:
  19. stderr: fatal: reference is not a tree: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e
复制代码
根据您提供的信息,看起来是在运行一个名为 launch.py 的Python脚本时发生了错误。根据错误信息,似乎出现了Git无法检出提交的问题。这可能是由于Git存储库的状态不正确或由于网络毗连问题而导致的。您可以实行运行以下命令来查抄网络毗连:
ping files.pythonhosted.org
PIP超时

  1. ERROR: Exception:
  2. Traceback (most recent call last):
  3. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 437, in _error_catcher
  4. yield
  5. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 560, in read
  6. data = self._fp_read(amt) if not fp_closed else b””
  7. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 526, in _fp_read
  8. return self._fp.read(amt) if amt is not None else self._fp.read()
  9. File “E:\conda\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py”, line 90, in read
  10. data = self.__fp.read(amt)
  11. File “E:\conda\lib\http\client.py”, line 465, in read
  12. s = self.fp.read(amt)
  13. File “E:\conda\lib\socket.py”, line 705, in readinto
  14. return self._sock.recv_into(b)
  15. File “E:\conda\lib\ssl.py”, line 1274, in recv_into
  16. return self.read(nbytes, buffer)
  17. File “E:\conda\lib\ssl.py”, line 1130, in read
  18. return self._sslobj.read(len, buffer)
  19. TimeoutError: The read operation timed out
  20. During handling of the above exception, another exception occurred:
  21. Traceback (most recent call last):
  22. File “E:\conda\lib\site-packages\pip\_internal\cli\base_command.py”, line 160, in exc_logging_wrapper
  23. status = run_func(*args)
  24. File “E:\conda\lib\site-packages\pip\_internal\cli\req_command.py”, line 247, in wrapper
  25. return func(self, options, args)
  26. File “E:\conda\lib\site-packages\pip\_internal\commands\install.py”, line 400, in run
  27. requirement_set = resolver.resolve(
  28. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py”, line 92, in resolve
  29. result = self._result = resolver.resolve(
  30. File “E:\conda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 481, in resolve
  31. state = resolution.resolve(requirements, max_rounds=max_rounds)
  32. File “E:\conda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 348, in resolve
  33. self._add_to_criteria(self.state.criteria, r, parent=None)
  34. File “E:\conda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 172, in _add_to_criteria
  35. if not criterion.candidates:
  36. File “E:\conda\lib\site-packages\pip\_vendor\resolvelib\structs.py”, line 151, in __bool__
  37. return bool(self._sequence)
  38. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 155, in __bool__
  39. return any(self)
  40. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 143, in
  41. return (c for c in iterator if id(c) not in self._incompatible_ids)
  42. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 47, in _iter_built
  43. candidate = func()
  44. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py”, line 206, in _make_candidate_from_link
  45. self._link_candidate_cache[link] = LinkCandidate(
  46. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 297, in __init__
  47. super().__init__(
  48. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 162, in __init__
  49. self.dist = self._prepare()
  50. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 231, in _prepare
  51. dist = self._prepare_distribution()
  52. File “E:\conda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 308, in _prepare_distribution
  53. return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  54. File “E:\conda\lib\site-packages\pip\_internal\operations\prepare.py”, line 491, in prepare_linked_requirement
  55. return self._prepare_linked_requirement(req, parallel_builds)
  56. File “E:\conda\lib\site-packages\pip\_internal\operations\prepare.py”, line 536, in _prepare_linked_requirement
  57. local_file = unpack_url(
  58. File “E:\conda\lib\site-packages\pip\_internal\operations\prepare.py”, line 166, in unpack_url
  59. file = get_http_url(
  60. File “E:\conda\lib\site-packages\pip\_internal\operations\prepare.py”, line 107, in get_http_url
  61. from_path, content_type = download(link, temp_dir.path)
  62. File “E:\conda\lib\site-packages\pip\_internal\network\download.py”, line 147, in __call__
  63. for chunk in chunks:
  64. File “E:\conda\lib\site-packages\pip\_internal\cli\progress_bars.py”, line 53, in _rich_progress_bar
  65. for chunk in iterable:
  66. File “E:\conda\lib\site-packages\pip\_internal\network\utils.py”, line 63, in response_chunks
  67. for chunk in response.raw.stream(
  68. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 621, in stream
  69. data = self.read(amt=amt, decode_content=decode_content)
  70. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 559, in read
  71. with self._error_catcher():
  72. File “E:\conda\lib\contextlib.py”, line 153, in __exit__
  73. self.gen.throw(typ, value, traceback)
  74. File “E:\conda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 442, in _error_catcher
  75. raise ReadTimeoutError(self._pool, None, “Read timed out.”)
  76. pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=’files.pythonhosted.org’, port=443): Read timed out.
复制代码
这个错误通常是因为pip实行从远程服务器下载软件包时毗连超时。你可以实行重新运行命令,大概实行使用pip的“–default-timeout”选项来增长超时时间,如下所示:
  1. pip install --default-timeout=1000 package_name
复制代码
这里,超时时间为1000秒。如果仍然无法办理问题,你可以实行使用VPN大概更改你的网络毗连。
requirements

卡在了installing requirements for web ui这一步
输出显示出现了一个SSL错误,它可能是由于网络问题导致的。你可以实行使用其他网络环境或在网络良好的情况下重试安装。
此外,你还可以实行在命令行中运行以下命令更新pip,然后重新运行安装:python -m pip install --upgrade pip
xformers

No module ‘xformers’. Proceeding without it.
每次启动时显示如上内容,这并不算错误,新版SD不支持xformers,可以手动更改为支持。
这个库的重要作用是可以加快生成图像,但有时候安装过后速率反而降落,所以发起保持即可,不用理会。
GFPGAN

  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash:
  4. Installing gfpgan
  5. Traceback (most recent call last):
  6. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 380, in
  7. prepare_environment()
  8. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 290, in prepare_environment
  9. run_pip(f”install {gfpgan_package}”, “gfpgan”)
  10. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 145, in run_pip
  11. return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
  12. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 113, in run
  13. raise RuntimeError(message)
  14. RuntimeError: Couldn’t install gfpgan.
  15. Command: “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 –prefer-binary
  16. Error code: 1
  17. stdout: Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
  18. Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to c:\users\17742\appdata\local\temp\pip-req-build-ocz06mwj
  19. stderr: Running command git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\17742\AppData\Local\Temp\pip-req-build-ocz06mwj’
  20. fatal: unable to access ‘https://github.com/TencentARC/GFPGAN.git/’: Failed to connect to github.com port 443 after 21046 ms: Couldn’t connect to server
  21. error: subprocess-exited-with-error
  22. git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\17742\AppData\Local\Temp\pip-req-build-ocz06mwj’ did not run successfully.
  23. exit code: 128
  24. See above for output.
  25. note: This error originates from a subprocess, and is likely not a problem with pip.
  26. error: subprocess-exited-with-error
  27. git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\17742\AppData\Local\Temp\pip-req-build-ocz06mwj’ did not run successfully.
  28. exit code: 128
  29. See above for output.
  30. note: This error originates from a subprocess, and is likely not a problem with pip.
  31. [notice] A new release of pip available: 22.3.1 -> 23.0.1
  32. [notice] To update, run: D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
复制代码
这个错误显示在安装gfpgan时出现了问题。看起来实行从GitHub克隆代码库失败了。
最有可能的原因是你的计算机无法毗连到GitHub,大概GitHub网站当前遇到了问题。
实行查抄你的网络毗连并确保你可以毗连到GitHub,大概稍后再实行安装。另外,你可能也可以实行升级你的pip版本。
subprocess-exited-with-error

  1. error: subprocess-exited-with-error
  2. × python setup.py egg_info did not run successfully.
  3. │ exit code: 1
  4. ╰─> [109 lines of output]
  5. D:\Miniconda\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  6. warnings.warn(
  7. ERROR: Exception:
  8. Traceback (most recent call last):
  9. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 437, in _error_catcher
  10. yield
  11. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 560, in read
  12. data = self._fp_read(amt) if not fp_closed else b””
  13. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 526, in _fp_read
  14. return self._fp.read(amt) if amt is not None else self._fp.read()
  15. File “D:\Miniconda\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py”, line 90, in read
  16. data = self.__fp.read(amt)
  17. File “D:\Miniconda\lib\http\client.py”, line 465, in read
  18. s = self.fp.read(amt)
  19. File “D:\Miniconda\lib\socket.py”, line 705, in readinto
  20. return self._sock.recv_into(b)
  21. File “D:\Miniconda\lib\ssl.py”, line 1274, in recv_into
  22. return self.read(nbytes, buffer)
  23. File “D:\Miniconda\lib\ssl.py”, line 1130, in read
  24. return self._sslobj.read(len, buffer)
  25. TimeoutError: The read operation timed out
  26. During handling of the above exception, another exception occurred:
  27. Traceback (most recent call last):
  28. File “D:\Miniconda\lib\site-packages\pip\_internal\cli\base_command.py”, line 160, in exc_logging_wrapper
  29. status = run_func(*args)
  30. File “D:\Miniconda\lib\site-packages\pip\_internal\cli\req_command.py”, line 247, in wrapper
  31. return func(self, options, args)
  32. File “D:\Miniconda\lib\site-packages\pip\_internal\commands\wheel.py”, line 170, in run
  33. requirement_set = resolver.resolve(reqs, check_supported_wheels=True)
  34. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py”, line 92, in resolve
  35. result = self._result = resolver.resolve(
  36. File “D:\Miniconda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 481, in resolve
  37. state = resolution.resolve(requirements, max_rounds=max_rounds)
  38. File “D:\Miniconda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 348, in resolve
  39. self._add_to_criteria(self.state.criteria, r, parent=None)
  40. File “D:\Miniconda\lib\site-packages\pip\_vendor\resolvelib\resolvers.py”, line 172, in _add_to_criteria
  41. if not criterion.candidates:
  42. File “D:\Miniconda\lib\site-packages\pip\_vendor\resolvelib\structs.py”, line 151, in __bool__
  43. return bool(self._sequence)
  44. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 155, in __bool__
  45. return any(self)
  46. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 143, in
  47. return (c for c in iterator if id(c) not in self._incompatible_ids)
  48. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py”, line 47, in _iter_built
  49. candidate = func()
  50. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py”, line 206, in _make_candidate_from_link
  51. self._link_candidate_cache[link] = LinkCandidate(
  52. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 297, in __init__
  53. super().__init__(
  54. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 162, in __init__
  55. self.dist = self._prepare()
  56. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 231, in _prepare
  57. dist = self._prepare_distribution()
  58. File “D:\Miniconda\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py”, line 308, in _prepare_distribution
  59. return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  60. File “D:\Miniconda\lib\site-packages\pip\_internal\operations\prepare.py”, line 491, in prepare_linked_requirement
  61. return self._prepare_linked_requirement(req, parallel_builds)
  62. File “D:\Miniconda\lib\site-packages\pip\_internal\operations\prepare.py”, line 536, in _prepare_linked_requirement
  63. local_file = unpack_url(
  64. File “D:\Miniconda\lib\site-packages\pip\_internal\operations\prepare.py”, line 166, in unpack_url
  65. file = get_http_url(
  66. File “D:\Miniconda\lib\site-packages\pip\_internal\operations\prepare.py”, line 107, in get_http_url
  67. from_path, content_type = download(link, temp_dir.path)
  68. File “D:\Miniconda\lib\site-packages\pip\_internal\network\download.py”, line 147, in __call__
  69. for chunk in chunks:
  70. File “D:\Miniconda\lib\site-packages\pip\_internal\network\utils.py”, line 63, in response_chunks
  71. for chunk in response.raw.stream(
  72. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 621, in stream
  73. data = self.read(amt=amt, decode_content=decode_content)
  74. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 559, in read
  75. with self._error_catcher():
  76. File “D:\Miniconda\lib\contextlib.py”, line 153, in __exit__
  77. self.gen.throw(typ, value, traceback)
  78. File “D:\Miniconda\lib\site-packages\pip\_vendor\urllib3\response.py”, line 442, in _error_catcher
  79. raise ReadTimeoutError(self._pool, None, “Read timed out.”)
  80. pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=’files.pythonhosted.org’, port=443): Read timed out.
  81. Traceback (most recent call last):
  82. File “D:\Miniconda\lib\site-packages\setuptools\installer.py”, line 82, in fetch_build_egg
  83. subprocess.check_call(cmd)
  84. File “D:\Miniconda\lib\subprocess.py”, line 369, in check_call
  85. raise CalledProcessError(retcode, cmd)
  86. subprocess.CalledProcessError: Command ‘[‘D:\\Miniconda\\python.exe’, ‘-m’, ‘pip’, ‘–disable-pip-version-check’, ‘wheel’, ‘–no-deps’, ‘-w’, ‘C:\\Users\\23243\\AppData\\Local\\Temp\\tmpk82g_bqu’, ‘–quiet’, ‘torch’]’ returned non-zero exit status 2.
  87. The above exception was the direct cause of the following exception:
  88. Traceback (most recent call last):
  89. File “”, line 2, in
  90. File “”, line 34, in
  91. File “C:\Users\23243\AppData\Local\Temp\pip-install-hauelb5m\basicsr_ff9fa51afe15482f8d5ed318666d9752\setup.py”, line 147, in
  92. setup(
  93. File “D:\Miniconda\lib\site-packages\setuptools\__init__.py”, line 86, in setup
  94. _install_setup_requires(attrs)
  95. File “D:\Miniconda\lib\site-packages\setuptools\__init__.py”, line 80, in _install_setup_requires
  96. dist.fetch_build_eggs(dist.setup_requires)
  97. File “D:\Miniconda\lib\site-packages\setuptools\dist.py”, line 874, in fetch_build_eggs
  98. resolved_dists = pkg_resources.working_set.resolve(
  99. File “D:\Miniconda\lib\site-packages\pkg_resources\__init__.py”, line 789, in resolve
  100. dist = best[req.key] = env.best_match(
  101. File “D:\Miniconda\lib\site-packages\pkg_resources\__init__.py”, line 1075, in best_match
  102. return self.obtain(req, installer)
  103. File “D:\Miniconda\lib\site-packages\pkg_resources\__init__.py”, line 1087, in obtain
  104. return installer(requirement)
  105. File “D:\Miniconda\lib\site-packages\setuptools\dist.py”, line 944, in fetch_build_egg
  106. return fetch_build_egg(self, req)
  107. File “D:\Miniconda\lib\site-packages\setuptools\installer.py”, line 84, in fetch_build_egg
  108. raise DistutilsError(str(e)) from e
  109. distutils.errors.DistutilsError: Command ‘[‘D:\\Miniconda\\python.exe’, ‘-m’, ‘pip’, ‘–disable-pip-version-check’, ‘wheel’, ‘–no-deps’, ‘-w’, ‘C:\\Users\\23243\\AppData\\Local\\Temp\\tmpk82g_bqu’, ‘–quiet’, ‘torch’]’ returned non-zero exit status 2.
  110. [end of output]
  111. note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
复制代码
这个错误可能是由于pip在下载软件包时遇到了网络问题,导致安装不成功。您可以实行重新运行命令,大概查抄您的网络毗连是否正常。另外,您可以实行使用国内的镜像源来安装软件包,比方使用清华大学的镜像源,命令如下:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
将 some-package 更换为您要安装的软件包的名称。
BLIP错误

  1. F:\openai.wiki\stable-diffusion-webui-master>webui-user.bat
  2. venv “F:\openai.wiki\stable-diffusion-webui-master\venv\Scripts\Python.exe”
  3. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash:
  5. Cloning Taming Transformers into F:\openai.wiki\stable-diffusion-webui-master\repositories\taming-transformers…
  6. Cloning K-diffusion into F:\openai.wiki\stable-diffusion-webui-master\repositories\k-diffusion…
  7. Cloning CodeFormer into F:\openai.wiki\stable-diffusion-webui-master\repositories\CodeFormer…
  8. Cloning BLIP into F:\openai.wiki\stable-diffusion-webui-master\repositories\BLIP…
  9. Traceback (most recent call last):
  10. File “F:\openai.wiki\stable-diffusion-webui-master\launch.py”, line 380, in
  11. prepare_environment()
  12. File “F:\openai.wiki\stable-diffusion-webui-master\launch.py”, line 319, in prepare_environment
  13. git_clone(blip_repo, repo_dir(‘BLIP’), “BLIP”, blip_commit_hash)
  14. File “F:\openai.wiki\stable-diffusion-webui-master\launch.py”, line 167, in git_clone
  15. run(f'”{git}” clone “{url}” “{dir}”‘, f”Cloning {name} into {dir}…”, f”Couldn’t clone {name}”)
  16. File “F:\openai.wiki\stable-diffusion-webui-master\launch.py”, line 113, in run
  17. raise RuntimeError(message)
  18. RuntimeError: Couldn’t clone BLIP.
  19. Command: “git” clone “https://github.com/salesforce/BLIP.git” “F:\openai.wiki\stable-diffusion-webui-master\repositories\BLIP”
  20. Error code: 128
  21. stdout:
  22. stderr: Cloning into ‘F:\openai.wiki\stable-diffusion-webui-master\repositories\BLIP’…
  23. fatal: unable to access ‘https://github.com/salesforce/BLIP.git/’: OpenSSL SSL_read: Connection was reset, errno 10054
复制代码
这个错误信息意味着在实行从 GitHub 克隆 BLIP 存储库时出现了一个毗连错误。 这可能是由于网络问题或 GitHub 服务器的问题导致的。
taming-transformers

  1. (D:\openai.wiki\stable-diffusion-webui\automatic) D:\openai.wiki\stable-diffusion-webui>webui-user.bat
  2. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
  5. Traceback (most recent call last):
  6. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 380, in
  7. prepare_environment()
  8. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 316, in prepare_environment
  9. git_clone(taming_transformers_repo, repo_dir(‘taming-transformers’), “Taming Transformers”, taming_transformers_commit_hash)
  10. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 159, in git_clone
  11. current_hash = run(f'”{git}” -C “{dir}” rev-parse HEAD’, None, f”Couldn’t determine {name}’s hash: {commithash}”).strip()
  12. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 113, in run
  13. raise RuntimeError(message)
  14. RuntimeError: Couldn’t determine Taming Transformers’s hash: 24268930bf1dce879235a7fddd0b2355b84d7ea6.
  15. Command: “git” -C “D:\openai.wiki\stable-diffusion-webui\repositories\taming-transformers” rev-parse HEAD
  16. Error code: 128
  17. stdout: HEAD
  18. stderr: fatal: ambiguous argument ‘HEAD’: unknown revision or path not in the working tree.
  19. Use ‘–‘ to separate paths from revisions, like this:
  20. ‘git […] — […]’
复制代码
这个错误显示无法克隆 taming-transformers 堆栈并检索其特定的提交哈希值(commit hash),但是在实行获取哈希值时出现了错误。错误信息中显示了一条有关“HEAD”的错误消息,表明 Git 无法识别此哈希值。发起删除SD安装目次.\openai.wiki\stable-diffusion-webui\repositories\下的taming-transformers文件夹。
PIP超时

  1. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’files.pythonhosted.org’, port=443): Read timed out. (read timeout=15)”)’: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl
  2. WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ConnectTimeoutError(, ‘Connection to files.pythonhosted.org timed out. (connect timeout=15)’)’: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl
  3. WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ConnectTimeoutError(, ‘Connection to files.pythonhosted.org timed out. (connect timeout=15)’)’: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl
  4. WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ConnectTimeoutError(, ‘Connection to files.pythonhosted.org timed out. (connect timeout=15)’)’: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl
  5. WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ConnectTimeoutError(, ‘Connection to files.pythonhosted.org timed out. (connect timeout=15)’)’: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl
  6. ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host=’files.pythonhosted.org’, port=443): Max retries exceeded with url: /packages/bc/bf/58dbe1f382ecac2c0571c43b6e95028b14e159d67d75e49a00c26ef63d8f/lazy_loader-0.1-py3-none-any.whl (Caused by ConnectTimeoutError(, ‘Connection to files.pythonhosted.org timed out. (connect timeout=15)’))
复制代码
没有开启魔法上网,发起添加镜像源。
CondaHTTPError

  1. CondaHTTPError: HTTP 000 CONNECTION FAILED for url
  2. Elapsed: –
  3. An HTTP error occurred when trying to retrieve this URL.
  4. HTTP errors are often intermittent, and a simple retry will get you on your way.
  5. ‘https://conda.anaconda.org/pytorch/win-64’
复制代码
这个错误提示表明在使用Conda时发生了HTTP错误,导致无法从指定的URL下载数据。可能的原因是网络毗连问题或服务器故障。
如果你安装了anaconda请卸载,然后重新安装miniconda。如果不是,请查抄网络环境。
Python问题

这类问题都是因为与Python相干的错误
PIP升级

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip


PIP需要升级,办理方法很简朴,直接复制执行你的电脑所给出的代码即可。比方我们复制run:背面的全部,然后在CMD中执行即可。
  1. D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
复制代码
未找到Python

  1. Couldn’t launch python
  2. exit code: 9009
复制代码
当你看到“Couldn’t launch python exit code: 9009”这个错误时,这通常意味着系统无法找到Python解释器。这可能是因为Python未正确安装或未添加到系统环境变量中。
您可以查抄是否已正确安装Python并将其添加到系统环境变量中。如果已经安装并添加到系统环境变量中,则可能需要重新启动终端或计算机以使更改收效。
Python环境变量错误

  1. Expecting value: line 1 column 1 (char 0)
复制代码
可能是Python找不到系统变量了,你可以打开CMD窗口之后输入Python,看看系统能否正常启动Python,如果找不到Python的话,可以搜索一下Python环境变量修复的办法。
如果不想修复也能够正常使用,可以通过miniconda的终端内执行
conda activate 你的环境名称或路径
然后CD到你的SD根目次之后执行webui-user.bat即可。
未安装PIP

  1. (D:\openai.wiki\stable-diffusion-webui\automatic) C:\Users\86173>cd /d D:\openai.wiki\stable-diffusion-webui
  2. (D:\openai.wiki\stable-diffusion-webui\automatic) D:\openai.wiki\stable-diffusion-webui>webui-user.bat
  3. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  4. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  5. Commit hash: 955df7751eef11bb7697e2d77f6b8a6226b21e13
  6. Fetching updates for Taming Transformers…
  7. Checking out commit for Taming Transformers with hash: 24268930bf1dce879235a7fddd0b2355b84d7ea6…
  8. Traceback (most recent call last):
  9. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 351, in
  10. prepare_environment()
  11. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 285, in prepare_environment
  12. git_clone(taming_transformers_repo, repo_dir(‘taming-transformers’), “Taming Transformers”, taming_transformers_commit_hash)
  13. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 148, in git_clone
  14. run(f'”{git}” -C “{dir}” checkout {commithash}’, f”Checking out commit for {name} with hash: {commithash}…”, f”Couldn’t checkout commit {commithash} for {name}”)
  15. File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 97, in run
  16. raise RuntimeError(message)
  17. RuntimeError: Couldn’t checkout commit 24268930bf1dce879235a7fddd0b2355b84d7ea6 for Taming Transformers.
  18. Command: “git” -C “D:\openai.wiki\stable-diffusion-webui\repositories\taming-transformers” checkout 24268930bf1dce879235a7fddd0b2355b84d7ea6
  19. Error code: 128
  20. stdout:
  21. stderr: fatal: reference is not a tree: 24268930bf1dce879235a7fddd0b2355b84d7ea6
复制代码
可能因为没有安装pip而导致的,发起执行python -m ensurepip 。
Python版本不正确

  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. ==============================================================================================================
  3. INCOMPATIBLE PYTHON VERSION
  4. This program is tested with 3.10.6 Python, but you have 3.9.12.
  5. If you encounter an error with “RuntimeError: Couldn’t install torch.” message,
  6. or any other error regarding unsuccessful package (library) installation,
  7. please downgrade (or upgrade) to the latest version of 3.10 Python
  8. and delete current Python and “venv” folder in WebUI’s directory.
  9. You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3109/
  10. Alternatively, use a binary release of WebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases
  11. Use –skip-python-version-check to suppress this warning.
  12. ==============================================================================================================
  13. Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
  14. Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
  15. Installing requirements for Web UI
  16. Launching Web UI with arguments:
  17. No module ‘xformers’. Proceeding without it.
  18. Loading weights [a7529df023] from D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\final-pruned.ckpt
  19. Creating model from config: D:\openai.wiki\stable-diffusion-webui\configs\v1-inference.yaml
  20. LatentDiffusion: Running in eps-prediction mode
  21. DiffusionWrapper has 859.52 M params.
  22. Loading VAE weights found near the checkpoint: D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\final-pruned.vae.pt
  23. loading stable diffusion model: OutOfMemoryError
  24. Traceback (most recent call last):
  25. File “D:\openai.wiki\stable-diffusion-webui\webui.py”, line 139, in initialize
  26. modules.sd_models.load_model()
  27. File “D:\openai.wiki\stable-diffusion-webui\modules\sd_models.py”, line 449, in load_model
  28. sd_model.to(shared.device)
  29. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\lightning_fabric\utilities\device_dtype_mixin.py”, line 54, in to
  30. return super().to(*args, **kwargs)
  31. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 989, in to
  32. return self._apply(convert)
  33. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  34. module._apply(fn)
  35. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  36. module._apply(fn)
  37. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  38. module._apply(fn)
  39. [Previous line repeated 2 more times]
  40. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 664, in _apply
  41. param_applied = fn(param)
  42. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 987, in convert
  43. return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  44. torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.66 GiB already allocated; 0 bytes free; 1.70 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
  45. Stable diffusion model failed to load, exiting
复制代码
这个错误信息是由于Web UI需要Python 3.10.6版本,而你的Python版本是3.9.12导致的,所以发起你下载安装3.10.6版本的Python。
大概删除当前Python和Web UI目次中的venv文件夹,并升级到最新的3.10版本。
其它问题

  1. 未找到launch.py启动文件
  2. (D:\openai.wiki\stable-diffusion-webui\automatic) D:\openai.wiki\stable-diffusion-webui>webui-user.bat
  3. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  4. D:\openai.wiki\stable-diffusion-webui\automatic\python.exe: can’t open file ‘D:\\openai.wiki\\stable-diffusion-webui\\launch.py’: [Errno 2] No such file or directory
  5. 请按任意键继续. . .
复制代码
已经成功的进入到了Conda已激活的环境,但是在D:\openai.wiki\stable-diffusion-webui目次内没有launch.py这个文件,应该是SD没Git完整,大概目次错误。
GPU显卡驱动较旧

  1. [notice] A new release of pip available: 22.3.1 -> 23.0.1[notice] To update, run: D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
  2. Traceback (most recent call last):File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 380, inprepare_environment()File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 287, in prepare_environmentrun_python(“import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'”)File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 137, in run_pythonreturn run(f'”{python}” -c “{code}”‘, desc, errdesc)File “D:\openai.wiki\stable-diffusion-webui\launch.py”, line 113, in runraise RuntimeError(message)RuntimeError: Error running command.Command: “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe” -c “import torch; assert torch.cuda.is_available(), ‘Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'”Error code: 1stdout:stderr: D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\__init__.py:88: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10020). 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. (Triggered internally at ..\c10\cuda\CUDAFunctions.cpp:109.)return torch._C._cuda_getDeviceCount() > 0Traceback (most recent call last):File “”, line 1, inAssertionError: Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check
复制代码
您的GPU驱动程序版本太旧,需要更新GPU驱动程序。更新GPU驱动程序可能会办理这些错误。
模子损坏

  1. venv “G:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
  4. Installing requirements for Web UI
  5. Launching Web UI with arguments:
  6. No module ‘xformers’. Proceeding without it.
  7. Loading weights [a586d5a51a] from G:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
  8. loading stable diffusion model: RuntimeError
  9. Traceback (most recent call last):
  10. File “G:\openai.wiki\stable-diffusion-webui\webui.py”, line 136, in initialize
  11. modules.sd_models.load_model()
  12. File “G:\openai.wiki\stable-diffusion-webui\modules\sd_models.py”, line 407, in load_model
  13. state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
  14. File “G:\openai.wiki\stable-diffusion-webui\modules\sd_models.py”, line 262, in get_checkpoint_state_dict
  15. res = read_state_dict(checkpoint_info.filename)
  16. File “G:\openai.wiki\stable-diffusion-webui\modules\sd_models.py”, line 241, in read_state_dict
  17. pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
  18. File “G:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\safetensors\torch.py”, line 100, in load_file
  19. result[k] = f.get_tensor(k)
  20. RuntimeError: self.size(-1) must be divisible by 4 to view Byte as Float (different element sizes), but got 6545423
  21. Stable diffusion model failed to load, exiting
  22. 请按任意键继续. . .
复制代码
根据错误信息,您的Stable-diffusion模子加载失败,原因是self.size(-1)必须可以被4整除,但是实际上得到了6545423,这是不可能被4整除的。这可能是由于模子参数文件已损坏或不完整导致的。您可以实行重新下载模子文件并重新运行程序,以办理这个问题。
yaml未找到

  1. EnvironmentFileNotFound: ‘D:\openai.wiki\stable-diffusion-webui\environment-wsl2.yaml’ file not found
复制代码
这个错误说明找不到指定路径下的environment-wsl2.yaml文件,请确保路径和文件名正确,手动是否能够找到该文件。
无法切换模子

点击左上角的模子切换按钮后,一直加载中,无法正常使用。
办理办法:多点几次重新加载UI按钮,大概换一个欣赏器。特殊情况下欣赏器无法与CMD建立链接。
模子加载失败

  1. (D:\openai.wiki\stable-diffusion-webui\automatic) D:\openai.wiki\stable-diffusion-webui>webui-user.batCreating venv in directory D:\openai.wiki\stable-diffusion-webui\venv using python “D:\openai.wiki\stable-diffusion-webui\automatic\python.exe”venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]Commit hash:Installing torch and torchvisionLooking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117Collecting torch==1.13.1+cu117Downloading https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl (2255.4 MB)—————————————- 2.3/2.3 GB 1.0 MB/s eta 0:00:00Collecting torchvision==0.14.1+cu117Downloading https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp310-cp310-win_amd64.whl (4.8 MB)—————————————- 4.8/4.8 MB 8.1 MB/s eta 0:00:00Collecting typing-extensionsDownloading typing_extensions-4.5.0-py3-none-any.whl (27 kB)Collecting numpyDownloading numpy-1.24.2-cp310-cp310-win_amd64.whl (14.8 MB)—————————————- 14.8/14.8 MB 13.6 MB/s eta 0:00:00Collecting requestsDownloading requests-2.28.2-py3-none-any.whl (62 kB)—————————————- 62.8/62.8 kB 1.7 MB/s eta 0:00:00Collecting pillow!=8.3.*,>=5.3.0Downloading Pillow-9.4.0-cp310-cp310-win_amd64.whl (2.5 MB)—————————————- 2.5/2.5 MB 19.7 MB/s eta 0:00:00Collecting charset-normalizer=2Downloading charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl (97 kB)—————————————- 97.1/97.1 kB 5.8 MB/s eta 0:00:00Collecting idna=2.5Downloading https://download.pytorch.org/whl/idna-3.4-py3-none-any.whl (61 kB)—————————————- 61.5/61.5 kB 3.2 MB/s eta 0:00:00Collecting urllib3=1.21.1Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB)—————————————- 140.9/140.9 kB 8.7 MB/s eta 0:00:00Collecting certifi>=2017.4.17Downloading https://download.pytorch.org/whl/certifi-2022.12.7-py3-none-any.whl (155 kB)—————————————- 155.3/155.3 kB 9.1 MB/s eta 0:00:00Installing collected packages: urllib3, typing-extensions, pillow, numpy, idna, charset-normalizer, certifi, torch, requests, torchvisionSuccessfully installed certifi-2022.12.7 charset-normalizer-3.1.0 idna-3.4 numpy-1.24.2 pillow-9.4.0 requests-2.28.2 torch-1.13.1+cu117 torchvision-0.14.1+cu117 typing-extensions-4.5.0 urllib3-1.26.15[notice] A new release of pip available: 22.3.1 -> 23.0.1[notice] To update, run: D:\openai.wiki\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
  2. Installing gfpganInstalling clipInstalling open_clipCloning Stable Diffusion into D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai…Cloning Taming Transformers into D:\openai.wiki\stable-diffusion-webui\repositories\taming-transformers…Cloning K-diffusion into D:\openai.wiki\stable-diffusion-webui\repositories\k-diffusion…Cloning CodeFormer into D:\openai.wiki\stable-diffusion-webui\repositories\CodeFormer…Cloning BLIP into D:\openai.wiki\stable-diffusion-webui\repositories\BLIP…Installing requirements for CodeFormerInstalling requirements for Web UILaunching Web UI with arguments:No module ‘xformers’. Proceeding without it.Downloading: “https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors” to D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors100%|█████████████████████████████████████████████████████████████████████████████| 3.97G/3.97G [05:34<00:00, 12.7MB/s]Calculating sha256 for D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors: 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2faLoading weights [6ce0161689] from D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensorsCreating model from config: D:\openai.wiki\stable-diffusion-webui\configs\v1-inference.yamlLatentDiffusion: Running in eps-prediction modeDiffusionWrapper has 859.52 M params.Downloading (…)olve/main/vocab.json: 100%|███████████████████████████████████████████| 961k/961k [00:01<00:00, 862kB/s]Downloading (…)olve/main/merges.txt: 100%|███████████████████████████████████████████| 525k/525k [00:00<00:00, 548kB/s]Downloading (…)cial_tokens_map.json: 100%|█████████████████████████████████████████████| 389/389 [00:00<00:00, 282kB/s]Downloading (…)okenizer_config.json: 100%|█████████████████████████████████████████████| 905/905 [00:00<00:00, 900kB/s]Downloading (…)lve/main/config.json: 100%|████████████████████████████████████████| 4.52k/4.52k [00:00> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONFStable diffusion model failed to load, exiting
复制代码
这里出现了一个错误,似乎是 Stable Diffusion 模子加载失败导致的。发起查抄一下网络毗连,以及确保下载的模子文件完整无损。
你可以实行重新运行这个命令,大概重新下载并安装 Stable Diffusion 模子文件。
目次不正确

  1. (E:\ai\stable-diffusion-webui\automatic) E:\ai\stable-diffusion-webui>webui-user.bat
  2. fatal: not a git repository (or any of the parent directories): .git
  3. venv “E:\ai\stable-diffusion-webui\venv\Scripts\Python.exe”
  4. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  5. Commit hash:
  6. Installing requirements for Web UI
  7. Launching Web UI with arguments: –xformers
  8. Loading weights [fe4efff1e1] from E:\ai\stable-diffusion-webui\models\Stable-diffusion\Model.ckpt
  9. Creating model from config: E:\ai\stable-diffusion-webui\configs\v1-inference.yaml
  10. LatentDiffusion: Running in eps-prediction mode
  11. DiffusionWrapper has 859.52 M params.
  12. Applying xformers cross attention optimization.
  13. Textual inversion embeddings loaded(0):
  14. Model loaded in 4.9s (load weights from disk: 1.7s, create model: 0.4s, apply weights to model: 0.5s, apply half(): 0.7s, move model to device: 0.7s, load textual inversion embeddings: 0.9s).
  15. Traceback (most recent call last):
  16. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 412, in send
  17. conn = self.get_connection(request.url, proxies)
  18. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 305, in get_connection
  19. proxy_url = parse_url(proxy)
  20. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\urllib3\util\url.py”, line 397, in parse_url
  21. return six.raise_from(LocationParseError(source_url), None)
  22. File “”, line 3, in raise_from
  23. urllib3.exceptions.LocationParseError: Failed to parse: http://127.0.0.1:7890
  24. During handling of the above exception, another exception occurred:
  25. Traceback (most recent call last):
  26. File “E:\ai\stable-diffusion-webui\launch.py”, line 352, in
  27. start()
  28. File “E:\ai\stable-diffusion-webui\launch.py”, line 347, in start
  29. webui.webui()
  30. File “E:\ai\stable-diffusion-webui\webui.py”, line 257, in webui
  31. app, local_url, share_url = shared.demo.launch(
  32. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py”, line 1483, in launch
  33. requests.get(f”{self.local_url}startup-events”)
  34. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\api.py”, line 76, in get
  35. return request(‘get’, url, params=params, **kwargs)
  36. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\api.py”, line 61, in request
  37. return session.request(method=method, url=url, **kwargs)
  38. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\sessions.py”, line 542, in request
  39. resp = self.send(prep, **send_kwargs)
  40. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\sessions.py”, line 655, in send
  41. r = adapter.send(request, **kwargs)
  42. File “E:\ai\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 414, in send
  43. raise InvalidURL(e, request=request)
  44. requests.exceptions.InvalidURL: Failed to parse: http://127.0.0.1:7890
  45. 请按任意键继续. . .
复制代码
据错误消息,你的命令行工作目次可能不在 Git 堆栈中,所以 Git 执行 git rev-parse HEAD 命令时出现了 fatal: not a git repository (or any of the parent directories): .git 错误。你可以在命令行中切换到堆栈目次,大概在启动脚本中指定 Git 堆栈的路径。
加载时间较长

  1. (base) D:\openai.wiki\stable-diffusion-webui>webui-user.bat
  2. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: 955df7751eef11bb7697e2d77f6b8a6226b21e13
  5. Installing requirements for Web UI
  6. Launching Web UI with arguments:
  7. No module ‘xformers’. Proceeding without it.
  8. Calculating sha256 for D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\final-pruned.ckpt: a7529df02340e5b4c3870c894c1ae84f22ea7b37fd0633e5bacfad9618228032
  9. Loading weights [a7529df023] from D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\final-pruned.ckpt
  10. Creating model from config: D:\openai.wiki\stable-diffusion-webui\configs\v1-inference.yaml
  11. LatentDiffusion: Running in eps-prediction mode
  12. DiffusionWrapper has 859.52 M params.
  13. Applying cross attention optimization (Doggettx).
  14. Textual inversion embeddings loaded(0):
  15. Model loaded in 16.0s (calculate hash: 5.9s, load weights from disk: 3.8s, create model: 0.5s, apply weights to model: 2.0s, apply half(): 0.9s, move model to device: 1.0s, load textual inversion embeddings: 1.8s).
复制代码
电脑配置差,多等一会。
端口被占用

  1. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  2. Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)]
  3. Commit hash:
  4. Installing requirements for Web UI
  5. Launching Web UI with arguments:
  6. No module ‘xformers’. Proceeding without it.
  7. Loading weights [cc6cb27103] from D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt
  8. Creating model from config: D:\openai.wiki\stable-diffusion-webui\configs\v1-inference.yaml
  9. LatentDiffusion: Running in eps-prediction mode
  10. DiffusionWrapper has 859.52 M params.
  11. Applying cross attention optimization (Doggettx).
  12. Textual inversion embeddings loaded(0):
  13. Model loaded in 4.5s (load weights from disk: 1.3s, create model: 0.4s, apply weights to model: 0.5s, apply half(): 0.7s, move model to device: 0.7s, load textual inversion embeddings: 0.9s).
  14. Running on local URL: http://127.0.0.1:7861
复制代码
大佬好,在安装以后运行webui-user.bat的时候出现一下,安装过程中弹过error但是自己重试安装成功了,之后运行网址都没有反应,就是空缺的,请您帮忙看看什么原因呢?
To create a public link, set share=True in launch().
Startup time: 10.4s (import torch: 1.4s, import gradio: 1.0s, import ldm: 0.5s, other imports: 1.0s, setup codeformer: 0.2s, load scripts: 1.0s, load SD checkpoint: 4.8s, create ui: 0.4s, gradio launch: 0.1s).
正常来说 给出的应该是7860,而你的是http://127.0.0.1:7861,那代表你可能在CMD中开启了代理,大概其它应用占用了7860端口号,发起排查一下端口号的问题。
最便捷的办理办法就是关掉是这个CMD,然后去SD的项目根目次内运行webui-user.bat文件夹即可。
非Windows系统

  1. Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
  2. Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
  3. Traceback (most recent call last):
  4. File “/home/mark/Desktop/123/stable-diffusion-webui_23-03-10/launch.py”, line 355, in
  5. prepare_environment()
  6. File “/home/mark/Desktop/123/stable-diffusion-webui_23-03-10/launch.py”, line 288, in prepare_environment
  7. git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_commit_hash)
  8. File “/home/mark/Desktop/123/stable-diffusion-webui_23-03-10/launch.py”, line 143, in git_clone
  9. current_hash = run(f'”{git}” -C “{dir}” rev-parse HEAD’, None, f”Couldn’t determine {name}’s hash: {commithash}”).strip()
  10. File “/home/mark/Desktop/123/stable-diffusion-webui_23-03-10/launch.py”, line 97, in run
  11. raise RuntimeError(message)
  12. RuntimeError: Couldn’t determine Stable Diffusion’s hash: cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf.
  13. Command: “git” -C “/home/mark/Desktop/123/stable-diffusion-webui_23-03-10/repositories/stable-diffusion-stability-ai” rev-parse HEAD
  14. Error code: 129
  15. stdout:
  16. stderr: Unknown option: -C
  17. usage: git [–version] [–help] [-c name=value]
  18. [–exec-path[=]] [–html-path] [–man-path] [–info-path]
  19. [-p|–paginate|–no-pager] [–no-replace-objects] [–bare]
  20. [–git-dir=] [–work-tree=] [–namespace=]
  21. []
复制代码
这个错误提示是git命令在运行时出了问题,它在执行“git -C”命令时出现了错误,因为“-C”是一个未知的选项。
可能是因为并非Windows系统而导致的,本教程仅针对Windows,对Liunx暂不讨论。
语法错误

标准错误:错误:Error [WinError 2] 系统找不到指定的文件,执行命令git version 错误:找不到命令’git’ – 你是否已安装并将其到场了环境变量中?
set-Location:找不到接受实际参数的“D:openai.wiki\stable-diffusion-webui”的位置参数所在的位置 行:1 字符:1
+cd、d D:\openai.wiki\stable-diffusion-webui
这个错误提示是在实行改变当前目次(CD)到“D:\openai.wiki\stable-diffusion-webui”时出现的。错误提示表明系统找不到这个目次。
可能的原因之一是指定的路径不正确,大概该目次不存在。您可以确认一下指定的路径是否正确,并且该目次是否存在。如果不存在,请确保您输入的路径正确,并且该目次已创建。
另外一个问题就是cd 、d 路径这句命令行,应该是cd /d 路径,请注意中英文符号问题。
显存不敷

  1. (base) D:\openai.wiki\stable-diffusion-webui>webui-user.bat
  2. venv “D:\openai.wiki\stable-diffusion-webui\venv\Scripts\Python.exe”
  3. Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)]
  4. Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
  5. Installing requirements for Web UI
  6. Launching Web UI with arguments:
  7. No module ‘xformers’. Proceeding without it.
  8. Loading weights [ad2a33c361] from D:\openai.wiki\stable-diffusion-webui\models\Stable-diffusion\v2-1_768-ema-pruned.ckptCreating model from config: D:\openai.wiki\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\configs\stable-diffusion\v2-inference-v.yaml
  9. LatentDiffusion: Running in v-prediction mode
  10. DiffusionWrapper has 865.91 M params.
  11. loading stable diffusion model: OutOfMemoryError
  12. Traceback (most recent call last):
  13. File “D:\openai.wiki\stable-diffusion-webui\webui.py”, line 136, in initialize
  14. modules.sd_models.load_model()
  15. File “D:\openai.wiki\stable-diffusion-webui\modules\sd_models.py”, line 441, in load_model
  16. sd_model.to(shared.device)
  17. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\core\mixins\device_dtype_mixin.py”, line 113, in to
  18. return super().to(*args, **kwargs)
  19. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 989, in to
  20. return self._apply(convert)
  21. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  22. module._apply(fn)
  23. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  24. module._apply(fn)
  25. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 641, in _apply
  26. module._apply(fn)
  27. [Previous line repeated 4 more times]
  28. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 664, in _apply
  29. param_applied = fn(param)
  30. File “D:\openai.wiki\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py”, line 987, in convert
  31. return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  32. torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.66 GiB already allocated; 0 bytes free; 1.71 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
  33. Stable diffusion model failed to load, exiting
  34. 请按任意键继续. . .
复制代码
根据错误信息显示,Stable Diffusion 模子加载时遇到了 CUDA 显存不敷的错误,简朴点来说就是显卡不行,没有充足的显存空间分配给该模子。
办理方法1:

换个好一些的显卡,至少英伟达2060以上。
办理方法2:

开启低显存模式,开启低显存模式的方法如下。
在stable-diffusion-webui文件夹下找到webui-user.bat,用文本或代码编辑器打开该文件夹,可以看到如下内容。
  1. @echo off
  2. set PYTHON=
  3. set GIT=
  4. set VENV_DIR=
  5. set COMMANDLINE_ARGS=
  6. call webui.bat
复制代码
我们只需要修改set COMMANDLINE_ARGS=部分即可,该部分内容是启动参数。
低于3G显存

如果你的显卡显存不敷3G,可以在set COMMANDLINE_ARGS=的背面添加参数–lowvram –always-batch-cond-uncond之后生存即可,变动之后的文件内容如下。
  1. @echo off
  2. set PYTHON=
  3. set GIT=
  4. set VENV_DIR=
  5. set COMMANDLINE_ARGS=–lowvram –always-batch-cond-uncond
  6. call webui.bat
复制代码
4G显存

如果你的显卡只有4G显存,可以在set COMMANDLINE_ARGS=的背面添加参数–precision full –no-half –lowvram –always-batch-cond-uncond之后生存即可,变动之后的文件内容如下。
  1. @echo off
  2. set PYTHON=
  3. set GIT=
  4. set VENV_DIR=
  5. set COMMANDLINE_ARGS=–precision full –no-half –lowvram –always-batch-cond-uncond
  6. call webui.bat
复制代码
低于5G显存

如果你的显卡显存不敷5G,可以在set COMMANDLINE_ARGS=的背面添加参数–medvram之后生存即可,变动之后的文件内容如下。
  1. @echo off
  2. set PYTHON=
  3. set GIT=
  4. set VENV_DIR=
  5. set COMMANDLINE_ARGS=–medvram
  6. call webui.bat
复制代码
6G显存

如果你的显卡只有6G显存,可以在set COMMANDLINE_ARGS=的背面添加参数–precision full –no-half –medvram之后生存即可,变动之后的文件内容如下。
  1. @echo off
  2. set PYTHON=
  3. set GIT=
  4. set VENV_DIR=
  5. set COMMANDLINE_ARGS=–precision full –no-half –medvram
  6. call webui.bat
复制代码
  这份完整版的SD整合包已经上传CSDN,朋侪们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】

  学好 AI绘画 不论是就业还是做副业赚钱都不错,但要学会 AI绘画 还是要有一个学习规划。最后大家分享一份全套的 AI绘画 学习资料,给那些想学习 AI绘画 的小伙伴们一点帮助!
对于0基础小白入门:
   如果你是零基础小白,想快速入门AI绘画是可以考虑的。
  一方面是学习时间相对较短,学习内容更全面更集中。
二方面是可以找到得当自己的学习方案
  包罗:stable diffusion安装包、stable diffusion0基础入门全套PDF,视频学习教程。带你从零基础系统性的学好AI绘画!
零基础AI绘画学习资源介绍






欢迎光临 qidao123.com技术社区-IT企服评测·应用市场 (https://dis.qidao123.com/) Powered by Discuz! X3.4