cubiq / ComfyUI_FaceAnalysis

Extension for ComfyUI to evaluate the similarity between two faces
Apache License 2.0
227 stars 25 forks source link

Hi cubiq, I have a idea but don't know how to achieve #19

Open kelvinyoung opened 1 month ago

kelvinyoung commented 1 month ago

By using FaceAnalysis, I can get a image with Value & DIST on it, and also there is a string "Distance". Now I try to convert the string to a float type data that I can use a compare node to compare it with another float which I defined as a passing grade(e.g. 0.25), then if the float converted from "Distance" is large than the passing grade, that trigger the next same ksampler to excute or add a new queue.

cubiq commented 1 month ago

not sure I completely understand but that would require an IF/trigger node I guess

kelvinyoung commented 1 month ago

not sure I completely understand but that would require an IF/trigger node I guess the output [distance] is type of list, how can i convert it to string or float?

cubiq commented 1 month ago

you can use a SimpleMath node to convert it to Float. I believe a[0] should return a float but you can also do something like sum(a)/len(a) to get an average

kelvinyoung commented 1 month ago
截屏2024-06-04 11 26 43

I did as you teach me, but it dose not work.