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

# ComfySwitchNode - ComfyUI Built-in Node Documentation

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

If/Else Switch 节点根据布尔条件在两个可能的输入之间进行选择。当 `switch` 启用（true）时，它将 `on_true` 输入传递到输出；当禁用（false）时，它传递 `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`。两个输入的数据类型必须相同，并且该类型必须与输出数据类型一致。如果所选的输入未连接，则节点不输出任何值。

## 输出

| 输出名称     | 描述                                                                                  | 数据类型        |
| -------- | ----------------------------------------------------------------------------------- | ----------- |
| `output` | 所选择的数据：当 `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):** `42c442efeda0197d950702c52647233dee1a30216fb07e1ce4bc844784a6c5f2`
