ComfyUI > Nodes > Nodes for use with real-time applications of ComfyUI > Similarity Filter 🕒🅡🅣🅝

ComfyUI Node: Similarity Filter 🕒🅡🅣🅝

Class Name

SimilarityFilter

Category
real-time/control/utility
Author
RyanOnTheInside (Account age: 3947days)
Extension
Nodes for use with real-time applications of ComfyUI
Latest Updated
2025-03-04
Github Stars
0.02K

How to Install Nodes for use with real-time applications of ComfyUI

Install this extension via the ComfyUI Manager by searching for Nodes for use with real-time applications of ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Nodes for use with real-time applications of ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Similarity Filter 🕒🅡🅣🅝 Description

Evaluate image similarity based on various factors for image data sets comparison, aiding in automated content filtering.

Similarity Filter 🕒🅡🅣🅝:

The SimilarityFilter node is designed to evaluate and compare the similarity between two sets of image data, providing a comprehensive analysis based on various factors such as class overlap, spatial arrangement, confidence levels, object sizes, and relationships between objects. This node is particularly beneficial for tasks that require distinguishing between images based on their content, such as in image retrieval systems or automated tagging processes. By calculating a similarity score, the node helps in determining whether two images are similar enough to be considered equivalent or related, based on a customizable threshold. This functionality is crucial for AI artists and developers who need to automate the process of image comparison and filtering, ensuring that only relevant images are processed further.

Similarity Filter 🕒🅡🅣🅝 Input Parameters:

class_weight

This parameter determines the importance of class overlap in the similarity calculation. It affects how much the presence of similar objects in both images contributes to the overall similarity score. The default value is 0.3, with a range from 0.0 to 1.0, allowing you to adjust the weight based on the significance of object classes in your specific use case.

spatial_weight

Spatial weight influences the impact of spatial similarity, which compares the locations of objects within the images. A higher weight means that the spatial arrangement of objects will have a greater effect on the similarity score. The default value is 0.2, with a range from 0.0 to 1.0.

confidence_weight

This parameter controls the weight of confidence similarity, which assesses the confidence levels of detected objects in the images. It helps in determining how much the certainty of object detection should influence the similarity score. The default value is 0.2, with a range from 0.0 to 1.0.

size_weight

Size weight affects the contribution of size similarity, which compares the sizes of detected objects in the images. It is useful for scenarios where the size of objects is a critical factor in determining similarity. The default value is 0.15, with a range from 0.0 to 1.0.

relationship_weight

This parameter sets the weight for relationship similarity, which evaluates the distances between objects in the images. It is particularly useful for assessing the relative positioning of objects. The default value is 0.15, with a range from 0.0 to 1.0.

threshold

The threshold parameter defines the minimum similarity score required for the images to be considered similar. Scores above this threshold will return a positive similarity result. The default value is 0.5, with a range from 0.0 to 1.0, allowing you to fine-tune the sensitivity of the similarity detection.

Similarity Filter 🕒🅡🅣🅝 Output Parameters:

similarity_score

This output provides the calculated similarity score between the two images, expressed as a floating-point number. It represents the overall similarity based on the weighted factors and is crucial for determining the degree of similarity.

above_threshold

This boolean output indicates whether the similarity score exceeds the specified threshold. A value of True means the images are considered similar, while False indicates they are not.

explanation

The explanation output is a string that provides a detailed breakdown of the similarity calculation, including the individual contributions of each factor and the detected classes in both images. This output is valuable for understanding how the similarity score was derived and for debugging purposes.

Similarity Filter 🕒🅡🅣🅝 Usage Tips:

  • Adjust the weights of different similarity factors to prioritize the aspects most relevant to your task, such as class overlap or spatial arrangement.
  • Use the threshold parameter to control the sensitivity of similarity detection, ensuring it aligns with your specific requirements for image comparison.
  • Review the explanation output to gain insights into the similarity calculation and make informed adjustments to the input parameters.

Similarity Filter 🕒🅡🅣🅝 Common Errors and Solutions:

"Invalid input data"

  • Explanation: This error occurs when the input data is not in the expected format or is missing required information.
  • Solution: Ensure that the input data is correctly formatted and contains all necessary information, such as object detections and confidence scores.

"Threshold value out of range"

  • Explanation: The threshold parameter is set outside the allowable range of 0.0 to 1.0.
  • Solution: Adjust the threshold value to be within the specified range to ensure proper functionality.

"Weight parameters sum exceeds 1.0"

  • Explanation: The sum of all weight parameters exceeds 1.0, which can lead to incorrect similarity calculations.
  • Solution: Rebalance the weight parameters to ensure their sum does not exceed 1.0, maintaining the integrity of the similarity score.

Similarity Filter 🕒🅡🅣🅝 Related Nodes

Go back to the extension to check out more related nodes.
Nodes for use with real-time applications of ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.