cubiq / ComfyUI_InstantID

Apache License 2.0
1.21k stars 69 forks source link

How to solve this problem has been bothering me for several days. #191

Open riviks opened 2 months ago

riviks commented 2 months ago

Error occurred when executing InstantIDFaceAnalysis:

'INSwapper' object has no attribute 'taskname'

File "D:\Software\ComfyUI\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\Software\ComfyUI\ComfyUI-aki-v1.3\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:\Software\ComfyUI\ComfyUI-aki-v1.3\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "D:\Software\ComfyUI\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_InstantID\InstantID.py", line 217, in load_insight_face model = FaceAnalysis(name="antelopev2", root=INSIGHTFACE_DIR, providers=[provider + 'ExecutionProvider',]) # alternative to buffalo_l File "D:\Software\ComfyUI\ComfyUI-aki-v1.3\custom_nodes\comfyui-reactor-node\reactor_patcher.py", line 54, in patched_faceanalysis_init elif model.taskname not in self.models and (allowed_modules is None or model.taskname in allowed_modules):

kjenney commented 2 weeks ago

I'm having the same issue/error with the latest version of ComfyUI on Linux (Ubuntu 22.04).

kjenney commented 2 weeks ago

I ended up solving my problem by removing an extra onnx model that was under the antelopev2 directory. I also had a permissions issue on some of the files/models.

cubiq commented 2 weeks ago

I believe the problem is with the reactor node that does something weird as always

kjenney commented 2 weeks ago

If you look at the error it's definitely an issue loading the models from the antelopev2 folder.

Takyon236 commented 2 weeks ago

Hey @kjenney I also have the same issues linked to loading the model, could you elaborate on how you solved it ?

kjenney commented 2 weeks ago

Hey @kjenney I also have the same issues linked to loading the model, could you elaborate on how you solved it ?

Make sure to follow the installation instructions. You need insightface with models. You should have 5 files with an .onnx extension in the models/insightface/models/antelopev2 directory.

Takyon236 commented 2 weeks ago

Yeah I got that but I'm still getting the same issue, maybe mine look the same but is ultimately different. It seems that no matter what the .onnx aren't loaded or downloaded.

kjenney commented 2 weeks ago
  1. Check file permissions
  2. Verify file path is correct
  3. Restart ComfyUI
Takyon236 commented 2 weeks ago
  1. Check file permissions
  2. Verify file path is correct
  3. Restart ComfyUI

Did that and still doesn't work, thank you for your help I'll try to open another issue, I thought we had the same problem but mine seems different.

kjenney commented 2 weeks ago

If it's the same error, then it's the same issue: load_insight_face model = FaceAnalysis(name="antelopev2", root=INSIGHTFACE_DIR clearly points to an issue loading models in this directory.

cubiq commented 2 weeks ago

try to disable reactor just as a test

Takyon236 commented 2 weeks ago

@cubiq It's not enable on myside, I've removed all the custom nodes I had except for this one to figure it out.

I tried everything you said @kjenney without much success

cubiq commented 2 weeks ago

what is the error now? It can't be the same the OP

Takyon236 commented 2 weeks ago

@cubiq Basically this "exception_message": "[Errno 32] Broken pipe",

"exception_message": "[Errno 32] Broken pipe",
"exception_type": "BrokenPipeError",
"traceback": [
  "  File \"/src/ComfyUI/execution.py\", line 378, in execute\n    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)\n",
  "  File \"/src/ComfyUI/execution.py\", line 225, in get_output_data\n    return_values = *map*node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)\n",
  "  File \"/src/ComfyUI/execution.py\", line 177, in *map*node_over_list\n    process_inputs(input_dict, i)\n",
  "  File \"/src/ComfyUI/execution.py\", line 166, in process_inputs\n    results.append(getattr(obj, func)(**inputs))\n",
  "  File \"/src/ComfyUI/custom_nodes/ComfyUI_InstantID/InstantID.py\", line 268, in load_insight_face\n    return self.load_insight_face(\"CPU\")\n",
  "  File \"/src/ComfyUI/custom_nodes/ComfyUI_InstantID/InstantID.py\", line 250, in load_insight_face\n    model = FaceAnalysis(name=model_name, root=INSIGHTFACE_DIR, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])\n",
  "  File \"/root/.pyenv/versions/3.10.15/lib/python3.10/site-packages/insightface/app/face_analysis.py\", line 31, in **init**\n    self.model_dir = ensure_available('models', name, root='insightface')\n",
  "  File \"/root/.pyenv/versions/3.10.15/lib/python3.10/site-packages/insightface/model_zoo/model_zoo.py\", line 96, in get_model\n    model = router.get_model(providers=providers, provider_options=provider_options)\n",
  "  File \"/root/.pyenv/versions/3.10.15/lib/python3.10/site-packages/insightface/model_zoo/model_zoo.py\", line 41, in get_model\n    print(f'Applied providers: {session._providers}, with options: {session._provider_options}')\n"
]

You can see that the providers here are differents it's because I tried a few things but even with the default one I have the same issue