前言
学习和使用ComfyUI最痛苦的是什么?就是这满屏的红色方框和和[报错信息] “报错信息”),处理完一批又一批,很多人玩了一两个流程就搞不下去了,很多初学者因此就放弃了。
有道是:配置流程大半天,跑通出图三分钟。ComfyUI的快感可能就是这三分钟。体验[comfyUI]给你带来的高效和快感,希望这篇文章能帮助解决常见的技术问题,让你畅快淋漓的使用ComfyUI。
最近因为部分[SD]的流程需要自动化,批量化,所以开始学习和使用ComfyUI,我搞了一个多月了,期间经历过各种问题,由于是技术出身,对troubleshooting本身就执着,所以一步一步的解决问题过程中积累了很多经验,同时也在网上做一些课程,帮助一些非技术出身的小白学员入门了comfyUI.希望通过本文就记录一些安装和使用的常见问题,让大家踩坑后能尽快解决吧。其实github上issue里面也有很多有用的内容,如果英文好的小伙伴可以直接去哪里解决。
以我的使用经验问题大多出在各种[Custom node]安装和模型下载上,另外由于开源组件更新快,很多相关组件都需要及时更新到最新版本,所以有些时候出了问题,把相关的包更新一下,问题就可能解决了。
1. 关于一键安装包
首先要对一键安装包的作者致敬,花了精力方便很多技术小白用户入门学习。
但是我自己使用和教学员的经历来看,一键安装包在后期使用上存在着很多不方便的地方,因为是[开源项目],主版本和各种custom node更新非常快,很多问题就是版本更新不及时产生的。 另外会出现各种客户化节点缺失,最后还是需要学习手动安装[custom node]. 所以对于学习来讲,可能是无法偷懒的。
我对学员说的是:你既然选择了学习ComfyUI,就是选择了挑战自己,自己安装custom node也只是挑战的一小部分。
总结一下:尽量自己直接通过github拉项目或者下载[Portable]安装包,学习安装各种节点。 确实不愿意弄,那就去搞一键安装包。
所有的AI设计工具,模型和插件,都已经整理好了,👇获取~
2.安装的常见问题
本文不讨论安装过程,因为安装的指南文章很多,只简要说一下安装需要注意的问题.
ComfyUI和其它sd的工具一样,非常依赖cuda和c语言的开发环境,所以cuda相关的包, windows上的微软开发工具一定要事先安装好。即便你用的是[portable]或者一键安装包,后面使用过程中会给你带来极大的便利。如果使用conda或python的[venv],那就要安装好python环境。
总结:
- 必须安装好cuda,[cudnn]等相关的工具环境
- 安装[msvs],gcc这类开发环境
- python环境。(用[embeding python]的记住安装要用 …/
b.与其他[Stable diffusion]软件共享模型文件
在[comfyui]目录下有个extra_model_paths.yaml.example文,你需要重命名为extra_model_paths.yaml,
里面有个a111的配置就是[webui],你把webui的路径配置上就可以了。
#Rename this to extra_model_paths.yaml and ComfyUI will load it#config for a1111 ui
#all you have to do is change the base_path to where yours is installed
a111:base_path: C:/dev/sd160/stable-diffusion-webuicheckpoints: models/Stable-diffusionconfigs: models/Stable-diffusionvae: models/VAE[lora](https://www.zhihu.com/search?q=lora&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "lora")s: |models/[Lora](https://www.zhihu.com/search?q=Lora&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "Lora")models/LyCORISupscale_models: |models/ESRGANmodels/RealESRGANmodels/SwinIRembeddings: embeddingshypernetworks: models/hypernetworkscontrolnet: models/ControlNet#other_ui:
# base_path: path/to/ui
# checkpoints: models/checkpoints
# gligen: models/gligen
# custom_nodes: path/custom_nodes
c. ComfyUI的更新
从评论区可以看到,很多时候遇到的问题都是ComfyUI没有更新导致的,如果你经常使用它,并且经常跑网上最新的一些流程例子,你就需要经常性的更新ComfyUI。更新的方法一般有以下几种。
1)如果是[windows portable]版本,有个update文件夹,直接执行里面的update_comfyui.bat就可以。另外一个命令会更新一些python依赖包,
2)重新在comfy网址下载最新版本,这个方法不方便的地方是需要你把所有custom_nodes文件夹拷贝过去,而且有些节点需要手工安装python包和依赖。
3)如果是用[git clone]方式安装的, 你重新git pull一下就可以了。
3.ComfyUI节点的安装
很多人说用Manager,[节点管理器]节点管理器")来管理custom node,但是现实情况是国内由于墙的原因,经常下载失败。
所以学会手动安装是ComfyUI必备技能。如果你引入的流程上,出现大量的红色节点和红色的提示,那么说明你缺少对应节点,
你可以首先点击"[Install]Missing [Custom Node]s
这个时候注意,要开着科学上网,因为它要访问这个两个github的网址
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
你点击Install后, 虽然显示安装成功,并且让你重新启动,但是不要被表面现象迷惑,很可能安装是失败的。
只有如下图显示了紫色disable和红色[uninstall]的色块才是安装成功的标志.
要在文件浏览器里检查,对应的文件夹是不是出现了, ComfyUI/custom_nodes下按照时间排序,看看有没有当前时间段创建的文件夹,如果没有说明需要手工安装。
通过两个方式拿到节点的git库地址,一是点击install之后看后台的信息, 看到有git clone https://….
b.手工安装[节点node]
可以打开一个cmd窗口,进到comfyUI/custom_node路径下,把命令拷贝过去 git clone ‘(https://link.zhihu.com/?target=https%3A//… “https://…”).’,这会儿不要执行,因为访问git需要加一个代理。 你可以把引号删除,同时加上 . 如图所示:
ghproxy是非常好用的git 代理。但是最近被墙了,可以改用, 非常推荐大家使用。
注:我个人使用是comfyUI开两个窗口,不要直接点run_nvidia_gpu.bat 这个文件启动,开一个cmd窗口或者[poweshell],进入命令行启动它,因为后面安装节点要反复执行这个命令,你这个窗口只需要按ctrl+c 停止服务器,再按上箭头和回车就可以重新启动新的comfyUI,效率高很多。另外一个窗口只负责更新节点和python库,也省去了每次都要新开窗口进入[custom nodes路径]的时间。
c.安装python依赖包
有些节点如果重启后还是import failed,可能是需要你手工安装一些python包,你需要仔细查看对应github库的[readme.md]文件。 在启动时,会报一些 No module named xxxx 这类错误信息,那就是需要手动安装这些包。
像下面这个示例中charactor face swap包,就写明了手动安装时,需要执行的命令
这时可以进入另一个专门安装包和节点的窗口。执行…\…\…\python_embeded\[python]
注意linux环境和windows环境斜杠方向不同。
这里面要注意一下,其实install.py是comfyUI启动或安装时会自动调用的脚本.只不过由于我们有些时候安装不成功才需要执行它。另外一些节点常见的安装过程是需要 …\…\…\python_embeded\python -m [pip] install -r requirements.txt 来手动安装各种python包。 我的这种安装方式适用于安装portable包的小伙伴,要是你通过venv或者[conda环境]安装的comfyUI,那你直接用pip就好了。
还有些节点需要额外的安装步骤,请自行仔细阅读开源项目的readme.md文件,答案都在那里。
d.一些特殊的节点
有些特殊的节点,其实只是一个python文件,你下载了github文件夹后还需要把文件直接放到custom_nodes的目录下。比如这个[clipseg]节点组件。
还有这几个组件。
e.网络不通怎么办?
如果网络不通,一般会报"[WinError 121]信号灯超时时间已到”或者
Error handling request
Traceback (most recent call last):File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\[aiohttp](https://www.zhihu.com/search?q=aiohttp&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "aiohttp")\web_protocol.py", line 433, in _handle_requestresp = await request_handler(request)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\web_app.py", line 504, in _handleresp = await handler(request)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\web_[middlewares.py](https://www.zhihu.com/search?q=middlewares.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "middlewares.py")", line 117, in implreturn await handler(request)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\[server.py](https://www.zhihu.com/search?q=server.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "server.py")", line 46, in cache_controlresponse: web.Response = await handler(request)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\__init__.py", line 522, in fetch_customnode_mappingsjson_obj = await get_data(uri)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\__init__.py", line 367, in get_dataasync with session.get(uri) as resp:File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\[aiohttp\client.py](https://www.zhihu.com/search?q=aiohttp%5Cclient.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "aiohttp\client.py")", line 1141, in __aenter__self._resp = await self._coroFile "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\client.py", line 560, in _requestawait resp.start(conn)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\client_[reqrep.py](https://www.zhihu.com/search?q=reqrep.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "reqrep.py")", line 899, in startmessage, payload = await protocol.read() # type: ignore[union-attr]File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\streams.py", line 616, in readawait self._waiter
[aiohttp.client_exceptions](https://www.zhihu.com/search?q=aiohttp.client_exceptions&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "aiohttp.client_exceptions").ClientOSError: [WinError 121] 信号灯超时时间已到
无法连接github的错误信息"Cannot connect to host [raw.githubusercontent.com:443]ssl:default [None]"
Traceback (most recent call last):File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\web_[protocol.py](https://www.zhihu.com/search?q=protocol.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "protocol.py")", line 433, in _handle_requestresp = await [request_handler](https://www.zhihu.com/search?q=request_handler&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "request_handler")(request)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\web_app.py", line 504, in _handleresp = await handler(request)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\web_middlewares.py", line 117, in implreturn await handler(request)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\server.py", line 46, in cache_controlresponse: web.Response = await handler(request)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\__init__.py", line 582, in fetch_customnode_listjson_obj = await get_data(uri)File "C:\DEV\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\__init__.py", line 367, in get_dataasync with session.get(uri) as resp:File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\client.py", line 1141, in __aenter__self._resp = await self._coroFile "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\client.py", line 536, in _requestconn = await self._connector.connect(File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\connector.py", line 540, in connectproto = await self._create_connection(req, traces, timeout)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\connector.py", line 899, in _create_connection_, proto = await self._create_proxy_connection(req, traces, timeout)File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\[connector.py](https://www.zhihu.com/search?q=connector.py&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "connector.py")", line 1328, in _create_proxy_connectionreturn await self._start_tls_connection(File "C:\DEV\ComfyUI_windows_portable\python_embeded\lib\site-packages\aiohttp\connector.py", line 1111, in _start_tls_connectionraise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host raw.githubusercontent.com:443 ssl:default [None]
这个时候不要着急,赶紧把科学上网打开。同时它不会影响comfyUI的运行.
f. Failed to connect to [http://raw.githubusercontent.com:443]
这个错误也是由于网络原因引起的。但是原因可能不尽相同。除了科学上网,有些时候国内的dns会解析错误的[http://raw.githubusercontent.com]域名,还有些ISP([互联网服务提供商]在[DNS]层面出于某些未知原因屏蔽了
翻译关键点:可以通过在windows手工配置hosts文件解决。
将185.199.108.133 [raw.githubusercontent.com]直接加到C:\Windows\System32\drivers\etc\hosts文件的最后一行。也有将dns改为国外服务器的。总之保证这个域名可以正常访问就可以。
4.comfyUI的使用
a.正常启动
下面是正常启动的界面,所有节点都正常的加载。
如果安装失败,会显示IMPORT FAILED 如图:
b. 启动参数
运行一般windows下都是运行run_nvidia_gpu.bat这个脚本,linux环境下,就是直接python main.py。
启动的所有参数可以通过python main.py -h 参数来查看。愿意学习代码的,也可以看cli_args.py这个文件来学习。
E:\ComfyUI_windows_portable\ComfyUI>..\python_embeded\python.exe main.py -h
** ComfyUI startup time: 2024-01-06 15:42:26.697935
** Platform: Windows
** Python version: 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
** Python executable: E:\ComfyUI_windows_portable\python_embeded\python.exe
** Log path: E:\ComfyUI_windows_portable\ComfyUI\[comfyui.log](https://www.zhihu.com/search?q=comfyui.log&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "comfyui.log")Prestartup times for custom nodes:0.0 seconds: E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy0.1 seconds: E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Managerusage: main.py [-h] [--listen [IP]] [--port PORT] [--[enable-cors-header](https://www.zhihu.com/search?q=enable-cors-header&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "enable-cors-header") [ORIGIN]] [--max-upload-size MAX_UPLOAD_SIZE][--extra-model-paths-config PATH [PATH ...]] [--output-directory OUTPUT_DIRECTORY][--temp-directory TEMP_DIRECTORY] [--[input-directory](https://www.zhihu.com/search?q=input-directory&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "input-directory") INPUT_DIRECTORY] [--auto-launch][--disable-auto-launch] [--cuda-device DEVICE_ID] [--[cuda-malloc](https://www.zhihu.com/search?q=cuda-malloc&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "cuda-malloc") | --disable-cuda-malloc][--dont-upcast-attention] [--force-fp32 | --force-fp16][--bf16-unet | --fp16-unet | --fp8_e4m3fn-unet | --fp8_e5m2-unet][--fp16-vae | --fp32-vae | --bf16-vae][--fp8_e4m3fn-text-enc | --fp8_e5m2-text-enc | --fp16-text-enc | --fp32-text-enc][--directml [DIRECTML_DEVICE]] [--disable-ipex-optimize][--preview-method [none,auto,[latent2rgb](https://www.zhihu.com/search?q=latent2rgb&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "latent2rgb"),taesd]][--use-split-cross-attention | --use-quad-cross-attention | --use-[pytorch-cross-attention](https://www.zhihu.com/search?q=pytorch-cross-attention&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "pytorch-cross-attention")][--disable-xformers] [--gpu-only | --highvram | --normalvram | --lowvram | --novram | --cpu][--disable-smart-memory] [--deterministic] [--dont-print-server] [--quick-test-for-ci][--[windows-standalone](https://www.zhihu.com/search?q=windows-standalone&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "windows-standalone")-build] [--disable-metadata]options:-h, --help show this help message and exit--listen [IP] Specify the IP address to listen on (default: 127.0.0.1). If --listen is provided without an[argument](https://www.zhihu.com/search?q=argument&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "argument"), it defaults to 0.0.0.0. (listens on all)--port PORT Set the listen port.--enable-cors-header [ORIGIN]Enable CORS (Cross-Origin Resource Sharing) with optional origin or allow all with default'*'.--[max-upload-size](https://www.zhihu.com/search?q=max-upload-size&search_source=Entity&hybrid_search_source=Entity&hybrid_search_extra=%7B%22sourceType%22%3A%22article%22%2C%22sourceId%22%3A%22660102125%22%7D "max-upload-size") MAX_UPLOAD_SIZESet the maximum upload size in MB.--extra-model-paths-config PATH [PATH ...]Load one or more extra_model_paths.yaml files.--output-directory OUTPUT_DIRECTORYSet the ComfyUI output directory.--temp-directory TEMP_DIRECTORYSet the ComfyUI temp directory (default is in the ComfyUI directory).--input-directory INPUT_DIRECTORYSet the ComfyUI input directory.--auto-launch Automatically launch ComfyUI in the default browser.--disable-auto-launchDisable auto launching the browser.--cuda-device DEVICE_IDSet the id of the cuda device this instance will use.--cuda-malloc Enable cudaMallocAsync (enabled by default for torch 2.0 and up).--disable-cuda-mallocDisable cudaMallocAsync.--dont-upcast-attentionDisable upcasting of attention. Can boost speed but increase the chances of black images.--force-fp32 Force fp32 (If this makes your GPU work better please report it).--force-fp16 Force fp16.--bf16-unet Run the UNET in bf16. This should only be used for testing stuff.--fp16-unet Store unet weights in fp16.--fp8_e4m3fn-unet Store unet weights in fp8_e4m3fn.--fp8_e5m2-unet Store unet weights in fp8_e5m2.--fp16-vae Run the VAE in fp16, might cause black images.--fp32-vae Run the VAE in full precision fp32.--bf16-vae Run the VAE in bf16.--fp8_e4m3fn-text-encStore text encoder weights in fp8 (e4m3fn variant).--fp8_e5m2-text-enc Store text encoder weights in fp8 (e5m2 variant).--fp16-text-enc Store text encoder weights in fp16.--fp32-text-enc Store text encoder weights in fp32.--directml [DIRECTML_DEVICE]Use torch-directml.--disable-ipex-optimizeDisables ipex.optimize when loading models with Intel GPUs.--preview-method [none,auto,latent2rgb,taesd]Default preview method for sampler nodes.--use-split-cross-attentionUse the split cross attention optimization. Ignored when xformers is used.--use-quad-cross-attentionUse the sub-quadratic cross attention optimization . Ignored when xformers is used.--use-pytorch-cross-attentionUse the new pytorch 2.0 cross attention function.--disable-xformers Disable xformers.--gpu-only Store and run everything (text encoders/CLIP models, etc... on the GPU).--highvram By default models will be unloaded to CPU memory after being used. This option keeps them inGPU memory.--normalvram Used to force normal vram use if lowvram gets automatically enabled.--lowvram Split the unet in parts to use less vram.--novram When lowvram isn't enough.--cpu To use the CPU for everything (slow).--disable-smart-memoryForce ComfyUI to agressively offload to regular ram instead of keeping models in vram when itcan.--deterministic Make pytorch use slower deterministic algorithms when it can. Note that this might not makeimages deterministic in all cases.--dont-print-server Don't print server output.--quick-test-for-ci Quick test for CI.--windows-standalone-buildWindows standalone build: Enable convenient things that most people using the standalonewindows build will probably enjoy (like auto opening the page on startup).--disable-metadata Disable saving prompt metadata in files.
其中常用的几个参数,简单介绍一下。
–listen 如果你想让别人也可以访问你的comfyui,或者提供API访问,就需要设置这个参数,默认是监听机器上所有的ip。如果是只想让它监听特定的IP,那你加上就行比如”192.168.0.18“
–port 指定监听端口
–lowvram 降低显存的占用。
c manager访问不到
我们在使用manager时,会遇到下面这个报错。
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] Due to a network error, switching to local mode.
=> custom-node-list.json
=> [WinError 121] 信号灯超时时间已到那如何解决呢?
首先,这个问题原因是国内对这个域名[raw.githubusercontent.com]存在DNS不准确的问题。大家可以通过[https://sites.ipaddress.com/raw.githubusercontent.com/] 方式直接查询域名的ip,结果如下:
然后手工修改 ”c:\windows\System32\drivers\etc\hosts“文件
增加一行:
然后执行:
ipconfig /flushdns
再尝试访问,就可以了。
5. 模型文件找不到
模型文件分为很多类别,一类是和sd相关的checkpoint, Lora, embedding这,常见的是你拉过来别的workflow,作者命名这些文件有自己的习惯,拿过来需要确认和自己本地保存的文件名字一致。 一类是custom node自己需要的模型文件,第一次运行时会在相应的网站,一般就是github,huggingface这类,国内也有modelscope这类。
a. checkpoint,lora名字不一致
是一种常见的错误,把别人的workflow加载进来时,记得要看model名字和自己本地的是否一样
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\ execution.py”, line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\ execution.py”, line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\ execution.py”, line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\ nodes.py”, line 476, in load_checkpoint
out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths(“embeddings”))
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\comfy\ sd.py”, line 400, in load_checkpoint_guess_config
sd = comfy.utils.load_torch_file(ckpt_path)
File “C:\DEV\ComfyUI_windows_portable\ComfyUI\comfy\ utils.py”, line 12, in load_torch_file
if ckpt.lower().endswith(“.safetensors”):
AttributeError: ‘NoneType’ object has no attribute ‘lower’
b.无法连接hugging face
关键字 huggingface.co "Connection to http://huggingface.co timed out类。
‘(MaxRetryError("HTTPSConnectionPool(host=’ Hugging Face – The AI community building the future.‘, port=443): Max retries exceeded with url: /lllyasviel/Annotators/resolve/main/ZoeD_M12_N.pt (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001D934781DB0>, ‘Connection to Hugging Face – The AI community building the future. timed out. (connect timeout=10)’))"), ‘(Request ID: dc2a2763-47a3-4862-b320-9aacf3a28b19)’)’ thrown while requesting HEAD https://huggingface.co/lllyasviel/Annotators/resolve/main/ZoeD_M12_N.pt
WARNING:huggingface_hub.utils._http:‘(MaxRetryError("HTTPSConnectionPool(host=’ Hugging Face – The AI community building the future.‘, port=443): Max retries exceeded with url: /lllyasviel/Annotators/resolve/main/ZoeD_M12_N.pt (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001D934781DB0>, ‘Connection to Hugging Face – The AI community building the future. timed out. (connect timeout=10)’))"), ‘(Request ID: dc2a2763-47a3-4862-b320-9aacf3a28b19)’)’ thrown while requesting HEAD https://huggingface.co/lllyasviel/Annotators/resolve/main/ZoeD_M12_N.pt
如何从huggingface下载模型
补充一个新的方法,可以在通过环境变量设置huggingface代理来解决这个问题。
set HF_ENDPOINT=https://hf-mirror.com
6.执行的节点没有配置好
这是前几天评论区小伙伴留下,这个我们可以看到执行错误的节点有一个红色边框,并报错。报错是错模型没有找到,[undefine]是用户没有选择本机上的模型会出现的。同类的错误都可以这个方式来进行排查,比如sampler节点如果忘记输入positive condition,就会报如下错误。
再比如这个apply faceID节点忘记选择model,model就会出现红圈。
执行节点时,我们经常会遇到错误,很多时候需要检查是不是我们节点的版本太旧了,和其它节点匹配出了问题。
比如我有一次使用
output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
File “E:\DEV\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py”, line 77, in apply_model
context = context.to(dtype)
AttributeError: ‘NoneType’ object has no attribute ‘to’
上面错误就是代码对一个空对象进行操作,我检查了流程,没发现设置的问题。就怀疑是节点版本的问题。我更新了节点之后,重启服务器,故障解决。
为了帮助大家更好地掌握 ComfyUI,我在去年花了几个月的时间,撰写并录制了一套ComfyUI的基础教程,共六篇。这套教程详细介绍了选择ComfyUI的理由、其优缺点、下载安装方法、模型与插件的安装、工作流节点和底层逻辑详解、遮罩修改重绘/Inpenting模块以及SDXL工作流手把手搭建。
由于篇幅原因,本文精选几个章节,详细版点击下方卡片免费领取
一、ComfyUI配置指南
- 报错指南
- 环境配置
- 脚本更新
- 后记
- …
二、ComfyUI基础入门
- 软件安装篇
- 插件安装篇
- …
三、 ComfyUI工作流节点/底层逻辑详解
- ComfyUI 基础概念理解
- Stable diffusion 工作原理
- 工作流底层逻辑
- 必备插件补全
- …
四、ComfyUI节点技巧进阶/多模型串联
- 节点进阶详解
- 提词技巧精通
- 多模型节点串联
- …
五、ComfyUI遮罩修改重绘/Inpenting模块详解
- 图像分辨率
- 姿势
- …
六、ComfyUI超实用SDXL工作流手把手搭建
- Refined模型
- SDXL风格化提示词
- SDXL工作流搭建
- …
由于篇幅原因,本文精选几个章节,详细版点击下方卡片免费领取