教程:Stable Diffusion 安装过程中常见报错解决方法

教程:Stable Diffusion 安装过程中常见报错解决方法

教程:Stable Diffusion 安装过程中常见报错解决方法 教程:Stable Diffusion 安装过程中常见报错解决方法 Modified April 16, 2024 Launching Web UI with arguments: No module ‘xformers’. Proceeding without it. Calculating sha256 for D:\openai.wiki\stable diffusion webui\models\Stable diffusion\final pruned.ckpt: a7529df02340e5b4c3870c894c1ae84f22ea7b37fd0633e5bacfad9618228032 Loading weights [a7529df023] from D:\openai.wiki\stable diffusion webui\models\Stable diffusion\final pruned.ckpt Creating model from config: D:\openai.wiki\stable diffusion webui\configs\v1 inference.yaml LatentDiffusion: Running in eps prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): 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). 电脑配置差,多等一会。 端口被占用 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 requirements for Web UI Launching Web UI with arguments: No module ‘xformers’. Proceeding without it. Loading weights [cc6cb27103] from D:\openai.wiki\stable diffusion webui\models\Stable diffusion\v1 5 pruned emaonly.ckpt Creating model from config: D:\openai.wiki\stable diffusion webui\configs\v1 inference.yaml LatentDiffusion: Running in eps prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): 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). Running on local URL: http://127.0.0.1:7861 大佬好,在安装以后运行 webui user.bat 的时候出现一下,安装过程中弹过 error 但是自己重试安装成功了,之后运行网址都没有反应,就是空白的,请您帮忙看看什么原因呢? To create a public link, set share=True . 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 系统 Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] Commit hash: 22bcc7be428c94e9408f589966c2040187245d81 Traceback (most recent call last): File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 355, in prepare environment() File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 288, in prepare environment git clone(stable diffusion repo, repo dir(‘stable diffusion stability ai’), “Stable Diffusion”, stable diffusion commit hash) File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 143, in git clone current hash = run(f'”{git}” C “{dir}” rev parse HEAD’, None, f”Couldn’t determine {name}’s hash: {commithash}”).strip() File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 97, in run raise RuntimeError(message) RuntimeError: Couldn’t determine Stable Diffusion’s hash: cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf. Command: “git” C “/home/mark/Desktop/123/stable diffusion webui 23 03 10/repositories/stable diffusion stability ai” rev parse HEAD Error code: 129 stdout: stderr: Unknown option: C usage: git [–version] [–help] [ c name=value] [–exec path[=]] [–html path] [–man path] [–info path] [ p|–paginate|–no pager] [–no replace objects] [–bare] Launching Web UI with arguments: No module ‘xformers’. Proceeding without it. Calculating sha256 for D:\openai.wiki\stable diffusion webui\models\Stable diffusion\final pruned.ckpt: a7529df02340e5b4c3870c894c1ae84f22ea7b37fd0633e5bacfad9618228032 Loading weights [a7529df023] from D:\openai.wiki\stable diffusion webui\models\Stable diffusion\final pruned.ckpt Creating model from config: D:\openai.wiki\stable diffusion webui\configs\v1 inference.yaml LatentDiffusion: Running in eps prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): 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). 电脑配置差,多等一会。 端口被占用 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 requirements for Web UI Launching Web UI with arguments: No module ‘xformers’. Proceeding without it. Loading weights [cc6cb27103] from D:\openai.wiki\stable diffusion webui\models\Stable diffusion\v1 5 pruned emaonly.ckpt Creating model from config: D:\openai.wiki\stable diffusion webui\configs\v1 inference.yaml LatentDiffusion: Running in eps prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): 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). Running on local URL: http://127.0.0.1:7861 大佬好,在安装以后运行 webui user.bat 的时候出现一下,安装过程中弹过 error 但是自己重试安装成功了,之后运行网址都没有反应,就是空白的,请您帮忙看看什么原因呢? To create a public link, set share=True . 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 系统 Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] Commit hash: 22bcc7be428c94e9408f589966c2040187245d81 Traceback (most recent call last): File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 355, in prepare environment() File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 288, in prepare environment git clone(stable diffusion repo, repo dir(‘stable diffusion stability ai’), “Stable Diffusion”, stable diffusion commit hash) File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 143, in git clone current hash = run(f'”{git}” C “{dir}” rev parse HEAD’, None, f”Couldn’t determine {name}’s hash: {commithash}”).strip() File “/home/mark/Desktop/123/stable diffusion webui 23 03 10/launch.py”, line 97, in run raise RuntimeError(message) RuntimeError: Couldn’t determine Stable Diffusion’s hash: cf1d67a6fd5ea1aa600c4df58e5b47da45f6bdbf. Command: “git” C “/home/mark/Desktop/123/stable diffusion webui 23 03 10/repositories/stable diffusion stability ai” rev parse HEAD Error code: 129 stdout: stderr: Unknown option: C usage: git [–version] [–help] [ c name=value] [–exec path[=]] [–html path] [–man path] [–info path] [ p|–paginate|–no pager] [–no replace objects] [–bare] [–git dir=] [–work tree=] [–namespace=] [] 这个错误提示是 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 路径,请注意中英文符号问题。 显存不足 (base) D:\openai.wiki\stable diffusion webui webui user.bat venv “D:\openai.wiki\stable diffusion webui\venv\Scripts\Python.exe” Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 8 2023, 10:42:25) [MSC v.1916 64 bit (AMD64)] Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2 Installing requirements for Web UI Launching Web UI with arguments: No module ‘xformers’. Proceeding without it. 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 LatentDiffusion: Running in v prediction mode DiffusionWrapper has 865.91 M params. loading stable diffusion model: OutOfMemoryError Traceback (most recent call last): File “D:\openai.wiki\stable diffusion webui\webui.py”, line 136, in initialize modules.sd models.load model() File “D:\openai.wiki\stable diffusion webui\modules\sd models.py”, line 441, in load model sd model.to(shared.device) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\pytorch lightning\core\mixins\device dtype mixin.py”, line 113, in to return super().to( args, kwargs) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 989, in to return self. apply(convert) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 641, in apply module. apply(fn) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 641, in apply module. apply(fn) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 641, in apply module. apply(fn) [Previous line repeated 4 more times] File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 664, in apply param applied = fn(param) File “D:\openai.wiki\stable diffusion webui\venv\lib\site packages\torch\nn\modules\module.py”, line 987, in convert return t.to(device, dtype if t.is floating point() or t.is complex() else None, non blocking) 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 Stable diffusion model failed to load, exiting 请按任意键继续。 . . 根据错误信息显示,Stable Diffusion 模型加载时遇到了 CUDA 显存不足的错误,简单点来说就是显卡不行,没有足够的显存空间分配给该模型。 解决方法 1: 换个好一些的显卡,至少英伟达 2060 以上。 解决方法 2: 开启低显存模式,开启低显存模式的方法如下。 在 stable diffusion webui 文件夹下找到 webui user.bat,用文本或代码编辑器打开该文件夹,可以看到如下内容。 @echo off set PYTHON= set GIT= set VENV DIR= set COMMANDLINE ARGS= call webui.bat 我们只需要修改set COMMANDLINE ARGS=部分即可,该部分内容是启动参数。 低于 3G 显存 如果你的显卡显存不足 3G,可以在set COMMANDLINE ARGS=的后面添加参数–lowvram –always batch cond uncond之后保存即可,变更之后的文件内容如下。 @echo off set PYTHON= set GIT= set VENV DIR= set COMMANDLINE ARGS=–lowvram –always batch cond uncond call webui.bat 4G 显存 如果你的显卡只有 4G 显存,可以在set COMMANDLINE ARGS=的后面添加参数–precision full –no half –lowvram –always batch cond uncond之后保存即可,变更之后的文件内容如下。 @echo off set PYTHON= set GIT= set VENV DIR= set COMMANDLINE ARGS=–precision full –no half –lowvram –always batch cond uncond call webui.bat 低于 5G 显存 如果你的显卡显存不足 5G,可以在set COMMANDLINE ARGS=的后面添加参数–medvram之后保存即可,变更之后的文件内容如下。 @echo off set PYTHON= set GIT= set VENV DIR= set COMMANDLINE ARGS=–medvram call webui.bat 6G 显存 如果你的显卡只有 6G 显存,可以在set COMMANDLINE ARGS=的后面添加参数–precision full –no half –medvram之后保存即可,变更之后的文件内容如下。 @echo off set PYTHON= set GIT= set VENV DIR= set COMMANDLINE ARGS=–precision full –no half –medvram call webui.bat Stable Diffusion|安装过程中常见报错解决方法 大家可能在安装部署 Stable Diffusion WebUI 过程中遇到各种各样的问题,本站已对所有问题进行汇总整理,而且教大家如何去查看报错。解决常见的 Installing gfpgan、BLIP 错误、显存不足等各种各样的花式问题,希望大家在看完此文章之后,都能够顺利解决各自所遇到的问题。 如何查看报错 在你安装时可能经常遇到各种各样的问题,但是对于一堆陌生的英文和各种各样的错误,大家可能经常无从下手,下面我将会教大家如何查看报错。 我们先看一下第一行内容(base) C:\OpenAI.Wiki\stable diffusion webui webui user.bat,前面的(base)是使用 conda 创建的虚拟环境名称,代表我们目前正在使用哪一个虚拟环境,很显然这与本站所提供的教程是不一致的,正常来说应该是(D:\open

在 小宇宙note 阅读完整内容