cubiq / ComfyUI_FaceAnalysis

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

Nodes not Found FaceAnalysisModels, FaceSegmentation #29

Open zsuttonphoto opened 2 days ago

zsuttonphoto commented 2 days ago

Hey all,

I'm attempting to use FaceAnalysis along with IC-Light to experiment with some of my work as a commercial photographer, but I've run into issues when attempting to install FaceAnalysis.

image

I have installed (to my knowledge) Visual Studio with CMake support, CMake, and DLib. However, despite tinkering with this for a few hours now, I cannot get this script to load correctly in ComfyUI. Does anyone know what the problem might be?

Here is my ComfyUI startup code -

Prestartup times for custom nodes:
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
   0.9 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 10240 MB, total RAM 65437 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3080 : cudaMallocAsync
Using pytorch cross attention
Web extensions folder found at G:\AI\ComfyUI_windows_portable\ComfyUI\web\extensions\ComfyLiterals
[AnimateDiffEvo] - ERROR - No motion models found. Please download one and place in: ['G:\\AI\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\ComfyUI-AnimateDiff-Evolved\\models', 'G:\\AI\\ComfyUI_windows_portable\\ComfyUI\\models\\animatediff_models']
Total VRAM 10240 MB, total RAM 65437 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3080 : cudaMallocAsync
### Loading: ComfyUI-Impact-Pack (V5.18.5)
### Loading: ComfyUI-Impact-Pack (Subpack: V0.6)
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Manager (V2.43)
### ComfyUI Revision: 2309 [dbb7dd3b] | Released on '2024-06-30'
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[comfyui_controlnet_aux] | INFO -> Using ckpts path: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[comfyui_controlnet_aux] | INFO -> Using symlinks: False
[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\dwpose.py:26: UserWarning: DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
  warnings.warn("DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly")
Traceback (most recent call last):
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1906, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis\__init__.py", line 1, in <module>
    from .faceanalysis import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis\faceanalysis.py", line 16, in <module>
    raise Exception("Please install either dlib or insightface to use this node.")
Exception: Please install either dlib or insightface to use this node.

Cannot import G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis module for custom nodes: Please install either dlib or insightface to use this node.
Traceback (most recent call last):
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\IC-Light-ComfyUI-Node\nodes.py", line 19, in <module>
    from diffusers.loaders.single_file_utils import (
ImportError: cannot import name 'create_vae_diffusers_config' from 'diffusers.loaders.single_file_utils' (G:\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\loaders\single_file_utils.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1906, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\IC-Light-ComfyUI-Node\__init__.py", line 1, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\IC-Light-ComfyUI-Node\nodes.py", line 27, in <module>
    raise ImportError("Diffusers version too old. Please update to 0.26.0 minimum.")
ImportError: Diffusers version too old. Please update to 0.26.0 minimum.

Cannot import G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\IC-Light-ComfyUI-Node module for custom nodes: Diffusers version too old. Please update to 0.26.0 minimum.

[rgthree] Loaded 40 fantastic nodes.
[rgthree] Will use rgthree's optimized recursive execution.

WAS Node Suite: OpenCV Python FFMPEG support is enabled
WAS Node Suite Warning: `ffmpeg_bin_path` is not set in `G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\was_suite_config.json` config file. Will attempt to use system ffmpeg binaries if available.
WAS Node Suite: Finished. Loaded 216 nodes successfully.

        "Art is the lie that enables us to recognize the truth." - Friedrich Nietzsche

Import times for custom nodes:
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Logic
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyUI_FrequencySeparation_RGB-HSV
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyLiterals
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-post-processing-nodes
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus
   0.0 seconds (IMPORT FAILED): G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-IC-Light
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-various
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials
   0.0 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux
   0.1 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite
   0.1 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
   0.2 seconds (IMPORT FAILED): G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\IC-Light-ComfyUI-Node
   0.5 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
   0.6 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Image-Filters
   1.3 seconds: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui

Starting server

To see the GUI go to: http://127.0.0.1:8188
FETCH DATA from: G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]

These are the models in my FaceAnalysis dlib folder - image

I cannot find the problem in my install, and am worried I won't find a solution to the problem. Anyone encounter this and know of a solution?

Thanks!

cubiq commented 2 days ago

you need to install dlib first

zsuttonphoto commented 2 days ago

I believe I have, following the guide here- https://github.com/z-mahmud22/Dlib_Windows_Python3.x

image

cubiq commented 2 days ago

The error message says:

Cannot import G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis module for custom nodes: Please install either dlib or insightface to use this node.

meaning that dlib can't be actually found. You are probably installing dlib globally and not inside the comfyUI environment

zsuttonphoto commented 2 days ago

The error message says:

Cannot import G:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceAnalysis module for custom nodes: Please install either dlib or insightface to use this node.

meaning that dlib can't be actually found. You are probably installing dlib globally and not inside the comfyUI environment

Okay, do you have a link to a guide that installs dlib into the ComfyUI environment?

cubiq commented 2 days ago

you need to use the python inside the windows portable, not the global one

zsuttonphoto commented 2 days ago

you need to use the python inside the windows portable, not the global one

Can you provide a tutorial? I was under the impression that if you type python inside the command prompt, it would be loading python

YuanGYao commented 1 day ago

@zsuttonphoto You can refer to the installation steps I mentioned in another issue https://github.com/cubiq/ComfyUI_FaceAnalysis/issues/14#issuecomment-2202532176