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

# ComfySwitchNode - ComfyUI Built-in Node Documentation

> Switch 节点根据布尔条件在两个可能的输入之间进行选择。

Switch 节点根据布尔条件在两个可能的输入之间进行选择。当 `switch` 启用时，输出 `on_true` 输入；当 `switch` 禁用时，输出 `on_false` 输入。仅对所选分支进行求值，因此另一个输入不是必需的。这使您可以在工作流中创建条件逻辑并选择不同的数据路径。

## 输入

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

**输入要求说明：** `on_false` 和 `on_true` 输入是条件必需的。节点仅在 `switch` 为 true 时请求 `on_true` 输入，仅在 `switch` 为 false 时请求 `on_false` 输入。两个输入必须具有相同的数据类型，并且必须与输出数据类型匹配。

## 输出

| 输出名称 | 描述                                                                                | 数据类型        |
| ---- | --------------------------------------------------------------------------------- | ----------- |
| `输出` | 所选数据。如果 `switch` 为 true，则为 `on_true` 输入的值；如果 `switch` 为 false，则为 `on_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):** `d0adda02e7f997f27182cb26e11e934660ae5bd80f3091bed2fed7c981632ce5`
