A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The "LayerUtility: Boolean Operator V2" node is designed to perform advanced boolean operations on given inputs in a ComfyUI workflow. This node provides the ability to evaluate logical conditions between two values, whether they be explicitly provided as strings or indirectly as previously computed values.
Purpose: The primary function of this node is to perform boolean operations and comparisons between two input values using specified operators. It provides a flexible way to handle both string-formatted inputs and any other type of inputs.
Operators Available:
==
: Equal to!=
: Not equal to>
: Greater than<
: Less than>=
: Greater than or equal to<=
: Less than or equal toand
: Logical ANDor
: Logical ORxor
: Logical XOR (exclusive or)not(a)
: Logical NOT on first inputmin
: Minimum of two valuesmax
: Maximum of two valuesThe node accepts the following inputs:
Required Inputs:
Optional Inputs:
a_value
if provided.b_value
if provided.The node produces the following outputs:
output: A boolean result of the operation. It evaluates to True
or False
based on the logic applied using the specified operator.
string: A string representation of the boolean result.
The "Boolean Operator V2" node is versatile in its application within ComfyUI workflows. Here are a few ways it could be utilized:
Logical Conditions: Use this node to define logical conditions and branching logic in complex workflows, enabling different paths based on the evaluation of the inputs.
Input Evaluation: Transform and evaluate string-based inputs without pre-processing or conversion in a workflow, thus simplifying processes involving string data.
Decision Making: Allow dynamic decision-making based on real-time inputs and comparisons between variables within a workflow, such as user inputs or dynamically generated values.
Automatic Number Extraction: If a
or b
is not directly provided, the node attempts to extract number(s) from a_value
and b_value
, respectively, and uses the first number found for comparison.
Operator Flexibility: Provides a rich set of operators that includes both traditional boolean logic operators and comparative operators, catering to diverse logical and arithmetic conditions.
Output Type: The node ensures that even if the conditions are evaluated using numerical data, the output is consistently presented as a boolean and a string, making it easy to link with subsequent nodes expecting boolean data.
The "LayerUtility: Boolean Operator V2" node empowers users to incorporate complex decision logic into their ComfyUI workflows, facilitating sophisticated control flow with ease.