快速结论:该报错发生在 ComfyUI KJNodes 的 MiniMax H3 采样流程中,原因是 _quant_query_per_thread_int8_i64_kernel 缺少 @triton.jit 装饰器,导致 Triton 无法将其作为内核启动。优先检查 nodes/ltxv_nodes.py 中该函数上方是否补上了装饰器。
适用环境:KJNodes 提交 87f810e,ComfyUI 0.30.0,RTX 3090 Ti(SM86),Windows 11,Python 3.12.12,PyTorch 2.13.0+cu130,triton-windows 3.7.1.post27,SageAttention 2.2.0+cu130torch2.10.0andhigher.post6。
最快修复方案:在 nodes/ltxv_nodes.py 中 _quant_query_per_thread_int8_i64_kernel 定义上方添加 @triton.jit 装饰器,与相邻的 key kernel 保持一致。Issue 中已确认该方法本地验证有效。
注意事项:该修复针对 87f810e 引入的临时方案;后续更新可能改动相关代码,升级 KJNodes 后建议确认是否存在更正式修复。
问题场景
用户运行 MiniMax H3 采样,经过 MiniMaxH3MemoryEfficientSageAttentionPatch 时,在第一步就触发 TypeError: 'function' object is not subscriptable。触发路径位于 nodes/ltxv_nodes.py 的 _per_thread_int8_i64 函数,它在尝试以 kernel[grid](...) 方式启动 query 量化内核时失败。
报错原文
File "custom_nodes\ComfyUI-KJNodes\nodes\ltxv_nodes.py", line 1843, in _per_thread_int8_i64
_quant_query_per_thread_int8_i64_kernel[grid](
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
TypeError: 'function' object is not subscriptable
原因分析
在提交 87f810e 中,nodes/ltxv_nodes.py 内嵌了两个 int8 量化内核,但只有 key 内核(_quant_key_per_thread_int8_i64_kernel)加上了 @triton.jit 装饰器,query 内核(_quant_query_per_thread_int8_i64_kernel)仍是普通 Python 函数。Triton 使用 kernel[grid](...) 语法启动 JIT 编译后的内核,普通函数不支持下标操作,因此直接报错。
注意这不是缺少 Triton 本身的问题——Issue 中 HAS_TRITON 为 True,否则进入 if HAS_TRITON: 分支前该符号不会被定义,报错会是 NameError 而不是 TypeError。
环境排查
- 确认
nodes/ltxv_nodes.py中_quant_query_per_thread_int8_i64_kernel定义上方是否缺少@triton.jit。 - 确认
HAS_TRITON为True,排除 Triton 未安装导致的误解。 - 确认 KJNodes 版本是否为
87f810e或包含该问题的提交。
解决步骤
- 打开
custom_nodes/ComfyUI-KJNodes/nodes/ltxv_nodes.py,定位到if HAS_TRITON:块内的_quant_query_per_thread_int8_i64_kernel定义处。 - 在该函数定义上方添加
@triton.jit装饰器,修改后代码类似:@triton.jit def _quant_query_per_thread_int8_i64_kernel(Input, Output, Scale, L, ... - 保存文件,重启 ComfyUI,或重新加载自定义节点。
验证方法
重新运行 MiniMax H3 采样任务,确认第一步不再触发 TypeError: 'function' object is not subscriptable。也可以通过 Python 脚本检查两个符号是否均为 Triton 的 JITFunction 且支持下标调用,例如 Issue 中确认的输出:
HAS_TRITON: True
_quant_query_per_thread_int8_i64_kernel JITFunction subscriptable=True
_quant_key_per_thread_int8_i64_kernel JITFunction subscriptable=True
参考来源
AI 工具推荐
想把多个 AI 模型放在一个入口?
GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。
推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。
这个方案解决了吗?
可以继续搜索完整报错,或查看同一工具的其他排查指南。
![[Question]: error when attaching file in chat ----AttributeError("'Request' object has no attribute 'file'")](https://www.chat-gpts.plus/wp-content/uploads/2026/08/11805-40332ec3-768x403.jpg)
![[Question]: No keyword or question was found in dataSet afer files loaded by customized ingestion pipeline](https://www.chat-gpts.plus/wp-content/uploads/2026/08/11474-a36958b1-768x403.jpg)
