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

# ComfySoftSwitchNode - ComfyUI Built-in Node Documentation

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

软开关节点根据布尔条件在两个可能的输入值之间进行选择。当 `switch` 为真时，输出 `on_true` 输入的值；当 `switch` 为假时，输出 `on_false` 输入的值。该节点设计为惰性求值，意味着它仅根据开关状态评估所需的输入。

## 输入

| 参数         | 描述                                                               | 数据类型        | 是否必填 | 范围 |
| ---------- | ---------------------------------------------------------------- | ----------- | ---- | -- |
| `switch`   | 决定传递哪个输入的布尔条件。当为真时，选择 `on_true` 输入。当为假时，选择 `on_false` 输入。        | BOOLEAN     | 是    |    |
| `on_false` | 当 `switch` 条件为假时输出的值。此输入为可选，但 `on_false` 或 `on_true` 中至少有一个必须连接。 | MATCH\_TYPE | 否    |    |
| `on_true`  | 当 `switch` 条件为真时输出的值。此输入为可选，但 `on_false` 或 `on_true` 中至少有一个必须连接。 | MATCH\_TYPE | 否    |    |

**注意：** `on_false` 和 `on_true` 输入必须具有相同的数据类型，由节点内部模板定义。要使节点正常工作，这两个输入中至少有一个必须连接。

## 输出

| 输出名称     | 描述                                            | 数据类型        |
| -------- | --------------------------------------------- | ----------- |
| `output` | 选定的值。它将与连接的 `on_false` 或 `on_true` 输入的数据类型匹配。 | MATCH\_TYPE |

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

***

**Source fingerprint (SHA-256):** `f5e40e7f43948b81b5442c885c3e1ff15e38f8f7ddda00ef3be42225765bfd1c`
