> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-recommend-assets-api.mintlify.site/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.

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

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

## 输入参数

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

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

## 输出参数

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