> ## 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.

# TomePatchModel - ComfyUI Built-in Node Documentation

> TomePatchModel applies Token Merging (ToMe) to a diffusion model to reduce computational cost during inference.

TomePatchModel applies Token Merging (ToMe) to a diffusion model to reduce computational cost during inference. It works by merging similar tokens inside the model's attention mechanism, so the model processes fewer tokens while keeping output quality largely intact.

## Inputs

| Parameter | Description                                                                                                                                      | Data Type | Required | Range     |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------- | -------- | --------- |
| `model`   | The diffusion model to apply token merging to                                                                                                    | MODEL     | Yes      | -         |
| `ratio`   | The proportion of tokens to merge (default: 0.3). Higher values merge more tokens, which can give greater speedup but potentially lower quality. | FLOAT     | Yes      | 0.0 - 1.0 |

Note: If the number of tokens in an attention block is small enough that no downsampling is needed, the merging functions are replaced with no-ops, and the model runs unchanged for that block.

## Outputs

| Output Name | Description                                   | Data Type |
| ----------- | --------------------------------------------- | --------- |
| `model`     | The modified model with token merging 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/TomePatchModel/en.md)

***

**Source fingerprint (SHA-256):** `1202c0df17f357440cd156fa0920f70c18a318e32c41dc04cecff11613f0072f`
