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

# QwenImage21Cache - ComfyUI Built-in Node Documentation

> QwenImage21Cache 节点用于配置 Qwen-Image 2.1 模型的 KV 前缀缓存：缓存键和值的存储位置以及存储精度。

QwenImage21Cache 节点用于配置 Qwen-Image 2.1 模型的 KV 前缀缓存：缓存键和值的存储位置以及存储精度。文本和参考 token 只计算一次，并在各个采样步骤中复用，编辑工作流的大部分速度提升正来源于此；此节点让你可以用内存换取速度，或完全禁用缓存。此节点标记为实验性。

## 输入

| 参数 | 描述 | 数据类型 | 必需 | 范围 |
| - | - | - | - | - |
| `model` | 要配置前缀缓存的 Qwen-Image 2.1 模型。 | MODEL | 是 | - |
| `device` | 缓存键和值的存储位置。`"auto"`（默认）会优先使用空闲 VRAM，然后使用 RAM；`"gpu"` 将缓存存储在 VRAM 中；`"cpu"` 将其存储在 RAM 中，并在计算期间后台预取，速度损失很小；`"off"` 会在每一步重新计算前缀，速度较慢，但这是完全排除缓存的唯一方法。 | COMBO | 是 | `"auto"`<br />`"gpu"`<br />`"cpu"`<br />`"off"` |
| `dtype` | 缓存的存储精度。`"default"` 无损；`"int8"` 将缓存大小减半，精度约为 bf16；`"int4"` 将其大小降至四分之一，但每一步的误差大约翻倍。 | COMBO | 是 | `"default"`<br />`"int8"`<br />`"int4"` |

当缓存无法容纳时，模型会重新计算前缀，而不是逐出另一分支的槽位，因此设置过大只会降低速度，而不会导致运行失败。

## 输出

| 输出名称 | 描述 | 数据类型 |
| - | - | - |
| `MODEL` | 已应用缓存设备和精度的模型，可供采样。 | MODEL |

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

***

**Source fingerprint (SHA-256):** `0c10cdb465d1ee4063273ffbb4913def3830f7e329694cd0a2e292d6f3c37ae4`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.