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

# ComfySwitchNode - ComfyUI Built-in Node Documentation

> Complete documentation for the ComfySwitchNode node in ComfyUI. Learn its inputs, outputs, parameters and usage.

Switch 节点根据布尔条件在两个可能的输入之间进行选择。当 `switch` 启用时，输出 `on_true` 输入；当 `switch` 禁用时，输出 `on_false` 输入。这使您能够创建工作流中的条件逻辑并选择不同的数据路径。

## 输入

| 参数    | 描述                                                          | 数据类型        | 是否必填 | 范围 |
| ----- | ----------------------------------------------------------- | ----------- | ---- | -- |
| `切换`  | 决定传递哪个输入的布尔条件。启用（true）时，选择 `为真时` 输入；禁用（false）时，选择 `为假时` 输入。 | BOOLEAN     | 是    |    |
| `为假时` | 当 `切换` 禁用（false）时传递给输出的数据。此输入仅在 `切换` 为 false 时必填。           | MATCH\_TYPE | 否    |    |
| `为真时` | 当 `切换` 启用（true）时传递给输出的数据。此输入仅在 `切换` 为 true 时必填。             | MATCH\_TYPE | 否    |    |

**关于输入要求的说明：** `on_false` 和 `on_true` 输入为条件性必填。节点仅在 `switch` 为 true 时请求 `on_true` 输入，仅在 `switch` 为 false 时请求 `on_false` 输入。两个输入必须具有相同的数据类型。

## 输出

| 输出名称 | 描述                                                                | 数据类型        |
| ---- | ----------------------------------------------------------------- | ----------- |
| `输出` | 选中的数据。如果 `切换` 为 true，则为 `为真时` 输入的值；如果 `切换` 为 false，则为 `为假时` 输入的值。 | MATCH\_TYPE |

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

***

**Source fingerprint (SHA-256):** `9f3cf58c1a04116fa0cbe8007fe3ed90e93c4de2e65f6778761d03fb21a63af3`
