Visit ComfyUI Online for ready-to-use ComfyUI environment
Automate text comparison with flexible settings for similarity or difference modes, providing detailed results for analysis.
The Text Compare node is designed to help you analyze and compare two text strings to determine their similarity or differences. This node is particularly useful for tasks that require text validation, content matching, or identifying variations between two pieces of text. By leveraging this node, you can automate the process of text comparison, which can be beneficial in various applications such as content creation, data validation, and quality assurance. The node provides a flexible approach to comparison by allowing you to choose between similarity and difference modes, and it also offers a tolerance setting to fine-tune the sensitivity of the comparison. The results include a boolean indicating if the texts are identical, a similarity score, and a detailed comparison text highlighting the differences or similarities.
This parameter represents the first text string to be compared. It is a required input and should be provided as a string. The comparison process will use this text as one of the two primary inputs.
This parameter represents the second text string to be compared. Similar to text_a
, it is a required input and should be provided as a string. The comparison process will use this text as the other primary input.
This parameter allows you to choose the mode of comparison. It accepts two options: "similarity" and "difference". The "similarity" mode focuses on how similar the two texts are, while the "difference" mode highlights the differences between them. This setting helps tailor the comparison to your specific needs.
This parameter sets the tolerance level for the comparison. It is a floating-point number with a default value of 0.0, a minimum value of 0.0, and a maximum value of 1.0. The tolerance level adjusts the sensitivity of the comparison, with lower values making the comparison stricter and higher values allowing for more leniency.
This output returns the original text_a
input. It is useful for reference and validation purposes, ensuring you can easily trace back the input text.
This output returns the original text_b
input. Similar to TEXT_A_PASS
, it helps in referencing and validating the input text.
This output is a boolean value indicating whether the two texts are identical. A value of true
means the texts are exactly the same, while false
indicates they are different.
This output provides a numerical score representing the similarity or difference between the two texts. The score is a floating-point number, with higher values indicating greater similarity (in similarity mode) or greater difference (in difference mode).
This output is a text string that provides a detailed comparison of the two input texts. In similarity mode, it highlights the commonalities, while in difference mode, it emphasizes the differences. This output is particularly useful for understanding the specific areas where the texts match or diverge.
mode
parameter to switch between similarity and difference analysis based on your specific needs. For instance, use similarity mode for content matching and difference mode for identifying changes or discrepancies.tolerance
parameter to fine-tune the comparison sensitivity. A lower tolerance is ideal for strict comparisons, while a higher tolerance can be useful when minor differences are acceptable.COMPARISON_TEXT
output to get a detailed view of the comparison results, which can help in understanding the specific areas of similarity or difference between the texts.text_a
or text_b
) are empty.text_a
and text_b
are provided with valid text strings before executing the node.mode
parameter.mode
parameter to avoid this error.tolerance
parameter is set to a value outside the allowed range (0.0 to 1.0).tolerance
parameter to a value within the range of 0.0 to 1.0 to resolve this issue.© Copyright 2024 RunComfy. All Rights Reserved.