cubiq / ComfyUI_IPAdapter_plus

GNU General Public License v3.0
3.91k stars 293 forks source link

Error occurred when executing IPAdapterUnifiedLoaderFaceID: Assertion error #521

Closed ak47training closed 5 months ago

ak47training commented 5 months ago

Hi

I'm stuck on this. Assertion error of some sort.

Here is a powershell log:

Loading 1 new model
INFO: Clip Vision model loaded from H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\clip_vision\CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors
INFO: IPAdapter model loaded from H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\ipadapter\ip-adapter-faceid-portrait_sdxl.bin
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
!!! Exception during processing!!!
Traceback (most recent call last):
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\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 "H:\ComfyUI\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 "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 491, in load_models
    self.insightface['model'] = insightface_loader(provider)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 153, in insightface_loader
    model = FaceAnalysis(name="buffalo_l", root=path, providers=[provider + 'ExecutionProvider',])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 43, in __init__
    assert 'detection' in self.models
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

image image

cubiq commented 5 months ago

if you use the unified loader you don't need to connect insightface

ak47training commented 5 months ago

I've disconnected Insightface pipeline, got the error "Missing Insightface", updated everything with update.bat, got the Dtype mismatch error, followed your instructions to run Comfy with --force-fp16, annnd now I have the same Assertion Error again. Do note that it seems IPAdapter Unified Loader FaceID is complaining, not IPAdapter FaceID: image

Workflow: image

Powershell log:

Loading 1 new model
INFO: Clip Vision model loaded from H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\clip_vision\CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors
INFO: IPAdapter model loaded from H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\ipadapter\ip-adapter-faceid-portrait_sdxl.bin
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
!!! Exception during processing!!!
Traceback (most recent call last):
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\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 "H:\ComfyUI\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 "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\IPAdapterPlus.py", line 491, in load_models
    self.insightface['model'] = insightface_loader(provider)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus\utils.py", line 153, in insightface_loader
    model = FaceAnalysis(name="buffalo_l", root=path, providers=[provider + 'ExecutionProvider',])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 43, in __init__
    assert 'detection' in self.models
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Prompt executed in 437.73 seconds
cubiq commented 5 months ago

there seems to be a problem with your insightface installation

ak47training commented 5 months ago

there seems to be a problem with your insightface installation

Thank you, cubiq, that has put me on the right trail!

For posterity and future wanderers looking for a solution for this sort of Assertion Error, my final steps to fix this which solved the issue were:

1) Download an archive with Insightface models via this link https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip 2) Put them into H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\models\insightface\models\buffalo_l (five files total as of today May 2nd 2024)