cubiq / ComfyUI_FaceAnalysis

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

ValueError: only one element tensors can be converted to Python scalars #8

Closed wencxxxxxx closed 1 month ago

wencxxxxxx commented 3 months ago

屏幕截图 2024-04-07 020450

What is the reason for this, thank you for your help

dafeng012 commented 2 months ago

我找到了解决办法,我是在本地python-embed移动环境里面安装这个库python.exe -m pip install face-recognition

dafeng012 commented 2 months ago

我找到了解决办法,我是在本地python-embed移动环境里面安装这个库python.exe -m pip install face-recognition

我单独使用时没问题,但是放入其他工作流中使用,仍然有问题

dafeng012 commented 2 months ago

我找到了解决办法,我是在本地python-embed移动环境里面安装这个库python.exe -m pip install face-recognition

我单独使用时没问题,但是放入其他工作流中使用,仍然有问题

![Uploading Snipaste_2024-04-12_11-35-37.png…]()

rkuzmin commented 2 months ago

Got the same problem. dlib and inisightface are installed image

vootox commented 1 month ago

When I set 'filter_best = 1' error But with filter_best = 0 no error That's all I know

lhovav commented 1 month ago

I have this issute too..."only one element tensors can be converted to Python scalars"

cubiq commented 1 month ago

I need the full backtrace

lhovav commented 1 month ago

ohh sorry, I didn't want to jump into someone's else ticket..

FETCH DATA from: D:\programs\SD\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json got prompt Failed to validate prompt for output 30:

Prompt executed in 10.78 seconds

I updated the custom node, comfyui, installed dlib (insightface works well), can't chose dlib though under the face analysis models

Thanks.

cubiq commented 1 month ago

please check the latest version. I believe this is caused by an older numpy version, but the new code should work anyway

lhovav commented 1 month ago

Thanks for the quick reply Matteo

I have the latest version I believe: numpy 1.26.4 (I updated it earlier today) - But now after reloading everything I get this message:

Error occurred when executing FaceEmbedDistance:

can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint64, uint32, uint16, uint8, and bool.

File "D:\programs\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\programs\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "D:\programs\SD\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "D:\programs\SD\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis\faceanalysis.py", line 455, in analize out = torch.from_numpy(out[idx][:filter_best])

Thanks.

cubiq commented 1 month ago

you need to update this extension as well

lhovav commented 1 month ago

Wow I pulled something new...But I swear I did like 2 hours ago a pull...did you update it recently or am i tripping? I see you had 20 minutes ago an update, was it related to this issue? - ohh and its working for me - you need to win a noble price Matteo

cubiq commented 1 month ago

yes I just pushed an update. glad it finally works

lhovav commented 1 month ago

Awesome job Matteo - Thank you very much..<3

vootox commented 1 month ago

Also working!