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

# ComfySwitchNode - ComfyUI Built-in Node Documentation

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

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

The Switch node selects between two possible inputs based on a boolean condition. It outputs the `on_true` input when the `switch` is enabled, and the `on_false` input when the `switch` is disabled. This allows you to create conditional logic and choose different data paths in your workflow.

## Inputs

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

**Note on Input Requirements:** The `on_false` and `on_true` inputs are conditionally required. The node will request the `on_true` input only when the `switch` is true, and the `on_false` input only when the `switch` is false. Both inputs must be of the same data type.

## Outputs

| Output Name | Data Type   | Description                                                                                                                                                  |
| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `output`    | MATCH\_TYPE | The selected data. This will be the value from the `on_true` input if the `switch` is true, or the value from the `on_false` input if the `switch` is false. |
