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

> The If/Else Switch node selects between two possible inputs based on a boolean condition.

The If/Else Switch node selects between two possible inputs based on a boolean condition. When `switch` is enabled (true), it passes the `on_true` input through to the output; when disabled (false), it passes `on_false`. The inputs are lazy, so only the selected branch is evaluated and the other input does not need to be connected.

## Inputs

| Parameter  | Description                                                                                                                                                                             | Data Type   | Required | Range |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------- | ----- |
| `switch`   | A boolean condition that determines which input is passed to the output. When enabled (true), the `on_true` input is selected. When disabled (false), the `on_false` input is selected. | BOOLEAN     | Yes      |       |
| `on_false` | The data to be passed to the output when `switch` is disabled (false). This input is requested only when `switch` is false.                                                             | MATCH\_TYPE | No       |       |
| `on_true`  | The data to be passed to the output when `switch` is enabled (true). This input is requested only when `switch` is true.                                                                | MATCH\_TYPE | No       |       |

**Note on Input Requirements:** The `on_false` and `on_true` inputs are conditionally requested. The node asks for `on_true` only when `switch` is true, and asks for `on_false` only when `switch` is false. Both inputs must be of the same data type, and that type must match the output data type. If the selected input is not connected, the node outputs no value.

## Outputs

| Output Name | Description                                                                                                             | Data Type   |
| ----------- | ----------------------------------------------------------------------------------------------------------------------- | ----------- |
| `output`    | The selected data: the value from `on_true` when `switch` is true, or the value from `on_false` when `switch` is false. | MATCH\_TYPE |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/ComfySwitchNode/en.md)

***

**Source fingerprint (SHA-256):** `42c442efeda0197d950702c52647233dee1a30216fb07e1ce4bc844784a6c5f2`
