sipie800 / ComfyUI-PuLID-Flux-Enhanced

Apache License 2.0
52 stars 7 forks source link

PulidFluxInsightFaceLoader AssertionError Fix #17

Open SuperFurias opened 2 weeks ago

SuperFurias commented 2 weeks ago

Hello guys, i'm opening this "issue" to help people with my same issue, the issue in question is this:

ComfyUI Error Report

Error Details

## System Information
- **ComfyUI Version:** v0.2.6-9-g6c9dbde
- **Arguments:** ComfyUI\main.py --windows-standalone-build
- **OS:** nt
- **Python Version:** 3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
- **Embedded Python:** true
- **PyTorch Version:** 2.5.1+cu124
## Devices

- **Name:** cuda:0 NVIDIA GeForce RTX 3060 Ti : cudaMallocAsync
  - **Type:** cuda
  - **VRAM Total:** 8589410304
  - **VRAM Free:** 1258256896
  - **Torch VRAM Total:** 5972688896
  - **Torch VRAM Free:** 40880640

## Logs

2024-11-03 19:12:29,211 - root - INFO - Total VRAM 8192 MB, total RAM 32682 MB 2024-11-03 19:12:29,211 - root - INFO - pytorch version: 2.5.1+cu124 2024-11-03 19:12:29,213 - root - INFO - Set vram state to: NORMAL_VRAM 2024-11-03 19:12:29,213 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3060 Ti : cudaMallocAsync 2024-11-03 19:12:30,420 - root - INFO - Using pytorch cross attention 2024-11-03 19:12:31,982 - root - INFO - [Prompt Server] web root: C:\AITools\ComfyUI_windows_portable\ComfyUI\web 2024-11-03 19:12:33,219 - ComfyUI-CogVideoXWrapper.custom_cogvideox_transformer_3d - INFO - sageattn not found, using sdpa 2024-11-03 19:12:33,232 - ComfyUI-CogVideoXWrapper.cogvideox_fun.transformer_3d - INFO - sageattn not found, using sdpa 2024-11-03 19:12:33,233 - ComfyUI-CogVideoXWrapper.cogvideox_fun.fun_pab_transformer_3d - INFO - sageattn not found, using sdpa 2024-11-03 19:12:34,144 - root - INFO - Total VRAM 8192 MB, total RAM 32682 MB 2024-11-03 19:12:34,144 - root - INFO - pytorch version: 2.5.1+cu124 2024-11-03 19:12:34,145 - root - INFO - Set vram state to: NORMAL_VRAM 2024-11-03 19:12:34,145 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3060 Ti : cudaMallocAsync 2024-11-03 19:12:38,654 - root - INFO - Import times for custom nodes: 2024-11-03 19:12:38,654 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 2024-11-03 19:12:38,654 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Logic 2024-11-03 19:12:38,654 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-mxToolkit 2024-11-03 19:12:38,654 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_JPS-Nodes 2024-11-03 19:12:38,654 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-various 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Chibi-Nodes 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-GGUF 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\x-flux-comfyui 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes 2024-11-03 19:12:38,655 - root - INFO - 0.0 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-dream-project 2024-11-03 19:12:38,656 - root - INFO - 0.1 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux 2024-11-03 19:12:38,656 - root - INFO - 0.1 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PuLID-Flux-Enhanced 2024-11-03 19:12:38,656 - root - INFO - 0.1 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Long-CLIP 2024-11-03 19:12:38,656 - root - INFO - 0.1 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node 2024-11-03 19:12:38,656 - root - INFO - 0.2 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 2024-11-03 19:12:38,656 - root - INFO - 0.3 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Florence2 2024-11-03 19:12:38,656 - root - INFO - 0.3 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 2024-11-03 19:12:38,656 - root - INFO - 0.3 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Easy-Use 2024-11-03 19:12:38,656 - root - INFO - 0.4 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-tensorops 2024-11-03 19:12:38,656 - root - INFO - 0.6 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-CogVideoXWrapper 2024-11-03 19:12:38,656 - root - INFO - 0.6 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_LayerStyle 2024-11-03 19:12:38,656 - root - INFO - 1.4 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PuLID-Flux 2024-11-03 19:12:38,656 - root - INFO - 1.4 seconds: C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui 2024-11-03 19:12:38,656 - root - INFO - 2024-11-03 19:12:38,668 - root - INFO - Starting server

2024-11-03 19:12:38,668 - root - INFO - To see the GUI go to: http://127.0.0.1:8188 2024-11-03 19:12:44,268 - root - INFO - got prompt 2024-11-03 19:12:44,324 - root - INFO - Using pytorch attention in VAE 2024-11-03 19:12:44,326 - root - INFO - Using pytorch attention in VAE 2024-11-03 19:12:52,796 - root - INFO - model weight dtype torch.float8_e4m3fn, manual cast: torch.bfloat16 2024-11-03 19:12:52,797 - root - INFO - modeltype FLUX 2024-11-03 19:13:18,643 - root - INFO - Requested to load FluxClipModel 2024-11-03 19:13:18,644 - root - INFO - Loading 1 new model 2024-11-03 19:13:34,820 - root - INFO - loaded partially 5624.8 5625.01318359375 0 2024-11-03 19:13:44,791 - root - ERROR - !!! Exception during processing !!! 2024-11-03 19:13:44,795 - root - ERROR - Traceback (most recent call last): File "C:\AITools\ComfyUI_windows_portable\ComfyUI\execution.py", line 323, in execute 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) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AITools\ComfyUI_windows_portable\ComfyUI\execution.py", line 198, in get_output_data 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) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AITools\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "C:\AITools\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AITools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-PuLID-Flux-Enhanced\pulidflux.py", line 223, in load_insightface model = FaceAnalysis(name="antelopev2", root=INSIGHTFACE_DIR, providers=[provider + 'ExecutionProvider',]) # alternative to buffalo_l ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AITools\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\app\face_analysis.py", line 43, in init assert 'detection' in self.models ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError

2024-11-03 19:13:44,797 - root - INFO - Prompt executed in 60.51 seconds

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

Workflow too large. Please manually upload the workflow from local file system.



## Additional Context
(Please add any additional context or steps to reproduce the error here)

the fix is pretty "simple" (i reinstalled and updated comfyui many times thinking it was my problem or the installation was wrong, but.. i just needed the correct models), it seems that if you let insightface download the models in automatic, the downloaded models will be wrong or some may be missing, and everything just doesn't work. you need to delete the folder "insightface" inside models and and then put this folder inside: https://huggingface.co/Aitrepreneur/insightface (thanks Aitrepreneur for the files)
and everything will magically work. i don't know why. it just does.
i hope with this many people with my same issue will be happy
planb788 commented 1 week ago

This is due to incorrect design of the plugin's decompression logic for insightface files, resulting in two layers of the antelopev2 folder. Simply cut out the inner folder to resolve the issue.