Visit ComfyUI Online for ready-to-use ComfyUI environment
Evaluate text and output based on substring presence for dynamic content adjustment in workflows.
The ConditionalTextOutput
node is designed to evaluate a given text and return specific content based on the presence or absence of a particular substring. This node is particularly useful when you need to dynamically adjust outputs depending on whether certain text criteria are met within a larger body of text. By automating the decision-making process, it allows you to streamline workflows that require conditional text processing, making it an essential tool for tasks that involve text analysis or content generation based on specific conditions.
This parameter represents the main body of text that you want to evaluate. It can be a multiline string, allowing you to input extensive text content. The node will search through this text to determine if the specified substring is present. The default value is an empty string, which means no content is provided initially.
This parameter specifies the substring you are looking for within the original_content
. It acts as the condition that triggers the node's decision-making process. If this text is found within the original_content
, the node will return a specific output. The default value is "查找字符", which translates to "search character" in English.
This parameter defines the text that will be returned if the check_text
is found within the original_content
. It allows you to specify a custom response or action when the condition is met. The default value is "存在返回内容", meaning "content returned if exists".
This parameter specifies the text to return if the check_text
is not found within the original_content
. It provides a way to handle cases where the condition is not met, ensuring that the node always produces an output. The default value is "不存在返回内容", which means "content returned if not exists".
The output is a single string that reflects the result of the conditional check. If the check_text
is found in the original_content
, the output will be the text_if_exists
. Otherwise, it will be the text_if_not_exists
. This output allows you to easily integrate the node's decision into subsequent processes or workflows.
check_text
parameter is not left empty, as this will result in an empty output. Always specify a substring to search for.text_if_exists
and text_if_not_exists
to make the outputs more informative and useful for your specific application.check_text
parameter is empty, leading the node to return an empty string.check_text
parameter to ensure the node can perform its conditional check.original_content
does not contain the check_text
as anticipated.original_content
and check_text
for any discrepancies, such as typos or incorrect assumptions about the text content.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.