nosiu / comfyui-instantId-faceswap

Implementation of faceswap based on InstantID for ComfyUI.
Apache License 2.0
157 stars 14 forks source link

TypeError: FaceAnalysis.__init__() got an unexpected keyword argument 'providers' #6

Open cicwangbin2021 opened 4 months ago

cicwangbin2021 commented 4 months ago

thinks for you work.how can i solve the problem? node:load EVERYTHING

ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "I:\AI\COMFYUI\COMFYUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "I:\AI\COMFYUI\COMFYUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "I:\AI\COMFYUI\COMFYUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "I:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py", line 178, in create_pipeline app = FaceAnalysis(name="antelopev2", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: FaceAnalysis.init() got an unexpected keyword argument 'providers'

nosiu commented 4 months ago

Probably insightface version mismatch. pip show insightface to see version you have installed. This code runs on the latest version (0.7.3).

cicwangbin2021 commented 4 months ago

insightface Already working on version 0.7.3

I:\AI\ComfyUI\python_embeded>python -m pip show insightface Name: insightface Version: 0.7.3

nosiu commented 4 months ago

I still think there is something wrong with your insightface version but we can try to patch it on the fly. You will be hacking the code! It may be the end of your problems or only a start. Open this file in the editor: I:\AI\ComfyUI\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py Go to line 180, it should look like this: https://github.com/nosiu/comfyui-instantId-faceswap/blob/main/node.py#L180 add # before providers. After the edit it should look like this:

        app = FaceAnalysis(name="antelopev2",
                           root=INSIGHTFACE_PATH,
                           #providers=['CPUExecutionProvider', 'CUDAExecutionProvider']
        )

Save it and start comfy again