LayerStyle

2167
By chflame
Updated 15 days ago
View on GitHub →See Common Issues →

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.

Available Nodes

LayerUtility: BooleanOperatorV2

Documentation: LayerUtility - Boolean Operator V2

Overview

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.

Functionality

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

  2. Operators Available:

    • == : Equal to
    • != : Not equal to
    • > : Greater than
    • < : Less than
    • >= : Greater than or equal to
    • <= : Less than or equal to
    • and : Logical AND
    • or : Logical OR
    • xor : Logical XOR (exclusive or)
    • not(a) : Logical NOT on first input
    • min : Minimum of two values
    • max : Maximum of two values

Inputs

The node accepts the following inputs:

  1. Required Inputs:

    • a_value: A string representation of the first value. Default is an empty string.
    • b_value: A string representation of the second value. Default is an empty string.
    • operator: The boolean operator to be used for the evaluation. Users must choose one from the provided list.
  2. Optional Inputs:

    • a: The first value. It will override a_value if provided.
    • b: The second value. It will override b_value if provided.

Outputs

The node produces the following outputs:

  1. output: A boolean result of the operation. It evaluates to True or False based on the logic applied using the specified operator.

  2. string: A string representation of the boolean result.

Usage in ComfyUI Workflows

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.

Special Features or Considerations

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