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: StringCondition

Documentation for the LayerUtility: StringCondition Node

Overview

The LayerUtility: StringCondition node is part of the ComfyUI platform, designed to help users evaluate string conditions within their workflows. It provides functionality to check specific conditions between a text and a substring, enabling more complex string manipulation and decision-making processes within the workflow.

What This Node Does

The StringCondition node checks if a particular condition holds between a given text and a specified substring. It facilitates operations like verifying if a substring is included in a text, is excluded, or if the text is equal to the substring. The result of this evaluation is provided as a boolean output, indicating whether the condition is met or not, as well as a string representation of the result.

Inputs

The LayerUtility: StringCondition node accepts the following inputs:

  1. text:

    • Type: STRING
    • Description: The main text or string against which the condition needs to be checked.
  2. condition:

    • Type: STRING
    • Options: include, exclude, equal
    • Description: The condition to apply. Options are:
      • include: Checks if the substring is present in the text.
      • exclude: Checks if the substring is not present in the text.
      • equal: Checks if the text is exactly equal to the substring.
  3. sub_string:

    • Type: STRING
    • Description: The substring which is used to evaluate the condition against the main text.

Outputs

The StringCondition node provides the following outputs:

  1. output:

    • Type: BOOLEAN
    • Description: A boolean value (True or False) indicating whether the specified condition was met.
  2. string:

    • Type: STRING
    • Description: A string representation of the boolean output.

Usage in ComfyUI Workflows

The LayerUtility: StringCondition node can be incorporated into ComfyUI workflows to add logic related to string handling and decision-making. For example, this node can be used to:

  • Validate if a set of filenames includes certain keywords.
  • Check user inputs for specific phrases before proceeding with subsequent steps.
  • Implement conditional branching in workflows based on string content comparisons.

In practice, this node would typically be combined with other nodes to form more complex flows, such as branching logic leading to different paths or processing steps based on the result of the string condition check.

Special Features and Considerations

  • The node supports only three basic string conditions (include, exclude, equal), making it straightforward and easy to use for common string checks.
  • The result of the condition check is also provided as a string, which can be useful for debugging or further processing within the workflow.
  • Consider potential case-sensitivity or whitespace issues that might affect the accuracy of the condition check, as these are not addressed explicitly by the node.

By incorporating the LayerUtility: StringCondition node into your ComfyUI workflows, you can enhance the decision-making capabilities of your interfaces, allowing for more dynamic and responsive interactions based on string content evaluations.