๐Ÿ”€ IF (Condition Selector)

IfConditionSelector

Allows you to test for a condition and change the flow of execution on your prompt based on whether the condition evaluates to TRUE or FALSE. This node supports Lazy evaluation. Only the Inputs that are required based on the specified condition will be executed. A and B are the parameters that will be tested against each other and Condition specifies what kind of comparison will be made between them. If NOT is enabled then the condition will be reversed after evaluation. If Require_Inputs is enabled, then you must specify the TRUE_IN and FALSE_IN inputs as their values will be forwarded to the Output based on the results of the evaluation i.e. TRUE_IN will be forwarded if the condition evaluates to TRUE and FALSE_IN will be forwarded if the condition evaluates to FALSE. If Require_Inputs is disabled then TRUE_IN and FALSE_IN can be omitted and the raw boolean values True and False will be returned based on the result of the comparison. If Condition is set to CUSTOM, you may further specify a custom expression which will be evaluated. Within this expression you may use the variables A and B to refer to those respective inputs as well as any named global variables from [Memory Storage] nodes. Most valid Python expressions, types and built-in functions are supported in the custom expression. For a full list of supported operations please consult the file 'Helper.py' included in this node pack. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO. When the condition is set to 'CUSTOM', the parameters Input A and Input B used in the custom_expression must not be None.

Pack: ControlFlowUtils

custom_nodes.ControlFlowUtils

Inputs (8)

NameTypeRequired
conditionCOMBOrequired
require_inputsBOOLEANrequired
NOTBOOLEANrequired
custom_expressionSTRINGrequired
A*optional
B*optional
TRUE_IN*optional
FALSE_IN*optional

Outputs (1)

NameType
**