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

# ModelAttentionBackend - ComfyUI Built-in Node Documentation

> This node lets you choose which attention backend a model uses for its attention computations.

This node lets you choose which attention backend a model uses for its attention computations. It creates a copy of the model and swaps in the attention function you select, which can affect performance or behavior. If the chosen backend is not available, it automatically falls back to PyTorch attention and logs a warning.

## Inputs

| Parameter   | Description                                                                                                                                   | Data Type | Required | Range                                              |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | -------------------------------------------------- |
| `model`     | The model to which the selected attention backend will be applied.                                                                            | MODEL     | Yes      |                                                    |
| `attention` | The attention backend to use (default: "pytorch attention"). If the selected backend is unavailable, PyTorch attention is used as a fallback. | STRING    | Yes      | "pytorch attention"<br />"comfy kitchen attention" |

Note: The "comfy kitchen attention" option is only listed when the comfy kitchen int8 attention module is available in the current environment.

## Outputs

| Output Name | Description                                                             | Data Type |
| ----------- | ----------------------------------------------------------------------- | --------- |
| `MODEL`     | A clone of the input model with the selected attention backend applied. | MODEL     |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/ModelAttentionBackend/en.md)

***

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