> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-comfy-docs-comfyapi-search.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ModelAttentionBackend - ComfyUI Built-in Node Documentation

> 此节点为模型选择稠密注意力实现，克隆该模型，应用所选后端，并返回打过补丁的克隆。

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

## 输入

| 参数          | 描述                                                                                                                                        | 数据类型  | 必填 | 范围                                                 |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----- | -- | -------------------------------------------------- |
| `model`     | 要修补的模型。                                                                                                                                   | MODEL | 是  |                                                    |
| `attention` | 要应用的稠密注意力后端。Comfy Kitchen attention 使用量化 INT8 注意力，并且仅在 Nvidia 和 AMD GPU 上可用。默认值："pytorch attention"。如果所选后端不可用，则使用 PyTorch attention 作为回退。 | COMBO | 是  | "pytorch attention"<br />"comfy kitchen attention" |

注意："comfy kitchen attention" 选项仅当当前环境中 Comfy Kitchen INT8 注意力模块可用时才会列出。

## 输出

| 输出名称    | 描述                 | 数据类型  |
| ------- | ------------------ | ----- |
| `model` | 已应用所选注意力后端的输入模型克隆。 | MODEL |

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/ModelAttentionBackend/zh.md)

***

**Source fingerprint (SHA-256):** `4f6e4800c2a3bb09b47b7c8f0481e1b6de3070f57234e610df5d3ce60dfdb309`
