ComfyUI > Nodes > Akatz-Loop-Nodes > Lazy Switch | akatz-loops

ComfyUI Node: Lazy Switch | akatz-loops

Class Name

LazySwitch | akatz-loops

Category
Akatz Loop Nodes/Logic
Author
akatz-ai (Account age: 675days)
Extension
Akatz-Loop-Nodes
Latest Updated
2026-03-25
Github Stars
0.02K

How to Install Akatz-Loop-Nodes

Install this extension via the ComfyUI Manager by searching for Akatz-Loop-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Akatz-Loop-Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Lazy Switch | akatz-loops Description

LazySwitch node enables conditional logic by directing data flow based on a boolean condition.

Lazy Switch | akatz-loops| Lazy Switch | akatz-loops:

The LazySwitch node in the Lazy Switch | akatz-loops collection is designed to provide a flexible and efficient way to handle conditional logic within a node-based workflow. Its primary purpose is to allow you to choose between two potential outputs based on a boolean condition, effectively acting as a switch that directs the flow of data. This node is particularly beneficial in scenarios where you need to dynamically alter the path of execution without evaluating both potential outcomes, thus optimizing performance by only computing the necessary branch. By leveraging lazy evaluation, the LazySwitch node ensures that only the required data is processed, which can be especially advantageous in complex workflows where computational resources are a concern.

Lazy Switch | akatz-loops| Lazy Switch | akatz-loops Input Parameters:

switch

The switch parameter is a boolean input that determines which of the two potential outputs will be selected. When set to true, the node will output the value connected to the on_true input; when set to false, it will output the value connected to the on_false input. This parameter is crucial as it directly influences the node's decision-making process, effectively controlling the flow of data through the node. There are no minimum, maximum, or default values for this parameter, as it simply requires a boolean value (true or false).

on_false

The on_false parameter is a lazy input that represents the value to be output when the switch parameter is set to false. This input can accept any data type, allowing for flexibility in the types of data that can be conditionally processed. The lazy nature of this input means that it will only be evaluated if the switch is false, thereby conserving computational resources by avoiding unnecessary calculations.

on_true

The on_true parameter is a lazy input that represents the value to be output when the switch parameter is set to true. Similar to the on_false parameter, it can accept any data type, providing versatility in the types of data that can be conditionally processed. The lazy evaluation ensures that this input is only computed if the switch is true, optimizing performance by preventing the evaluation of unused branches.

Lazy Switch | akatz-loops| Lazy Switch | akatz-loops Output Parameters:

*

The output of the LazySwitch node is a single value, denoted by the wildcard *, which represents the selected input based on the switch parameter. This output can be of any data type, reflecting the type of the chosen input (on_true or on_false). The significance of this output lies in its ability to dynamically adapt to the conditions set by the switch, allowing for flexible and efficient data flow management within your workflow.

Lazy Switch | akatz-loops| Lazy Switch | akatz-loops Usage Tips:

  • Use the LazySwitch node to streamline workflows by conditionally processing data only when necessary, which can significantly reduce computational overhead in complex projects.
  • Ensure that the switch parameter is correctly set to reflect the desired condition, as this will determine which branch of your workflow is executed.

Lazy Switch | akatz-loops| Lazy Switch | akatz-loops Common Errors and Solutions:

Missing on_true or on_false

  • Explanation: This error occurs when the switch is set to true but no value is provided for on_true, or when the switch is set to false but no value is provided for on_false.
  • Solution: Ensure that both on_true and on_false inputs are connected to valid data sources, even if one of them is not expected to be used based on the current switch setting.

Invalid switch value

  • Explanation: The switch parameter must be a boolean value (true or false). If an invalid value is provided, the node will not function correctly.
  • Solution: Verify that the switch input is connected to a source that outputs a boolean value, and correct any connections that may be providing an incorrect data type.

Lazy Switch | akatz-loops Related Nodes

Go back to the extension to check out more related nodes.
Akatz-Loop-Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Lazy Switch | akatz-loops