Logical Switch:
The Sage_LogicalSwitch node is designed to facilitate decision-making processes within your AI art workflows by allowing you to select between two different inputs based on a specified condition. This node is particularly useful when you want to dynamically choose which path to follow in your workflow, ensuring that only the necessary branch is evaluated, which can optimize performance and resource usage. By leveraging this node, you can create more flexible and efficient workflows that adapt to varying conditions, enhancing the overall functionality and responsiveness of your AI art projects.
Logical Switch Input Parameters:
condition
The condition parameter is a boolean input that determines which of the two provided values will be selected and passed through the node. If the condition is true, the node will evaluate and return the true_value; if false, it will evaluate and return the false_value. This parameter is crucial as it dictates the logical flow of your workflow. The default value is true, and it does not have a specified minimum or maximum value since it is a boolean.
true_value
The true_value parameter represents the input that will be selected if the condition is true. This input is evaluated lazily, meaning it is only processed if the condition requires it, which can save computational resources. It is optional, and if not provided, the node will rely on the false_value when the condition is true.
false_value
The false_value parameter is the input that will be selected if the condition is false. Similar to true_value, this input is also evaluated lazily and is optional. If not provided, the node will default to using the true_value when the condition is false.
Logical Switch Output Parameters:
result
The result parameter is the output of the node, representing the value selected based on the condition. It will be either the true_value or the false_value, depending on the evaluation of the condition. This output is crucial for directing the flow of your workflow, allowing you to dynamically adapt to different scenarios and conditions.
Logical Switch Usage Tips:
- Use the
Sage_LogicalSwitchnode to create conditional logic in your workflows, enabling dynamic decision-making based on real-time conditions. - Ensure that at least one of the
true_valueorfalse_valueinputs is connected to avoid errors and ensure the node functions correctly.
Logical Switch Common Errors and Solutions:
At least one of true_value or false_value must be connected.
- Explanation: This error occurs when neither the
true_valuenor thefalse_valueinputs are connected, leaving the node without a valid output to select. - Solution: Connect at least one of the
true_valueorfalse_valueinputs to ensure the node has a valid output to process based on the condition.
