For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /nodes/01/ModelAttentionBackend.md.

模型注意力后端(ModelAttentionBackend)

ModelAttentionBackendmodel/patch角色:模型补丁

此节点为模型选择稠密注意力实现,克隆该模型,应用所选后端,并返回打过补丁的克隆。当与 Block Sparse Attention 一起使用时,只要稀疏注意力未激活或不受支持,就会使用此后端。如果所选后端不可用,此节点会自动回退到 PyTorch attention。

参数

参数类型默认 / 范围说明
modelMODEL · 扩散模型—(连线输入)已应用所选注意力后端的输入模型克隆。
attentionCOMBOpytorch attention要应用的稠密注意力后端。Comfy Kitchen attention 使用量化 INT8 注意力,并且仅在 Nvidia 和 AMD GPU 上可用。默认值:"pytorch attention"。如果所选后端不可用,则使用 PyTorch attention 作为回退。

输出

输出类型说明
modelMODEL扩散模型

怎么接

  • 上游:CheckpointLoaderSimple / UNETLoader
  • 下游:KSampler / 下一个补丁节点
  • 接线:串在模型链中间:上游接 CheckpointLoaderSimple / UNETLoader 的 MODEL,输出接 KSampler 的 model 或下一个补丁;多个补丁叠加时顺序会改变结果。

使用案例

属于「模型补丁」类节点,向下游提供可采样的模型对象。从 model、attention(pytorch attention) 开始填就能跑起来。典型接法:CheckpointLoaderSimple → 本节点 → KSampler。注意:补丁节点按「加载器 → 补丁 → 采样器」的顺序串接,顺序不同效果不同。

端口与连线示意

ModelAttentionBackend 端口与连线示意

实战提示

  • 补丁节点按「加载器 → 补丁 → 采样器」的顺序串接,顺序不同效果不同。

同类节点

采样算法(AuraFlow) · 采样算法(连续EDM) · 采样算法(离散) · 缩放CFG · 模型稀疏注意力 · 上下文窗口(手动) · LTXV上下文窗口 · 模型噪声尺度 · 采样算法(连续V) · RenormCFG · 缩放ROPE · WAN上下文窗口(手动)