ComfyUI > Nodes > ComfyUI-Portrait-Maker > Similarity PM

ComfyUI Node: Similarity PM

Class Name

PM_Similarity

Category
protrait/model
Author
THtianhao (Account age: 3700days)
Extension
ComfyUI-Portrait-Maker
Latest Updated
2024-05-22
Github Stars
0.17K

How to Install ComfyUI-Portrait-Maker

Install this extension via the ComfyUI Manager by searching for ComfyUI-Portrait-Maker
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Portrait-Maker 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Similarity PM Description

Compare image similarity using specified model for face recognition and image matching, simplifying comparison process for various applications.

Similarity PM:

The PM_Similarity node is designed to compare two images and determine their similarity based on a specified model. This node is particularly useful for tasks such as face recognition, where you need to measure how closely two images resemble each other. By leveraging advanced embedding techniques, the node computes a similarity score that quantifies the likeness between the main image and the comparison image. This score can be used in various applications, including identity verification, image matching, and more. The node simplifies the process of image comparison, making it accessible even to those without a deep technical background.

Similarity PM Input Parameters:

main_image

This parameter represents the primary image that you want to compare. It should be provided in the form of an image tensor. The main image serves as the reference point against which the comparison image will be evaluated.

compare_image

This parameter is the image that you want to compare against the main image. Like the main_image, it should be provided as an image tensor. The comparison image is evaluated to determine its similarity to the main image.

model

This parameter specifies the model to be used for the similarity comparison. Currently, the only available option is "sim". This model uses advanced face recognition techniques to compute the similarity score between the two images.

result_prefix

This optional parameter allows you to add a prefix to the result string. If left empty, the result will simply be the similarity score rounded to two decimal places. If a prefix is provided, it will be appended to the score, separated by an underscore. This can be useful for organizing and categorizing results.

Similarity PM Output Parameters:

STRING

The output is a string that represents the similarity score between the main image and the comparison image. The score is a floating-point number rounded to two decimal places, indicating the degree of similarity. If a result_prefix is provided, the output will include this prefix followed by the score.

Similarity PM Usage Tips:

  • Ensure that both the main_image and compare_image are preprocessed and formatted correctly as image tensors to avoid errors during comparison.
  • Use the result_prefix parameter to categorize and organize your results, especially when running multiple comparisons in a batch.
  • The similarity score can be used in various applications such as identity verification, duplicate image detection, and more. Experiment with different images to understand the range and sensitivity of the similarity scores.

Similarity PM Common Errors and Solutions:

"Invalid image tensor format"

  • Explanation: This error occurs when the input images are not provided in the correct tensor format.
  • Solution: Ensure that both main_image and compare_image are correctly preprocessed and formatted as image tensors before passing them to the node.

"Model not recognized"

  • Explanation: This error is raised when an unsupported model is specified in the model parameter.
  • Solution: Currently, only the "sim" model is supported. Ensure that the model parameter is set to "sim".

"Error in computing similarity score"

  • Explanation: This error can occur due to issues in the internal computation of the similarity score, possibly due to incompatible image dimensions or corrupted data.
  • Solution: Verify that the input images are valid and correctly preprocessed. Check for any issues in the image data that might affect the computation.

Similarity PM Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Portrait-Maker
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.