报错
050
执行期运行时错误(张量/尺寸/节点)
含未核实说明
精度类型不匹配二:Input type (torch.FloatTensor) and weight type (torch.HalfTensor) should be the same
报错原文(原样)
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.HalfTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
检索关键词
Input type (torch.FloatTensor) and weight type (torch.HalfTensor)、should be the same or input should be a MKLDNN tensor、torch.HalfTensor、IPAdapter
先看这一句
工作流之前能跑,某次更新后第一个 IPAdapter 节点就报类型不匹配;删掉节点重建也无效。
适用版本 与该插件在 ComfyUI 改动 CLIP Vision 前后的版本相关(issue 时点:插件 commit bbf9336、ComfyUI commit 65cae62 附近)
·
核实日期 2026-09-26
·
状态 可能已过期,正在复核
适用环境:Windows 便携版、秋叶/绘世整合包、Linux + 云 GPU
现象与触发场景
常见触发场景:
- ComfyUI 更新改动了 CLIP Vision 相关代码,旧的 IPAdapter 插件没跟上
- IPAdapter 节点内部按 fp32 处理输入图,而 CLIP Vision 权重是 fp16
根因
- IPAdapter 拿到的图像输入是 FloatTensor,而 CLIP Vision 的权重是 HalfTensor,两者 dtype 不一致时前向计算失败
- laksjdjf/IPAdapter-ComfyUI#17 中用户比对 commit 后指出与 ComfyUI 对 CLIP Vision 的改动相关,作者回复已尝试修复但会影响旧版本,因此先放在 dev 分支
- 定位方法:ComfyUI 日志里 "Error occurred when executing" 后面跟的节点名就是 IPAdapter 节点,即第一个挂 IPAdapter 的节点
解决步骤
已按「最可能有效」排序。请从上往下做,每做完一步用「验证」确认,不要一次改五处。
- 切换到插件的 dev 分支作者 laksjdjf 在原 issue 中回复:I've tried a fix, but it caused problems with previous versions, so I've put it on the dev branch for now(修复放在 dev 分支)。报告者切到 dev 分支后确认错误消失、性能也更好。
- 同步升级 ComfyUI 与 IPAdapter 插件到最新版这类 dtype 报错的通用解法是让本体与插件版本配套;插件长期未更新而 ComfyUI 一直在动,就会出现这种新旧错配。升级后重启 ComfyUI(必要时清掉 --disable-smart-memory 之外的旧缓存行为)。
- 实测确认是插件而不是工作流本身的问题按官方排障文档的二分法:先用 --disable-all-custom-nodes 启动并跑一个只用核心节点的简单工作流作为基线,再逐个启用插件,直到复现该报错。python main.py --disable-all-custom-nodes
验证是否修好
使用 dev 分支或升级后,第一个 IPAdapter 节点不再抛 dtype 报错,工作流能完整出图。
补充说明
该 issue 在采集时仍为 open 状态,dev 分支修复是作者当时的说法,[未核实] 是否已合入正式发布版。
来源
按可信度排列:官方 issue / 官方文档 > 节点仓库 issue > 社区帖 > 中文社区文章。
链接以纯文本给出(本站不做站外跳转),需要核对时请自行复制到浏览器打开。
- [127] (节点仓库 issue) RuntimeError: Input type (torch.FloatTensor) and weight type (torch.Ha https://github.com/laksjdjf/IPAdapter-ComfyUI/issues/17
本条的可靠性边界
下面这些位置带
[未核实] 标记,是采集时没找到一手来源的部分,请自行验证:
- 补充说明
这条报错要用到的东西
按本条报错所属的类别(执行期运行时错误(张量/尺寸/节点))列出站内相关的下载包与板块入口。 它们不是「必须下载才能修好」,而是这一类问题里最常要动到的东西;具体怎么做,以上面的解决步骤为准。
ComfyUI 权重库(167 个文件 / 约 1187 GB)按 ComfyUI 的 models 目录分好类的 167 个权重文件 / 每个文件一份说明(放哪、被哪些工作流引用)
待挂载
工作流对照本条工作流的依赖清单,确认模型版本对得上
板块
同一类别的其他条目
【045】生成时报张量尺寸不匹配:The size of tensor a (X) must match the size of tensor b (Y) at non-singleton dimension Z
有来源
【046】拼接/拼接 latent 时报:Sizes of tensors must match except in dimension 1
有来源
【047】矩阵乘法形状不匹配:mat1 and mat2 shapes cannot be multiplied
有来源
【048】卷积通道数不匹配:Given groups=1, weight of size ..., expected input ... to have N channels
有来源
【049】精度类型不匹配一:expected scalar type Half but found Float
含未核实
这个解法对你有效吗
记录只存在你自己的浏览器里,不需要注册账号。
知仓学习社