Visit ComfyUI Online for ready-to-use ComfyUI environment
Determine presence of specified substrings in text for text analysis and processing tasks, offering flexibility in requirements.
The CheckSubstringPresence
node is designed to determine whether specific substrings are present within a given text. This node is particularly useful for text analysis and processing tasks where you need to verify the existence of certain keywords or phrases. It offers flexibility by allowing you to specify whether all specified substrings must be present or if the presence of any one of them is sufficient. This capability can be beneficial in scenarios such as content filtering, keyword detection, or text validation, where understanding the presence of certain terms can guide further actions or decisions.
This parameter represents the text content in which you want to search for specific substrings. It is the main body of text that will be analyzed by the node. The input should be a string, and there is no strict limit on its length, allowing you to work with both short and long text passages. The default value is "文本内容", which means "text content" in Chinese, indicating that you should replace it with your actual text.
This parameter specifies the substrings you are looking for within the input_text
. You can provide multiple substrings separated by a pipe (|
) character, allowing you to search for several terms at once. The default value is "查找符1|查找符2", which translates to "search term 1|search term 2", suggesting that you should replace these placeholders with the actual substrings you are interested in.
The mode
parameter determines the condition under which the node will return a positive result. It offers two options: "同时满足" (all must be present) and "任意满足" (any one must be present). The default setting is "任意满足", meaning that the presence of any one of the specified substrings will result in a positive outcome. This parameter allows you to tailor the node's behavior to your specific needs, whether you require all substrings to be present or just one.
The output is an integer value that indicates whether the specified condition has been met. A value of 1
signifies that the condition is satisfied, meaning that either all or any of the specified substrings are present in the input_text
, depending on the mode
selected. Conversely, a value of 0
indicates that the condition is not met, meaning that the required substrings are not present according to the specified mode
.
|
) character.substring
parameter correctly by using the pipe character to separate multiple substrings.mode
parameter is set to one of the two valid options. If you encounter an error, check for typos or incorrect values.input_text
parameter is empty, leading to a default return value.input_text
parameter to ensure the node can perform the substring check.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.