快速结论:该报错通常出现在使用 MiniMax H3 的 MiniMaxH3MemoryEfficientSageAttentionPatch 进行采样、并走到 SageAttention int8 量化分支时。优先排查 nodes/ltxv_nodes.py 中 query 量化 kernel 是否缺少 @triton.jit 装饰器。
适用环境:KJNodes 87f810e;ComfyUI 0.30.0;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;GPU 为 RTX 3090 Ti(SM86)。
最快修复方案:升级或更新到已修复的 KJNodes 版本。Issue 摘要中维护者已明确回复 “Was already fixed.”,说明该问题在后续提交中已修复。
注意事项:Issue 中提交者本地验证的临时修复是给 _quant_query_per_thread_int8_i64_kernel 补上 @triton.jit 装饰器,但这只是本地 workaround,不建议长期手改源码;手动修改后需注意后续更新可能覆盖或冲突。根本解决方式仍以更新到已修复版本为准。
问题场景
用户在 ComfyUI 中使用 ComfyUI-KJNodes,并在 MiniMax H3 采样流程中启用 MiniMaxH3MemoryEfficientSageAttentionPatch。执行到 SageAttention 的 int8 量化路径时,调用 _quant_query_per_thread_int8_i64_kernel[grid](...) 立即失败,导致采样在第一步就中断。
报错原文
File "custom_nodes\ComfyUI-KJNodes\nodes\ltxv_nodes.py", line 2081, in minimax_sageattn_forward
o = _sageattn_int8_fp8_nhd(qkv, dtype)
File "custom_nodes\ComfyUI-KJNodes\nodes\ltxv_nodes.py", line 1882, in _sageattn_int8_fp8_nhd
q_int8, q_scale, k_int8, k_scale = _per_thread_int8_i64(q, k, tensor_layout=tensor_layout, BLKQ=128, WARPQ=32, BLKK=64, WARPK=64)
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(“Work around sageattention issue with large sequences (MinimaxH3)”)中,两个 int8 量化 kernel 被 vendored 进 nodes/ltxv_nodes.py,但只有 key kernel 带有 @triton.jit 装饰器,query kernel 仍是普通 Python 函数。普通函数不支持 Triton 的 kernel[grid](...) 下标调用语法,因此抛出 TypeError: 'function' object is not subscriptable。
该问题并非 Triton 未安装:Issue 明确指出此环境下 HAS_TRITON 为 True。若 Triton 缺失,if HAS_TRITON: 代码块不会定义该符号,报错会是 NameError 而非这个 TypeError。可能原因即装饰器遗漏。
环境排查
- 确认 KJNodes 版本是否为
87f810e或包含该提交的版本。 - 确认 ComfyUI 版本为 0.30.0。
- 确认 Python 版本为 3.12.12。
- 确认 PyTorch 版本为 2.13.0+cu130。
- 确认 triton-windows 版本为 3.7.1.post27,并确认
HAS_TRITON为True。 - 确认 SageAttention 版本为 2.2.0+cu130torch2.10.0andhigher.post6。
- 确认 GPU 为 RTX 3090 Ti(SM86),操作系统为 Windows 11。
- 检查
nodes/ltxv_nodes.py中_quant_query_per_thread_int8_i64_kernel定义处是否缺少@triton.jit,同时确认_quant_key_per_thread_int8_i64_kernel是否带有该装饰器。
解决步骤
- 优先更新或重新拉取 KJNodes 到已修复版本。Issue 摘要中维护者回复 “Was already fixed.”,说明该问题在后续版本中已处理。
- 如果暂时无法更新,并且确认当前代码就是缺少装饰器的版本,可参考 Issue 中的本地修复方式,在
nodes/ltxv_nodes.py的_quant_query_per_thread_int8_i64_kernel定义前补上@triton.jit。该修复由提交者本地验证有效,但属于手工 workaround。 - 修改后重启 ComfyUI,使自定义节点重新加载。
- 再次运行 MiniMax H3 采样,确认不再在第一 step 触发该
TypeError。
验证方法
重新加载节点后,可检查两个符号是否都已成为 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
同时重新执行 MiniMax H3 采样,确认第一步不再报 TypeError: 'function' object is not subscriptable,采样可以继续运行。
参考来源
AI 工具推荐
想把多个 AI 模型放在一个入口?
GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。
推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。
这个方案解决了吗?
可以继续搜索完整报错,或查看同一工具的其他排查指南。


![[Bug] KSampler preview error when using --preview-method auto with live preview enabled](https://www.chat-gpts.plus/wp-content/uploads/2026/09/714-ede00b8e-1-768x403.jpg)