Visit ComfyUI Online for ready-to-use ComfyUI environment
Evaluate text against length and character conditions for validation in data processing and content filtering.
The TextConditionCheck
node is designed to evaluate a given text against specified conditions related to its length and character frequency. This node is particularly useful for scenarios where you need to ensure that a text meets certain criteria before proceeding with further processing. By checking both the length and the frequency of specific characters within the text, this node helps in validating text inputs to ensure they conform to predefined standards. This can be beneficial in various applications, such as data validation, content filtering, or preprocessing text for machine learning models. The node's primary function is to return a result indicating whether the text satisfies the specified conditions, thus providing a straightforward mechanism for text validation.
This parameter represents the text input that you want to evaluate. It accepts a string and supports multiline text, allowing you to input complex or lengthy content. The default value is an empty string. The content of this parameter is crucial as it is the subject of the length and frequency checks performed by the node.
This parameter specifies the conditions related to the length of the original_content
. It can be a range, such as "3-6", indicating that the text length should be between 3 and 6 characters, or a specific number, indicating an exact length requirement. The default value is "3-6". This parameter directly influences whether the text passes the length validation check.
This parameter defines the conditions related to the frequency of specific characters within the original_content
. It is a string where each condition is separated by a pipe (|
) and consists of a character and its required count, separated by a comma (e.g., "a,2|b,3"). The default value is an empty string, meaning no frequency condition is applied unless specified. This parameter is essential for ensuring that the text contains certain characters a specified number of times.
This output is an integer that indicates whether the text meets the specified conditions. A value of 1
signifies that both the length and frequency conditions are satisfied, while a value of 0
indicates that one or both conditions are not met. This output provides a clear and concise result of the validation process.
This output is a string representation of the integer result, either "1" or "0", corresponding to the integer output. It serves as an additional format for the result, which can be useful for applications that require string-based outputs.
length_condition
is correctly formatted as either a range or a specific number to avoid unexpected results.frequency_condition
, clearly define each character and its required count to ensure accurate validation of the text.length_condition
is not formatted correctly, which can lead to errors in processing.length_condition
is either a single integer or a range in the format "start-end".frequency_condition
is not formatted correctly, causing the node to fail in evaluating the text.frequency_condition
as "char,count" pairs separated by pipes, ensuring each pair is correctly specified.frequency_condition
is not present in the original_content
.original_content
contains the specified characters in the required quantities or adjust the frequency_condition
accordingly.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.