Visit ComfyUI Online for ready-to-use ComfyUI environment
Conditional string replacement based on substring presence for dynamic text manipulation in AI art projects.
The CR Set Value on String node is designed to conditionally replace a given string based on the presence of a specified substring. This node is particularly useful for scenarios where you need to dynamically alter text content depending on whether a certain condition is met. By leveraging this node, you can streamline text manipulation tasks, ensuring that your string outputs are tailored to specific conditions without the need for complex scripting. The primary function of this node is to check if a test_string
is present within the input text
. If the condition is true, the node outputs a predefined value_if_true
; otherwise, it outputs a value_if_false
. This functionality is essential for creating adaptive and responsive text-based workflows in your AI art projects.
This parameter represents the input string that will be evaluated. It is a required field and must be provided for the node to function. The text
parameter is the main string in which the node will search for the presence of the test_string
. It does not support multiline input and defaults to an empty string.
This optional parameter specifies the substring that the node will search for within the text
. If the test_string
is found in the text
, the node will output the value_if_true
. If not, it will output the value_if_false
. This parameter also does not support multiline input and defaults to an empty string.
This optional parameter defines the string that will be output if the test_string
is found within the text
. It allows you to specify what the output should be when the condition is met. This parameter does not support multiline input and defaults to an empty string.
This optional parameter defines the string that will be output if the test_string
is not found within the text
. It allows you to specify what the output should be when the condition is not met. This parameter does not support multiline input and defaults to an empty string.
This output parameter provides the resulting string after the conditional check. If the test_string
is found within the text
, this output will be the value_if_true
; otherwise, it will be the value_if_false
. This output is crucial for dynamically generating text based on specific conditions.
This output parameter indicates whether the test_string
was found within the text
. It returns True
if the test_string
is present and False
if it is not. This boolean output can be used to trigger other conditional nodes or logic in your workflow.
This output parameter provides a URL link to the documentation or help page for the node. It is useful for users who need additional information or guidance on how to use the node effectively.
test_string
parameter to define specific keywords or phrases that you want to check for within the text
. This can help in creating dynamic and context-sensitive text outputs.value_if_true
and value_if_false
parameters to customize the output based on the presence or absence of the test_string
. This can be particularly useful for generating different responses or messages in your AI art projects.text
parameter is required and must be provided for the node to function.text
parameter.test_string
parameter must be a string.test_string
parameter is correctly set to a string value.value_if_true
parameter must be a string.value_if_true
parameter is correctly set to a string value.value_if_false
parameter must be a string.value_if_false
parameter is correctly set to a string value.© Copyright 2024 RunComfy. All Rights Reserved.