ComfyUI > Nodes > ComfyUI Layer Style > LayerUtility: String Condition

ComfyUI Node: LayerUtility: String Condition

Class Name

LayerUtility: StringCondition

Category
😺dzNodes/LayerUtility/Data
Author
chflame163 (Account age: 445days)
Extension
ComfyUI Layer Style
Latest Updated
2024-06-24
Github Stars
0.64K

How to Install ComfyUI Layer Style

Install this extension via the ComfyUI Manager by searching for ComfyUI Layer Style
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Layer Style in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

LayerUtility: String Condition Description

Evaluate presence/absence of substring in text for conditional text analysis and dynamic operations in AI workflows.

LayerUtility: String Condition:

The LayerUtility: StringCondition node is designed to evaluate whether a specified substring is present or absent within a given text string. This node is particularly useful for AI artists who need to perform conditional checks on text data, enabling dynamic and context-sensitive operations based on the presence or absence of specific keywords or phrases. By leveraging this node, you can streamline workflows that depend on text analysis, ensuring that subsequent actions are only executed when certain textual conditions are met. This can be especially beneficial in scenarios where text-based triggers or filters are required to control the flow of operations.

LayerUtility: String Condition Input Parameters:

text

This parameter represents the main text string that you want to evaluate. It is a required input and should be provided as a single-line string. The text parameter is the primary source of data against which the substring condition will be checked.

condition

This parameter specifies the type of condition to apply to the text. It accepts two options: "include" and "exclude". When set to "include", the node checks if the substring is present in the text. When set to "exclude", the node checks if the substring is absent from the text. This parameter determines the nature of the conditional check and is crucial for defining the logic of the operation.

sub_string

This parameter represents the substring that you want to search for within the main text. It is a required input and should be provided as a single-line string. The sub_string parameter is the specific text fragment that the node will look for, based on the condition specified.

LayerUtility: String Condition Output Parameters:

output

This output parameter is a boolean value that indicates the result of the conditional check. It returns True if the condition is met (i.e., the substring is included or excluded as specified) and False otherwise. This boolean output can be used to control the flow of subsequent operations based on the result of the text evaluation.

string

This output parameter is a string representation of the boolean result. It returns "True" or "False" based on the outcome of the conditional check. This string output can be useful for logging, debugging, or displaying the result in a more readable format.

LayerUtility: String Condition Usage Tips:

  • Use the "include" condition to trigger actions when a specific keyword or phrase is present in the text.
  • Use the "exclude" condition to prevent actions when a specific keyword or phrase is found in the text.
  • Combine this node with other conditional nodes to create complex logic flows based on text analysis.

LayerUtility: String Condition Common Errors and Solutions:

Invalid input type for text

  • Explanation: The text parameter must be a single-line string.
  • Solution: Ensure that the input provided for the text parameter is a valid single-line string.

Invalid input type for sub_string

  • Explanation: The sub_string parameter must be a single-line string.
  • Solution: Ensure that the input provided for the sub_string parameter is a valid single-line string.

Unsupported condition value

  • Explanation: The condition parameter must be either "include" or "exclude".
  • Solution: Verify that the condition parameter is set to either "include" or "exclude" and not any other value.

LayerUtility: String Condition Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Layer Style
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.