本地部署 AI作画工具 stable-diffusion-webui 多种模型 可生成NSFW

浏览: 8,579 次浏览 作者: 去年夏天 分类: AI绘画,Windows,技术文章 发布时间: 2022-10-14 21:51

AI作画最近非常火热啊,本文是在使用N卡的电脑上,本地部署stable-diffusion-webui前端+替换默认的模型,实现生成高质量的二次元图像,并且可以不受限制的生成图片(在线版一般会阻止NSFW内容生成)。



所需资源下载位置:

Git:https://git-scm.com/download

CUDA:https://developer.nvidia.com/cuda-toolkit-archive

Python3.10.6:https://www.python.org/downloads/release/python-3106/

waifu-diffusion:https://huggingface.co/hakurei/waifu-diffusion

waifu-diffusion-v1-3:https://huggingface.co/hakurei/waifu-diffusion-v1-3

stable-diffusion-v-1-4-original: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original

stable-diffusion-v-1-5: https://huggingface.co/runwayml/stable-diffusion-v1-5

stable-diffusion-webui:https://github.com/AUTOMATIC1111/stable-diffusion-webui

NovelAILeaks 4chan:https://pub-2fdef7a2969f43289c42ac5ae3412fd4.r2.dev/naifu.tar

NovelAILeaks animefull-latest:https://pub-2fdef7a2969f43289c42ac5ae3412fd4.r2.dev/animefull-latest.tar


开始

首先请确定你有基本的理解能力和动手能力,基本的网络搜索检索信息的能力。过于基础的东西比如“什么是命令行”,“如何下载文件”,“magnet是什么东西”,“满屏英语看不懂”,“怎么给Python,Git加上魔法上网”等等这些过于基础的问题,我这里无法做出说明,也不会解答。

要顺利运行 stable-diffusion-webui与模型,
需要足够大的显存,最低配置4GB显存,基本配置6GB显存,推荐配置12GB显存。
当然内存也不能太小,最好大于16GB。

显存大小决定了你能生成的图片尺寸,一般而言图片尺寸越大,AI能发挥的地方越多,画面里填充的细节就越多。
GPU主频和显存位宽,则决定了你能生成的多快。
当显存不足时,只能用时间换性能,将生成时间延长4倍,甚至8~10倍来生成同样的图片。

教程部署环境为
CPU:Intel® Core™ i7-10750H
GPU:NVIDIA Quadro T2000 with Max-Q Design (显存4GB)
内存:16GB * 4
磁盘:1TB * 2 SSD
OS:win11 21H1


准备运行环境

需要准备3个或4个东西
Python 3.10.6,Git ,CUDA,这三个的下载地址在文章的最前边。
视情况,你可能还需要一个魔法上网工具(假设你的魔法上网工具代理在127.0.0.1:6808)

安装 Python 3.10.6 与 pip

请一定安装3.10.6版本的Python,其他版本高几率无法运行
请一定安装3.10.6版本的Python,其他版本高几率无法运行
请一定安装3.10.6版本的Python,其他版本高几率无法运行

我这里采用直接系统内安装Python 3.10.6的方式
如果你会用Miniconda,也可以用Miniconda实现Python多版本切换,具体我这里不教需要的自己琢磨。

  1. 访问 Python3.10.6 下载页面

  2. 把页面拉到底,找到【Windows installer (64-bit)】点击下载

  3. 安装是注意,到这一步,需要如下图这样勾选 Add Python to PATH

    然后再点上边的 Install Now
    python

  4. 安装完成后,命令行里输入Python -V,如果返回Python 3.10.6那就是成功安装了。

  5. 命令行里输入 python -m pip install --upgrade pip安装升级pip到最新版。

请一定安装3.10.6版本的Python,其他版本高几率无法运行
请一定安装3.10.6版本的Python,其他版本高几率无法运行
请一定安装3.10.6版本的Python,其他版本高几率无法运行

安装 Git

  1. 访问 Git 下载页面

  2. 点击【Download for Windows】,【64-bit Git for Windows Setup】点击下载

  3. 一路下一步安装

  4. 命令行运行git --version,返回git version 2.XX.0.windows.1就是安装成功了。

安装 CUDA (nvidia显卡用户)

  1. 命令行运行nvidia-smi,看下自己显卡支持的 CUDA版本
    (升级显卡驱动有可能会让你支持更高版本的 CUDA)

  2. 接下来前往英伟达 CUDA 官网,下载对应版本。
    注意请下载,你对应的版本号最高的版本,比如我的是11.7的,那就下11.7.1(这里最后的.1意思是,11.7版本的1号升级版)

  3. 选你自己的操作系统版本,注意下个离线安装包【exe [local]】,在线安装的话,速度还是比较堪忧的。

下载stable-diffusion-webui (nvidia显卡用户)

找一个你喜欢的目录,在资源管理器,地址栏里敲CMD,敲回车,启动命令提示行窗口,输入以下命令

# 下载项目源代码
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
# 切换到项目根目录
cd stable-diffusion-webui
  • 他会在你选择的目录下生成stable-diffusion-webui文件夹,放项目
  • 这东西本体+虚拟环境+集中模型+增强脚本最后会很大的,目前我已经占用了快20GB了,请放到磁盘空间富裕的盘符
  • 整个路径中,不要有中文(比如“C:\AI作画工具\”),也不要有空格(比如“C:\Program Files”)可以避免很多奇怪的问题。

下载stable-diffusion-webui (AMD 显卡用户)

这是AMD显卡用户的步骤,nvidia显卡用户可以略过,stable-diffusion-webui尚未正式支持AMD,目前是 lshqqytiger 大佬制作的分支版(stable-diffusion-webui-directml),Training功能AMD用户无法使用,也就是无法训练,但其他功能比如文字生成图,图生图,重绘,扩展,LoRAs等都可以正常工作。

找一个你喜欢的目录,在资源管理器,地址栏里敲CMD,敲回车,启动命令提示行窗口,输入以下命令

# 下载项目源代码并安装
git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml && cd stable-diffusion-webui-directml && git submodule init && git submodule update

下载模型文件

stable-diffusion-webui只是个工具,他需要后端的训练模型来让AI参考建模。
目前比较主流的模型有

  • stable-diffusion:偏真人(一般简称为 SD 模型, SDwebui 模型)
  • waifu-diffusion:偏向二次元(一般简称 Waifu 模型,WD模型)
  • Novel-AI-Leaks:更加偏向二次元(一般简称 Naifu 模型)

模型文件一般都比较大,请找个空间富裕的磁盘下载。

更多模型下载可以看下这个:《AI 绘画与作画 常见模型汇总及简介

模型的大致区别

名称 需求 效果 备注
stable-diffusion (4GB emaonly模型) 2GB 显存起步 出图速度 10s,单次最大出 920×920 适合出图用
stable-diffusion (7GB full ema模型) 4GB 显存起步 带最后一次训练的权重,所以费显存 适合训练用
waifu (Float 16 EMA 模型) 2GB显存起步 与stable性能接近 ,显存占用略高 适合出图用
waifu (Float 32 EMA 模型) 2GB显存起步 与stable性能接近,显存占用略高 适合出图用,出图质量其实和16差别不大
waifu (Float 32 Full 模型) 4GB显存起步 与stable性能接近,显存占用略高 适合出图或训练用
waifu (Float 32 Full + Optimizer 模型) 8GB显存起步 与stable性能接近,显存占用略高 适合训练用
Naifu (4GB pruned 模型) 最低8GB显存&8GB显存 和官方比较接近 适合出图用
Naifu (7GB latest模型) 最低8GB显存(向上浮动10GB) 和官方比较接近 适合出图或训练用
  • 注意这里显存指的是512X512尺寸,默认配置下,出图时软件所需要占用的显存。2GB显存起步,意味浙你电脑显卡实际显存最少也要3GB(因为系统桌面,浏览器的显示也需要占用一部分显存)
  • 通过增加各种“优化”参数,可以通过性能的部分下降换取显存占用减少。
  • Nafu模型名称说明1:animefull-final-pruned = full-latest = NAI 全量模型(包含NSFW)
  • Nafu模型名称说明2:animesfw-latest = NAI 基线模型

下载stable-diffusion

下载的方式有 3 个

下载 waifu-diffusion

下载 NovelAILeaks

  • Naifu Leaks 4chan:https://pub-2fdef7a2969f43289c42ac5ae3412fd4.r2.dev/naifu.tar

  • Naifu Leaks animefull-latest:https://pub-2fdef7a2969f43289c42ac5ae3412fd4.r2.dev/animefull-latest.tar

  • 找到naifu\models\animefull-final-pruned\model.ckpt放在\stable-diffusion-webui\models\Stable-diffusion\ 下文件名可以是任何你喜欢的英文名,比如Naifu-Leaks- 4chan.ckpt

  • 找到naifu\models\animefull-final-pruned\config.yaml放在\stable-diffusion-webui\models\Stable-diffusion\ 下文件名改成上边和你上边的文件同名,比如Naifu-Leaks- 4chan.yaml

  • 找到naifu\modules\,把里面所有的.pt文件复制到\stable-diffusion-webui\models\hypernetworks\文件夹下,没有这个文件夹就自己新建一个。

下载其他模型

出于篇幅问题,其他常见的绘画用模型请参考另一篇文章
《AI 绘画与作画 stable diffusion webui 常见模型汇总及简介》

运行

  1. 双击运行\stable-diffusion-webui\webui-user.bat

  2. 耐心等待,脚本会自己检查依赖,会下载大约几个G的东西,解压安装到文件夹内(视网速不同,可能需要20分钟~2小时不等)无论看起来是不是半天没变化,感觉像卡住了,或者你发现电脑也没下载东西,窗口也没变化。千万不要关闭这个黑乎乎的CMD窗口,只要窗口最下方没显示类似“按任意键关闭窗口”的话,那脚本就是依然在正常运行的。

绝大部分情况下,这个阶段出现报错都是因为你的git与python访问国际互联网时遇到障碍所导致的,比如类似Couldn’t checkout commit,Recv failure: Connection was reset,Proxy URL had no scheme, should start with http:// or https://的提示。

  1. 当你看到下图这行字的时候,就是安装成功了

  2. 复制到浏览器访问即可(默认是 http://127.0.0.1:7860 )(注意不要关闭这个窗口,关闭就退出了)

生成第一张AI作图

这里只是简单说一下,稍微详细一点的教程请看另一篇文章:《AI绘画指南 (SD webui)如何设置与使用

  1. Prompt 里填写想要的特征点

(((masterpiece))),((best quality)), flat chest,((loli)),((one girl)),very long light white hair, beautiful detailed red eyes,aqua eyes,white robe, cat ears,(flower hairpin),sunlight, light smile,blue necklace,see-through,
以上大概意思就是
杰作,最佳品质,贫乳,萝莉,1个女孩,很长的头发,淡白色头发,红色眼睛,浅绿色眼睛,白色长裙,猫耳,发夹,阳光下,淡淡的微笑,蓝色项链,透明

  1. Negative prompt 里填不想要的特征点
    ((part of the head)), ((((mutated hands and fingers)))), deformed, blurry, bad anatomy, disfigured, poorly drawn face, mutation, mutated, extra limb, ugly, poorly drawn hands, missing limb, blurry, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, Octane renderer,lowres, bad anatomy, bad hands, text, missing fingers, worst quality, low quality, normal quality, signature, watermark, blurry,ugly, fat, obese, chubby, (((deformed))), [blurry], bad anatomy, disfigured, poorly drawn face, mutation, mutated, (extra_limb), (ugly), (poorly drawn hands), messy drawing,(2girls), morbid, mutilated, tranny, trans, trannsexual, [out of frame], (bad proportions), octane render, unity, unreal, maya, photorealistic
    大概意思就是排除一些负面标签,比如奇怪的手,奇怪的肢体,减少生成奇怪图片的几率

  2. Sampling Steps 你可以理解让AI推演多少步,一般来说超过17基本就能看了,步数越多,画面中的细节就越多,但需要的时间也就越久,一般20~30是一个比较稳妥的设定。这个数不会改变画面内容,只会让内容更加精细,比如20的项链就是一个心形钻石,而50的项链还是同样的心形钻石,只是钻石上会有更加复杂的线条

  3. Sampling method 你可以理解成AI推演的算法,一般Euler a,Euler ,DDIM,都是不错的,任选一个就行。

  4. 图片分辨率 这个就是拼显卡显存的,自己调吧,低于512X512可能画面就不会有太多细节了,越大的分辨率AI能发挥的地方就越多。

  5. 下边是3个扩展选项,一般不需要勾选。
    Restore faces:勾选后可以生成更真实的脸,第一次勾选使用时,需要先下载几个G的运行库。
    Tiling:让图片可以平铺(类似瓷砖,生成的图案左右上下都可以无缝衔接上自己)
    Highres. fix:超分辨率,让AI用更高的分辨率填充内容,但生成的最终尺寸还是你上边设定的尺寸。

  6. 生成几次,每次多少张
    Batch count:是一次运行几次
    Batch size: 是同时生成多少张

比如:Batch count设置为4,用时N分钟*4,生成4张图;Batch count设置为4,用时N分钟,生成4张图,但是同时需要的显存也是4倍。512X512大概需要3.75GB显存,4倍就是15GB显存了。

  1. CFG Scale AI有多参考你的Prompt与Negative prompt
    开得越高,AI越严格按照你的设定走,但也会有越少的创意
    开的越低,AI就越放飞自我,随心所欲的画。
    一般7左右就行。

  2. Seed 随机数种子,AI作画从原理上其实就是用一个随机的噪声图,反推回图像。但因为计算机里也没有真随机嘛,所以实际上,AI作画的起始噪声,是可以量化为一个种子数的。

  3. Generate 开始干活按钮,这个就不用说了吧,点了AI就开始干活了。

  4. Stable Diffusion checkpoint 在最左上角,是选择模型的,前边让你下载了三个,请根据自己需求和体验自行选择使用。


后话

  1. 使用NovelAILeaks模型,有一个额外的设置,请在页面中选择【settings选项卡】,把页面往下拉到底,找到setting CLIP stop at last layers(Clip 跳过层),把他设置为2

  2. AI作图不是释放魔法,不是魔咒越长施法前摇越长的魔咒威力就越大。请简洁、准确、详细的描述你需要的Prompt即可。像我上边的要求就是,1个萝莉,穿白色连衣裙,瞳孔红色,长发,白色,带发卡,猫耳,微笑,阳光下。半透明材质衣服,已经WebUI是有75个词限制的。

  3. 如果你想生成更大尺寸的图,但是显卡显存不足

用文本编辑器打开\stable-diffusion-webui\webui-user.bat。
在COMMANDLINE_ARGS=后添加–medvram
如果还不行,改成–medvram –xformers
如果还不行,改成–medvram –opt-split-attention –xformers
如果还不行,改成–lowvram
如果还不行,改成–lowvram –xformers
如果还不行,改成–lowvram –opt-split-attention
注意这是个用生成时间换图片尺寸的事情,最极端的参数可能导致你图片生成时间是之前的好几倍。
最极端参数是个什么概念呢,比如默认配置512X512一张图是10秒内,但显存需要4G,改成最极端配置,显存仅需0.5~0.7G(和Sampling method有关),但代价是时长变成3分钟。

  1. 16XX系显卡,需要用文本编辑器打开\stable-diffusion-webui\webui-user.bat。
    在COMMANDLINE_ARGS=后添加–precision full –no-half
    类似下边这样,不然生成图会是黑块或者绿块,这是个16XX系显卡的bug
@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=---precision full --no-half

call webui.bat

  1. 示意图中tag如下,理论上只要参数完全一致,就可以复现出一样的画(仅些微细节不同)
Stable Diffusion checkpoint:NovelAILeaks 4chan[925997e9]
prompt:
(((masterpiece))),((best quality)), flat chest,((loli)),((one girl)),very long hair,light white hair, red eyes,aqua eyes,white robe, cat ears,(flower hairpin),sunlight, light smile,beautiful detailed blue necklace,see-through,
Negative prompt: ((part of the head)), ((((mutated hands and fingers)))), deformed, blurry, bad anatomy, disfigured, poorly drawn face, mutation, mutated, extra limb, ugly, poorly drawn hands, missing limb, blurry, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, Octane renderer,lowres, bad anatomy, bad hands, text, missing fingers, worst quality, low quality, normal quality, signature, watermark, blurry,ugly, fat, obese, chubby, (((deformed))), [blurry], bad anatomy, disfigured, poorly drawn face, mutation, mutated, (extra_limb), (ugly), (poorly drawn hands), messy drawing,(2girls), morbid, mutilated, tranny, trans, trannsexual, [out of frame], (bad proportions), octane render, unity, unreal, maya, photorealistic
Steps: 27, S
ampler: Euler a, 
CFG scale: 7, 
Seed: 2413789891, 
Size: 1024x768, 
Model hash: 925997e9, 
Clip skip: 2
  1. 如果你想了解AI绘画的原理,这里有一篇不错的文章:学习AI绘画,从Diffusion和CLIP开始

  2. 如果你自身硬件性能不足,想要购买租用GPU机器,可以看一下这篇文章的这部分《常见云 GPU 介绍

155 条评论
  • BETA

    2023-06-18 16:45

    venv “D:\AI\stable-diffusion-webui-master\venv\Scripts\Python.exe”
    fatal: not a git repository (or any of the parent directories): .git
    fatal: not a git repository (or any of the parent directories): .git
    Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
    Version:
    Commit hash:
    Installing requirements
    Launching Web UI with arguments:
    No module ‘xformers’. Proceeding without it.
    Loading weights [0388d03f91] from D:\AI\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
    loading stable diffusion model: SafetensorError
    Traceback (most recent call last):
    File “D:\AI\stable-diffusion-webui-master\modules\sd_models.py”, line 422, in get_sd_model
    load_model()
    File “D:\AI\stable-diffusion-webui-master\modules\sd_models.py”, line 455, in load_model
    state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
    File “D:\AI\stable-diffusion-webui-master\modules\sd_models.py”, line 271, in get_checkpoint_state_dict
    res = read_state_dict(checkpoint_info.filename)
    File “D:\AI\stable-diffusion-webui-master\modules\sd_models.py”, line 250, in read_state_dict
    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\safetensors\torch.py”, line 259, in load_file
    with safe_open(filename, framework=”pt”, device=device) as f:
    safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

    Stable diffusion model failed to load
    Applying optimization: Doggettx… done.
    Traceback (most recent call last):
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\urllib3\connectionpool.py”, line 714, in urlopen
    httplib_response = self._make_request(
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\urllib3\connectionpool.py”, line 466, in _make_request
    six.raise_from(e, None)
    File “”, line 3, in raise_from
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\urllib3\connectionpool.py”, line 461, in _make_request
    httplib_response = conn.getresponse()
    File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py”, line 1374, in getresponse
    response.begin()
    File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py”, line 318, in begin
    version, status, reason = self._read_status()
    File “C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\http\client.py”, line 287, in _read_status
    raise RemoteDisconnected(“Remote end closed connection without”
    http.client.RemoteDisconnected: Remote end closed connection without response

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\adapters.py”, line 486, in send
    resp = conn.urlopen(
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\urllib3\connectionpool.py”, line 798, in urlopen
    retries = retries.increment(
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\urllib3\util\retry.py”, line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
    urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=22307): Max retries exceeded with url: http://127.0.0.1:7860/startup-events (Caused by ProxyError(‘Cannot connect to proxy.’, RemoteDisconnected(‘Remote end closed connection without response’)))

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “D:\AI\stable-diffusion-webui-master\launch.py”, line 38, in
    main()
    File “D:\AI\stable-diffusion-webui-master\launch.py”, line 34, in main
    start()
    File “D:\AI\stable-diffusion-webui-master\modules\launch_utils.py”, line 334, in start
    webui.webui()
    File “D:\AI\stable-diffusion-webui-master\webui.py”, line 395, in webui
    app, local_url, share_url = shared.demo.launch(
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py”, line 1775, in launch
    requests.get(f”{self.local_url}startup-events”, verify=ssl_verify)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\api.py”, line 73, in get
    return request(“get”, url, params=params, **kwargs)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\api.py”, line 59, in request
    return session.request(method=method, url=url, **kwargs)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\sessions.py”, line 589, in request
    resp = self.send(prep, **send_kwargs)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\sessions.py”, line 703, in send
    r = adapter.send(request, **kwargs)
    File “D:\AI\stable-diffusion-webui-master\venv\lib\site-packages\requests\adapters.py”, line 513, in send
    raise ProxyError(e, request=request)
    requests.exceptions.ProxyError: HTTPConnectionPool(host=’127.0.0.1′, port=22307): Max retries exceeded with url: http://127.0.0.1:7860/startup-events (Caused by ProxyError(‘Cannot connect to proxy.’, RemoteDisconnected(‘Remote end closed connection without response’)))

    大佬!这个是什么意思啊?太曲折了,安了好几次,每次问题都不一样

    1. 去年夏天

      2023-06-18 19:31

      127.0.0.1:22307这个代理无法访问。

  • canqqqq

    2023-06-17 10:32

    venv “D:\stable-diffusion-webui-directml\venv\Scripts\Python.exe”
    Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)]
    Version: v1.0
    Commit hash: ba780a8e4fb27d1eb9595947380a63bd84fc419e
    Fetching updates for Stable Diffusion…
    Traceback (most recent call last):
    File “D:\stable-diffusion-webui-directml\launch.py”, line 38, in
    main()
    File “D:\stable-diffusion-webui-directml\launch.py”, line 29, in main
    prepare_environment()
    File “D:\stable-diffusion-webui-directml\modules\launch_utils.py”, line 302, in prepare_environment
    git_clone(stable_diffusion_repo, repo_dir(‘stable-diffusion-stability-ai’), “Stable Diffusion”, stable_diffusion_commit_hash)
    File “D:\stable-diffusion-webui-directml\modules\launch_utils.py”, line 144, in git_clone
    run(f'”{git}” -C “{dir}” fetch’, f”Fetching updates for {name}…”, f”Couldn’t fetch {name}”)
    File “D:\stable-diffusion-webui-directml\modules\launch_utils.py”, line 102, in run
    raise RuntimeError(“\n”.join(error_bits))
    RuntimeError: Couldn’t fetch Stable Diffusion.
    Command: “git” -C “D:\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai” fetch
    Error code: 128
    stderr: fatal: unable to access ‘https://github.com/lshqqytiger/stable-diffusion-webui-directml/’: Could not resolve host: github.com

    请按任意键继续. . .
    请问这个怎么解决

    1. 去年夏天

      2023-06-18 19:30

      git无法访问github.com。考虑使用tun模式或者VPN全局代理

  • aaaaa

    2023-06-16 13:01

    请问下问什么加control net会报错啊
    RuntimeError: MPS backend out of memory (MPS allocated: 4.93 GB, other allocations: 2.00 GB, max allowed: 6.77 GB). Tried to allocate 512.00 MB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure).

  • ray

    2023-05-23 11:44

    Something went wrong
    Expecting value: line 1 column 1 (char 0)
    已经跑起来了页面报这个错怎么解决?

    1. wyx

      2023-06-10 02:19

      全局代理的问题
      set COMMANDLINE_ARGS= –medvram –autolaunch –deepdanbooru –xformers –no-gradio-queue
      issue地址:https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9174#issuecomment-1498580282

  • sunshine

    2023-05-12 16:52

    大哥,怎么给git 还有 python 设置代理啊,找不到相关教程呢,我一直用的clash 梯子

    1. 去年夏天

      2023-05-12 16:54

      clash的话,开启TUN Mode

  • zzz

    2023-05-04 22:26

    您好 我这边所有的依赖和模型都下载了 但是报错如下

    venv “F:\stable-diffusion-webui-master\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash:
    Installing requirements
    Launching Web UI with arguments:
    No module ‘xformers’. Proceeding without it.
    Loading weights [e9f45b4289] from F:\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
    loading stable diffusion model: SafetensorError
    Traceback (most recent call last):
    File “F:\stable-diffusion-webui-master\webui.py”, line 195, in initialize
    modules.sd_models.load_model()
    File “F:\stable-diffusion-webui-master\modules\sd_models.py”, line 424, in load_model
    state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
    File “F:\stable-diffusion-webui-master\modules\sd_models.py”, line 271, in get_checkpoint_state_dict
    res = read_state_dict(checkpoint_info.filename)
    File “F:\stable-diffusion-webui-master\modules\sd_models.py”, line 250, in read_state_dict
    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
    File “F:\stable-diffusion-webui-master\venv\lib\site-packages\safetensors\torch.py”, line 259, in load_file
    with safe_open(filename, framework=”pt”, device=device) as f:
    safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

    Stable diffusion model failed to load, exiting

    请按任意键继续. . .

    实在不知道是哪里的问题 请教一下

    1. 去年夏天

      2023-05-05 14:51

      从提供的报错来看,是默认选择的那个模型文件完整性校验没通过,你重新下载模型文件试试。

      1. zzz

        2023-05-05 19:03

        重新下载可以了 感谢您

  • xiaot

    2023-04-25 09:02

    大佬求助!
    venv “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Fetching updates for Taming Transformers…
    Checking out commit for Taming Transformers with hash: 24268930bf1dce879235a7fddd0b2355b84d7ea6…
    Traceback (most recent call last):
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 289, in prepare_environment
    git_clone(taming_transformers_repo, repo_dir(‘taming-transformers’), “Taming Transformers”, taming_transformers_commit_hash)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 148, in git_clone
    run(f'”{git}” -C “{dir}” checkout {commithash}’, f”Checking out commit for {name} with hash: {commithash}…”, f”Couldn’t checkout commit {commithash} for {name}”)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t checkout commit 24268930bf1dce879235a7fddd0b2355b84d7ea6 for Taming Transformers.
    Command: “git” -C “E:\AIzuotu\stable-diffusion-webui\repositories\taming-transformers” checkout 24268930bf1dce879235a7fddd0b2355b84d7ea6
    Error code: 128
    stdout:
    stderr: fatal: reference is not a tree: 24268930bf1dce879235a7fddd0b2355b84d7ea6

    请按任意键继续. . .

    1. 黥心

      2023-05-22 15:01

      我也是这个问题,请问解决了吗

      1. 去年夏天

        2023-05-22 15:12

        绝大部分提示,无法链接到git的都是因为网络问题。

  • xiaot

    2023-04-25 01:39

    大佬,帮忙看看啥情况?鼓捣一天了。
    venv “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Fetching updates for Taming Transformers…
    Traceback (most recent call last):
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 289, in prepare_environment
    git_clone(taming_transformers_repo, repo_dir(‘taming-transformers’), “Taming Transformers”, taming_transformers_commit_hash)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 147, in git_clone
    run(f'”{git}” -C “{dir}” fetch’, f”Fetching updates for {name}…”, f”Couldn’t fetch {name}”)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t fetch Taming Transformers.
    Command: “git” -C “E:\AIzuotu\stable-diffusion-webui\repositories\taming-transformers” fetch
    Error code: 128
    stdout:
    stderr: fatal: unable to access ‘https://github.com/AUTOMATIC1111/stable-diffusion-webui.git/’: Recv failure: Connection was reset

    1. 去年夏天

      2023-04-25 09:20

      尝试从GitHub仓库获取更新时,连接被重置了,因此无法访问该仓库。建议检查网络连接或者尝试通过代理或VPN连接更新。

  • xiaot

    2023-04-25 00:25

    venv “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Installing gfpgan
    Traceback (most recent call last):
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 263, in prepare_environment
    run_pip(f”install {gfpgan_package}”, “gfpgan”)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 129, in run_pip
    return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
    File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t install gfpgan.
    Command: “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 –prefer-binary
    Error code: 1
    stdout: Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
    Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to c:\users\tomk\appdata\local\temp\pip-req-build-lhp8nout

    stderr: Running command git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-lhp8nout’
    fatal: unable to access ‘https://github.com/TencentARC/GFPGAN.git/’: Recv failure: Connection was reset
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-lhp8nout’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-lhp8nout’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.

    [notice] A new release of pip available: 22.2.1 -> 23.1.1
    [notice] To update, run: E:\AIzuotu\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip

    1. 去年夏天

      2023-04-25 09:19

      网络问题,Git与python无法访问github。

      1. sunshine

        2023-05-12 16:38

        请问这种问题怎么解决啊,我也是这个错误代码

  • try

    2023-04-16 19:19

    兄弟,这是什么问题吖
    venv “D:\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Installing clip
    Traceback (most recent call last):
    File “D:\StableDiffusion\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “D:\StableDiffusion\stable-diffusion-webui\launch.py”, line 266, in prepare_environment
    run_pip(f”install {clip_package}”, “clip”)
    File “D:\StableDiffusion\stable-diffusion-webui\launch.py”, line 129, in run_pip
    return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
    File “D:\StableDiffusion\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t install clip.
    Command: “D:\StableDiffusion\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 –prefer-binary
    Error code: 1
    stdout: Collecting git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
    Cloning https://github.com/openai/CLIP.git (to revision d50d76daa670286dd6cacf3bcd80b5e4823fc8e1) to c:\users\adoreluo\appdata\local\temp\pip-req-build-lpkp164e

    stderr: Running command git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\AdoreLuo\AppData\Local\Temp\pip-req-build-lpkp164e’
    fatal: unable to access ‘https://github.com/openai/CLIP.git/’: Recv failure: Connection was reset
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\AdoreLuo\AppData\Local\Temp\pip-req-build-lpkp164e’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\AdoreLuo\AppData\Local\Temp\pip-req-build-lpkp164e’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.

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

    请按任意键继续. . .

    1. mLazy?

      2023-04-22 09:17

      你的 open-clip 安装失败了,需要在 GetHub 上手动下载,在本地安装

      1. xiaot

        2023-04-25 01:05

        venv “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\Python.exe”
        Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
        Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
        Installing clip
        Traceback (most recent call last):
        File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 355, in
        prepare_environment()
        File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 266, in prepare_environment
        run_pip(f”install {clip_package}”, “clip”)
        File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 129, in run_pip
        return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
        File “E:\AIzuotu\stable-diffusion-webui\launch.py”, line 97, in run
        raise RuntimeError(message)
        RuntimeError: Couldn’t install clip.
        Command: “E:\AIzuotu\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 –prefer-binary
        Error code: 1
        stdout: Collecting git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
        Cloning https://github.com/openai/CLIP.git (to revision d50d76daa670286dd6cacf3bcd80b5e4823fc8e1) to c:\users\tomk\appdata\local\temp\pip-req-build-wafaw3vb

        stderr: Running command git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-wafaw3vb’
        fatal: unable to access ‘https://github.com/openai/CLIP.git/’: Recv failure: Connection was reset
        error: subprocess-exited-with-error

        git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-wafaw3vb’ did not run successfully.
        exit code: 128

        See above for output.

        note: This error originates from a subprocess, and is likely not a problem with pip.
        error: subprocess-exited-with-error

        git clone –filter=blob:none –quiet https://github.com/openai/CLIP.git ‘C:\Users\tomk\AppData\Local\Temp\pip-req-build-wafaw3vb’ did not run successfully.
        exit code: 128

        See above for output.

        note: This error originates from a subprocess, and is likely not a problem with pip.

        [notice] A new release of pip available: 22.2.1 -> 23.1.1
        [notice] To update, run: E:\AIzuotu\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
        本地安装open-clip之后,还这样。

        1. 去年夏天

          2023-04-25 09:17

          你本地装的open-clip路径不对,代码都没发现open-clip

      2. 1212

        2023-05-17 14:12

        你好,你解决了吗,我现在也是这个问题
        本地要安装在哪里呀

  • sirlia

    2023-04-09 14:30

    File “D:\stable-diffusion-webui\venv\lib\site-packages\pip_internal\cli\progress_bars.py”, line 53, in _rich_progress_bar
    for chunk in iterable:
    File “D:\stable-diffusion-webui\venv\lib\site-packages\pip_internal\network\utils.py”, line 63, in response_chunks
    for chunk in response.raw.stream(
    File “D:\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 573, in stream
    data = self.read(amt=amt, decode_content=decode_content)
    File “D:\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 509, in read
    with self._error_catcher():
    File “C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\contextlib.py”, line 153, in exit
    self.gen.throw(typ, value, traceback)
    File “D:\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 440, in _error_catcher
    raise ReadTimeoutError(self._pool, None, “Read timed out.”)
    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=’download.pytorch.org’, port=443): Read timed out.

    [notice] A new release of pip available: 22.2.1 -> 23.0.1
    [notice] To update, run: D:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
    Traceback (most recent call last):
    File “D:\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “D:\stable-diffusion-webui\launch.py”, line 257, in prepare_environment
    run(f'”{python}” -m {torch_command}’, “Installing torch and torchvision”, “Couldn’t install torch”, live=True)
    File “D:\stable-diffusion-webui\launch.py”, line 81, in run
    raise RuntimeError(f”””{errdesc or ‘Error running command’}.
    RuntimeError: Couldn’t install torch.
    Command: “D:\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install torch1.13.1+cu117 torchvision0.14.1+cu117 –extra-index-url https://download.pytorch.org/whl/cu117
    Error code: 2
    请按任意键继续. . . 这是什么问题

    1. 去年夏天

      2023-04-09 16:15

      尝试从PyTorch的下载站点下载文件时发生的读取超时错误。
      就是检查网络连接,没挂代理的话,给python和git设置代理。

  • 周三兽

    2023-04-04 23:33

    venv “C:\Users\Juicu\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Installing gfpgan
    Traceback (most recent call last):
    File “C:\Users\Juicu\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “C:\Users\Juicu\stable-diffusion-webui\launch.py”, line 263, in prepare_environment
    run_pip(f”install {gfpgan_package}”, “gfpgan”)
    File “C:\Users\Juicu\stable-diffusion-webui\launch.py”, line 129, in run_pip
    return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
    File “C:\Users\Juicu\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t install gfpgan.
    Command: “C:\Users\Juicu\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 –prefer-binary
    Error code: 1
    stdout: Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
    Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to c:\users\juicu\appdata\local\temp\pip-req-build-zegq5auc

    stderr: Running command git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\Juicu\AppData\Local\Temp\pip-req-build-zegq5auc’
    fatal: unable to access ‘https://github.com/TencentARC/GFPGAN.git/’: Recv failure: Connection was reset
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\Juicu\AppData\Local\Temp\pip-req-build-zegq5auc’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    git clone –filter=blob:none –quiet https://github.com/TencentARC/GFPGAN.git ‘C:\Users\Juicu\AppData\Local\Temp\pip-req-build-zegq5auc’ did not run successfully.
    exit code: 128

    See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.

    [notice] A new release of pip available: 22.2.1 -> 23.0.1
    [notice] To update, run: C:\Users\Juicu\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip

    请按任意键继续. . .

    老师,这个该如何解决呢?

    1. 去年夏天

      2023-04-05 21:32

      根据你提供的信息,似乎在安装gfpgan时出现了错误。具体来说,错误似乎是由于无法从GitHub下载gfpgan代码库导致的。
      如果不是你的硬盘满了装不下的话,那就是网络问题了,尝试使用真·全局模式的代理,比如VPN模式,TUN模式,或者搜索一下“给Git与python设置代理”

      1. robin

        2023-04-09 11:14

        请问是要删除venv文件夹,重新下一遍么,我也遇到了这个问题

        1. 去年夏天

          2023-04-09 11:19

          如果网络波动,导致下载一半出错,反复重复运行也没好的话,可以尝试删除venv重新完整下一遍

  • 西瓜怪

    2023-04-01 01:12

    venv “G:\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
    Installing open_clip
    Traceback (most recent call last):
    File “G:\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “G:\stable-diffusion-webui\launch.py”, line 269, in prepare_environment
    run_pip(f”install {openclip_package}”, “open_clip”)
    File “G:\stable-diffusion-webui\launch.py”, line 129, in run_pip
    return run(f'”{python}” -m pip {args} –prefer-binary{index_url_line}’, desc=f”Installing {desc}”, errdesc=f”Couldn’t install {desc}”)
    File “G:\stable-diffusion-webui\launch.py”, line 97, in run
    raise RuntimeError(message)
    RuntimeError: Couldn’t install open_clip.
    Command: “G:\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b –prefer-binary
    Error code: 1
    stdout: Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
    Collecting git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
    Cloning https://github.com/mlfoundations/open_clip.git (to revision bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b) to c:\users\asus\appdata\local\temp\pip-req-build-mx6tw4o4

    stderr: Running command git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\ASUS\AppData\Local\Temp\pip-req-build-mx6tw4o4’
    fatal: unable to access ‘https://github.com/mlfoundations/open_clip.git/’: Failed to connect to github.com port 443 after 21082 ms: Couldn’t connect to server
    error: subprocess-exited-with-error

    × git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\ASUS\AppData\Local\Temp\pip-req-build-mx6tw4o4’ did not run successfully.
    │ exit code: 128
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    × git clone –filter=blob:none –quiet https://github.com/mlfoundations/open_clip.git ‘C:\Users\ASUS\AppData\Local\Temp\pip-req-build-mx6tw4o4’ did not run successfully.
    │ exit code: 128
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.

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

    Press any key to continue . . .

    您好 可以帮我看一下这个怎么解决吗

    1. 去年夏天

      2023-04-01 09:22

      在运行 git clone 命令的时候连接 Github 失败了。
      应该只是单纯的网络问题,设置一个稳定的全局代理试试。

      1. 1212

        2023-05-17 14:14

        怎么设置啊,能具体说说吗

  • 浩浩

    2023-03-31 18:04

    请问大佬,在安装完成有地址之后,能打开http://127.0.0.1:7860/,但是点击生成就会出现Something went wrong Expecting value: line 1 column 1 (char 0),这个问题如何解决

    1. 去年夏天

      2023-03-31 20:41

      有更多的提示吗?

    2. 1

      2023-04-07 09:55

      关了全局代理

  • xxbb

    2023-03-30 17:58

    https://zhuanlan.zhihu.com/p/588299656 哥这是你吗

    1. 去年夏天

      2023-03-30 18:02

      不是

  • Mike

    2023-03-29 12:22

    Hi,

    请教一下,下面这个错是什么情况呢?我是在windows10下安装的。

    F:\Stable Diffusion\stable-diffusion-webui>webui-user
    venv “F:\Stable Diffusion\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 955df7751eef11bb7697e2d77f6b8a6226b21e13
    Installing requirements for Web UI
    Launching Web UI with arguments:
    No module ‘xformers’. Proceeding without it.
    Loading weights [cc6cb27103] from F:\Stable Diffusion\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt
    Creating model from config: F:\Stable Diffusion\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 26.0s (load weights from disk: 10.1s, create model: 0.9s, apply weights to model: 6.2s, apply half(): 4.7s, move model to device: 1.0s, load textual inversion embeddings: 3.0s).
    Traceback (most recent call last):
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 412, in send
    conn = self.get_connection(request.url, proxies)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 309, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 193, in proxy_manager_for
    manager = self.proxy_manager[proxy] = proxy_from_url(
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\urllib3\poolmanager.py”, line 537, in proxy_from_url
    return ProxyManager(proxy_url=url, **kw)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\urllib3\poolmanager.py”, line 481, in __init__
    raise ProxySchemeUnknown(proxy.scheme)
    urllib3.exceptions.ProxySchemeUnknown: Proxy URL had no scheme, should start with http:// or https://

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “F:\Stable Diffusion\stable-diffusion-webui\launch.py”, line 352, in
    start()
    File “F:\Stable Diffusion\stable-diffusion-webui\launch.py”, line 347, in start
    webui.webui()
    File “F:\Stable Diffusion\stable-diffusion-webui\webui.py”, line 257, in webui
    app, local_url, share_url = shared.demo.launch(
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py”, line 1483, in launch
    requests.get(f”{self.local_url}startup-events”)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\api.py”, line 76, in get
    return request(‘get’, url, params=params, **kwargs)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\api.py”, line 61, in request
    return session.request(method=method, url=url, **kwargs)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\sessions.py”, line 542, in request
    resp = self.send(prep, **send_kwargs)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\sessions.py”, line 655, in send
    r = adapter.send(request, **kwargs)
    File “F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\requests\adapters.py”, line 414, in send
    raise InvalidURL(e, request=request)
    requests.exceptions.InvalidURL: Proxy URL had no scheme, should start with http:// or https://
    请按任意键继续. . .

    1. 去年夏天

      2023-03-30 09:40

      最后这句话已经提示了requests.exceptions.InvalidURL: Proxy URL had no scheme, should start with http:// or https://
      设置的代理地址前边没有加http://或https://

  • sanzz

    2023-03-29 03:27

    老哥这是什么问题呀~
    venv “C:\aihuihua\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
    Commit hash: 433b3ab7017556a19173a86d1215ed0a0b5b1396
    Installing torch and torchvision
    Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu117
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /whl/cu117/torch/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /whl/cu117/torch/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /whl/cu117/torch/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /whl/cu117/torch/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))’: /whl/cu117/torch/
    Could not fetch URL https://download.pytorch.org/whl/cu117/torch/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’download.pytorch.org’, port=443): Max retries exceeded with url: /whl/cu117/torch/ (Caused by SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:997)’))) – skipping
    ERROR: Could not find a version that satisfies the requirement torch1.13.1+cu117 (from versions: 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0)
    ERROR: No matching distribution found for torch1.13.1+cu117

    [notice] A new release of pip available: 22.2.1 -> 23.0.1
    [notice] To update, run: C:\aihuihua\stable-diffusion-webui\venv\Scripts\python.exe -m pip install –upgrade pip
    Traceback (most recent call last):
    File “C:\aihuihua\stable-diffusion-webui\launch.py”, line 355, in
    prepare_environment()
    File “C:\aihuihua\stable-diffusion-webui\launch.py”, line 257, in prepare_environment
    run(f'”{python}” -m {torch_command}’, “Installing torch and torchvision”, “Couldn’t install torch”, live=True)
    File “C:\aihuihua\stable-diffusion-webui\launch.py”, line 81, in run
    raise RuntimeError(f”””{errdesc or ‘Error running command’}.
    RuntimeError: Couldn’t install torch.
    Command: “C:\aihuihua\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install torch1.13.1+cu117 torchvision0.14.1+cu117 –extra-index-url https://download.pytorch.org/whl/cu117
    Error code: 1
    请按任意键继续. . .

    1. 去年夏天

      2023-03-29 09:23

      从错误信息来看,无法访问 https://download.pytorch.org (即下载PyTorch的官方网站)。
      给电脑设置一个全局的代理比如V2的VPN模式,clash的tun,tap模式,或者给python和git设置一个代理

  • jj

    2023-03-26 23:49

    你好,这个Model hash: 925997e9 ,具体是哪个链接哪个文件名称?谢谢

    1. 去年夏天

      2023-03-27 09:26

      NovelAI的模型

      1. jj

        2023-03-27 11:03

        他文件夹里面有好多模型,具体是哪个文件夹下的模型呢?我看你出图就是这个hash,我自己试了都不对。

  • abs

    2023-03-26 22:27

    您好
    E:\Program Files\SD\stable-diffusion-webui>git pull
    Already up to date.
    venv “E:\Program Files\SD\stable-diffusion-webui\venv\Scripts\Python.exe”
    Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
    Commit hash: 4c1ad743e3baf1246db0711aa0107debf036a12b
    Installing requirements for Web UI
    Launching Web UI with arguments:
    No module ‘xformers’. Proceeding without it.
    Loading weights [fc2511737a] from E:\Program Files\SD\stable-diffusion-webui\models\Stable-diffusion\Chilloutmix-Ni-prunedfp32fix.safetensors
    Creating model from config: E:\Program Files\SD\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 3.4s (load weights from disk: 0.1s, create model: 0.3s, apply weights to model: 0.8s, apply half(): 0.8s, move model to device: 0.6s, load textual inversion embeddings: 0.7s).
    Traceback (most recent call last):
    File “E:\Program Files\SD\stable-diffusion-webui\launch.py”, line 352, in
    start()
    File “E:\Program Files\SD\stable-diffusion-webui\launch.py”, line 347, in start
    webui.webui()
    File “E:\Program Files\SD\stable-diffusion-webui\webui.py”, line 257, in webui
    app, local_url, share_url = shared.demo.launch(
    File “E:\Program Files\SD\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py”, line 1514, in launch
    raise ValueError(
    ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True.

    求解 谢谢!

    1. 去年夏天

      2023-03-26 22:42

      你这个报错大概意思就是:你本地的主机无法访问,所以代码建议你使用–share参数
      你在webui-user.bat文件里设置的启动参数是什么?

      1. abs

        2023-03-26 22:48

        git pull
        @echo off

        set PYTHON=”E:\Program Files\Python\python.exe”
        set GIT=
        set VENV_DIR=
        set COMMANDLINE_ARGS= –share

        call webui.bat

        我就看网上说加了个–share
        可是现在全局又变成下面这样了

        E:\Program Files\SD\stable-diffusion-webui>git pull
        fatal: unable to access ‘https://github.com/AUTOMATIC1111/stable-diffusion-webui.git/’: Failed to connect to github.com port 443 after 21078 ms: Couldn’t connect to server
        venv “E:\Program Files\SD\stable-diffusion-webui\venv\Scripts\Python.exe”
        Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
        Commit hash: 4c1ad743e3baf1246db0711aa0107debf036a12b
        Installing requirements for Web UI
        Launching Web UI with arguments: –share
        No module ‘xformers’. Proceeding without it.
        Loading weights [fc2511737a] from E:\Program Files\SD\stable-diffusion-webui\models\Stable-diffusion\Chilloutmix-Ni-prunedfp32fix.safetensors
        Creating model from config: E:\Program Files\SD\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 64.7s (load weights from disk: 0.1s, create model: 0.4s, apply weights to model: 28.8s, apply half(): 0.9s, move model to device: 0.7s, hijack: 33.1s, load textual inversion embeddings: 0.7s).
        Running on local URL: http://127.0.0.1:7860
        Running on public URL: https://13d559f1d0f600e309.gradio.live

        This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
        Startup time: 80.7s (import torch: 1.1s, import gradio: 0.8s, import ldm: 0.2s, other imports: 0.7s, load scripts: 0.7s, load SD checkpoint: 64.9s, create ui: 0.3s, gradio launch: 12.0s).

        1. 去年夏天

          2023-03-26 22:51

          这个项目应该需要写两个-,应该是–-share

          1. abs

            2023-03-26 22:57

            我是copy错了 确实是写的 –share

            我现在是浏览器可以连https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json
            但是SD界面里面就无法load from:https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json

            我在hosts 里面给了github ip 浏览器都能认,好像SD不认?

        2. 去年夏天

          2023-03-26 22:53

          你这次报错的意思是,无法连接到 github.com 的 443 端口。
          你需要给git设置一个代理,比如VPN全局,clash的tun模式

          1. abs

            2023-03-26 22:59

            我现在的问题是 浏览器都认github 和 https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json
            但是SD界面 里面 就没法load from :https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json
            然后插件就没法安装

      2. abs

        2023-03-26 22:53

        我现在浏览器可以连https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json

        可是sd界面就是无法 加载自load from: https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui-extensions/master/index.json

      3. abs

        2023-03-26 23:15

        不用–share可以吗?
        本地主机无法访问是什么意思啊

        1. 去年夏天

          2023-03-26 23:45

          我也没遇到过你这个问题,只是看代码报错得出的结论。

  • dipp

    2023-03-26 19:33

    ERROR: Exception:
    Traceback (most recent call last):
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 438, in _error_catcher
    yield
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 561, in read
    data = self._fp_read(amt) if not fp_closed else b””
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 527, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py”, line 90, in read
    data = self.__fp.read(amt)
    File “C:\Users\20030902ybx\AppData\Local\Programs\Python\Python310\lib\http\client.py”, line 465, in read
    s = self.fp.read(amt)
    File “C:\Users\20030902ybx\AppData\Local\Programs\Python\Python310\lib\socket.py”, line 705, in readinto
    return self._sock.recv_into(b)
    File “C:\Users\20030902ybx\AppData\Local\Programs\Python\Python310\lib\ssl.py”, line 1274, in recv_into
    return self.read(nbytes, buffer)
    File “C:\Users\20030902ybx\AppData\Local\Programs\Python\Python310\lib\ssl.py”, line 1130, in read
    return self._sslobj.read(len, buffer)
    TimeoutError: The read operation timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\cli\base_command.py”, line 160, in exc_logging_wrapper
    status = run_func(*args)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\cli\req_command.py”, line 247, in wrapper
    return func(self, options, args)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\commands\install.py”, line 419, in run
    requirement_set = resolver.resolve(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py”, line 92, in resolve
    result = self._result = resolver.resolve(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\resolvelib\resolvers.py”, line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\resolvelib\resolvers.py”, line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\resolvelib\resolvers.py”, line 172, in _add_to_criteria
    if not criterion.candidates:
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\resolvelib\structs.py”, line 151, in bool
    return bool(self._sequence)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py”, line 155, in bool
    return any(self)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py”, line 143, in
    return (c for c in iterator if id(c) not in self._incompatible_ids)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py”, line 47, in _iter_built
    candidate = func()
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\factory.py”, line 206, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”, line 297, in init
    super().init(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”, line 162, in init
    self.dist = self._prepare()
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”, line 231, in _prepare
    dist = self._prepare_distribution()
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\resolution\resolvelib\candidates.py”, line 308, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\operations\prepare.py”, line 491, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\operations\prepare.py”, line 536, in _prepare_linked_requirement
    local_file = unpack_url(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\operations\prepare.py”, line 166, in unpack_url
    file = get_http_url(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\operations\prepare.py”, line 107, in get_http_url
    from_path, content_type = download(link, temp_dir.path)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\network\download.py”, line 147, in call
    for chunk in chunks:
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\cli\progress_bars.py”, line 53, in _rich_progress_bar
    for chunk in iterable:
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_internal\network\utils.py”, line 63, in response_chunks
    for chunk in response.raw.stream(
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 622, in stream
    data = self.read(amt=amt, decode_content=decode_content)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 560, in read
    with self._error_catcher():
    File “C:\Users\20030902ybx\AppData\Local\Programs\Python\Python310\lib\contextlib.py”, line 153, in exit
    self.gen.throw(typ, value, traceback)
    File “C:\Users\20030902ybx\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\urllib3\response.py”, line 443, in _error_catcher
    raise ReadTimeoutError(self._pool, None, “Read timed out.”)
    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=’download.pytorch.org’, port=443): Read timed out.
    大师这个是什么问题呀

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据