CosmicLaca / ComfyUI_Primere_Nodes

ComfyUI node pack
GNU General Public License v3.0
101 stars 13 forks source link

Import Failed Using ComfyUI Manager #4

Closed MinamiHasaki closed 9 months ago

MinamiHasaki commented 9 months ago

I tried using ComfyUI Manager to import ComfyUI_Primere_Nodes and the import failed. I think it might have to do with recent updates to ComfyUI.

CosmicLaca commented 9 months ago

Hi, please copy the error message.

CosmicLaca commented 9 months ago

I tried using ComfyUI Manager to import ComfyUI_Primere_Nodes and the import failed. I think it might have to do with recent updates to ComfyUI.

Hi, I tested clean import by Comfy manager, and all right in my side. Please reply the error message or screenshot.

2024-01-15_07-53-11

2024-01-15_07-54-44

2024-01-15_07-56-40

MinamiHasaki commented 9 months ago

Hi, sorry for the late reply. I took a long holiday to get some work done, then also got sick.

OS: Ubuntu 22.04 Python: 3.10.12 ComfyUI: 1915[ee2c5f](2024-01-16) Manager: V2.1

Here are the steps I took and the console message I received:

git clone git@github.com:comfyanonymous/ComfyUI.git
cd ComfyUI
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python main.py --cpu

Server runs. Stops server with CTRL+C.

cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
cd ..
python main.py --cpu

Server runs with ComfyUI Manger installed. Installs ComfyUI Primere Nodes via ComfyUI Manager. Restarts ComfyUI via the prompt in ComfyUI Manager. After restarting and refreshing the browser, checking if ComfyUI Primere Nodes are installed shows this:

image and this log:

** ComfyUI startup time: 2024-01-16 14:26:39.371916
[2024-01-16 14:26] ** Platform: Linux
[2024-01-16 14:26] ** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
[2024-01-16 14:26] ** Python executable: /home/minami/dev/ComfyUI/.venv/bin/python
[2024-01-16 14:26] ** Log path: /home/minami/dev/ComfyUI/comfyui.log
[2024-01-16 14:26] 
Prestartup times for custom nodes:
[2024-01-16 14:26]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-16 14:26] 
[2024-01-16 14:26] Total VRAM 7938 MB, total RAM 7938 MB
[2024-01-16 14:26] Set vram state to: DISABLED
[2024-01-16 14:26] Device: cpu
[2024-01-16 14:26] VAE dtype: torch.float32
[2024-01-16 14:26] Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[2024-01-16 14:26] ### Loading: ComfyUI-Manager (V2.1)
[2024-01-16 14:26] ### ComfyUI Revision: 1915 [ee2c5fa7] | Released on '2024-01-16'
[2024-01-16 14:26] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-16 14:26] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-16 14:26] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-16 14:26] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-16 14:26] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-16 14:26] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-16 14:26] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-16 14:26] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-16 14:26] Traceback (most recent call last):
  File "/home/minami/dev/ComfyUI/nodes.py", line 1872, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/__init__.py", line 11, in <module>
    from .Nodes import Segments
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/Nodes/Segments.py", line 7, in <module>
    from ..components import detectors
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/components/detectors.py", line 1, in <module>
    from ultralytics import YOLO
ModuleNotFoundError: No module named 'ultralytics'
[2024-01-16 14:26] 
[2024-01-16 14:26] Cannot import /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes module for custom nodes: No module named 'ultralytics'
[2024-01-16 14:26] 
Import times for custom nodes:
[2024-01-16 14:26]    0.1 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-16 14:26]    0.6 seconds (IMPORT FAILED): /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes
[2024-01-16 14:26] 
[2024-01-16 14:26] Starting server
[2024-01-16 14:26] 
[2024-01-16 14:26] To see the GUI go to: http://127.0.0.1:8188
[2024-01-16 14:26] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
[2024-01-16 14:26] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/.cache/1514988643_custom-node-list.json
[2024-01-16 14:26] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/.cache/1742899825_extension-node-map.json
CosmicLaca commented 9 months ago

Thank you. I will check this error tomorrow.

CosmicLaca commented 9 months ago

MinamiHasaki, I checking this error. The error is because the first row of components/detectors.py trying to import YOLO from this file: venv/Lib/site-packages/ultralytics/models/yolo/model.py, but as you see this file us the part of python venv. I found a quickstart here: https://docs.ultralytics.com/quickstart/ and I think 'pip install ultralytics' solve the problem. This module missing from 'requirements.txt'. I tried 'pip install ultralytics' in windows and working well, I hope will solve the problem in Linux too. If you pull my nodepack, you will found 'requirements.txt' with 'ultralytics' module. Please reply if solved. Thanks.

MinamiHasaki commented 9 months ago

So after pip install ultralytics, I received another error:

** ComfyUI startup time: 2024-01-19 10:24:42.344874
[2024-01-19 10:24] ** Platform: Linux
[2024-01-19 10:24] ** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
[2024-01-19 10:24] ** Python executable: /home/minami/dev/ComfyUI/.venv/bin/python
[2024-01-19 10:24] ** Log path: /home/minami/dev/ComfyUI/comfyui.log
[2024-01-19 10:24] 
Prestartup times for custom nodes:
[2024-01-19 10:24]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-19 10:24] 
[2024-01-19 10:24] Total VRAM 7938 MB, total RAM 7938 MB
[2024-01-19 10:24] Set vram state to: DISABLED
[2024-01-19 10:24] Device: cpu
[2024-01-19 10:24] VAE dtype: torch.float32
[2024-01-19 10:24] Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[2024-01-19 10:24] ### Loading: ComfyUI-Manager (V2.1)
[2024-01-19 10:24] ### ComfyUI Revision: 1915 [ee2c5fa7] | Released on '2024-01-16'
[2024-01-19 10:24] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-19 10:24] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-19 10:24] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-19 10:24] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-19 10:24] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-19 10:24] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-19 10:24] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-19 10:24] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-19 10:24] Traceback (most recent call last):
  File "/home/minami/dev/ComfyUI/nodes.py", line 1872, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/__init__.py", line 11, in <module>
    from .Nodes import Segments
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/Nodes/Segments.py", line 7, in <module>
    from ..components import detectors
  File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/components/detectors.py", line 9, in <module>
    from segment_anything import SamPredictor
ModuleNotFoundError: No module named 'segment_anything'
[2024-01-19 10:24] 
[2024-01-19 10:24] Cannot import /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes module for custom nodes: No module named 'segment_anything'
[2024-01-19 10:24] 
Import times for custom nodes:
[2024-01-19 10:24]    0.1 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-19 10:24]    1.1 seconds (IMPORT FAILED): /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes
[2024-01-19 10:24] 
[2024-01-19 10:24] Starting server
[2024-01-19 10:24] 
[2024-01-19 10:24] To see the GUI go to: http://127.0.0.1:9990
[2024-01-19 10:28] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
[2024-01-19 10:28] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/.cache/1514988643_custom-node-list.json
[2024-01-19 10:28] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/.cache/1742899825_extension-node-map.json

I tried to rectify this with pip install segment_anything. After restarting the server, I received no console errors, but was notified of missing custom nodes. These were the nodes that I installed via the "Install Missing Custom Nodes" option:

Screenshot 2024-01-19 103757 After installing and restarting the server, I received this error in console after trying to load "Primere_latest_workflow.json":

** ComfyUI startup time: 2024-01-19 10:42:09.105691
[2024-01-19 10:42] ** Platform: Linux
[2024-01-19 10:42] ** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
[2024-01-19 10:42] ** Python executable: /home/minami/dev/ComfyUI/.venv/bin/python
[2024-01-19 10:42] ** Log path: /home/minami/dev/ComfyUI/comfyui.log
[2024-01-19 10:42] 
Prestartup times for custom nodes:
[2024-01-19 10:42]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-19 10:42] 
[2024-01-19 10:42] Total VRAM 7938 MB, total RAM 7938 MB
[2024-01-19 10:42] Set vram state to: DISABLED
[2024-01-19 10:42] Device: cpu
[2024-01-19 10:42] VAE dtype: torch.float32
[2024-01-19 10:42] Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[2024-01-19 10:42] ### Loading: ComfyUI-Manager (V2.1)
[2024-01-19 10:42] ### ComfyUI Revision: 1915 [ee2c5fa7] | Released on '2024-01-16'
[2024-01-19 10:42] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-19 10:42] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-19 10:42] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-19 10:42] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-19 10:42] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-01-19 10:42] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-01-19 10:42] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-01-19 10:42] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-01-19 10:42] [tinyterraNodes] Loaded
[2024-01-19 10:42] 
Import times for custom nodes:
[2024-01-19 10:42]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/comfy-plasma
[2024-01-19 10:42]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Custom-Scripts
[2024-01-19 10:42]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale
[2024-01-19 10:42]    0.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes
[2024-01-19 10:42]    0.1 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager
[2024-01-19 10:42]    0.3 seconds: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes
[2024-01-19 10:42]    1.0 seconds: /home/minami/dev/ComfyUI/custom_nodes/bilbox-comfyui
[2024-01-19 10:42] 
[2024-01-19 10:42] Starting server
[2024-01-19 10:42] 
[2024-01-19 10:42] To see the GUI go to: http://127.0.0.1:9990
[2024-01-19 10:42] FETCH DATA from: /home/minami/dev/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
[2024-01-19 10:42] BilboX LUTs path set to: /home/minami/dev/ComfyUI/custom_nodes/bilbox-comfyui/luts
[ERROR] An error occurred while retrieving information for the 'PrimereImageSegments' node.
[2024-01-19 10:42] Traceback (most recent call last):
[2024-01-19 10:42]   File "/home/minami/dev/ComfyUI/server.py", line 420, in get_object_info
    out[x] = node_info(x)
[2024-01-19 10:42]   File "/home/minami/dev/ComfyUI/server.py", line 398, in node_info
    info['input'] = obj_class.INPUT_TYPES()
[2024-01-19 10:42]   File "/home/minami/dev/ComfyUI/custom_nodes/ComfyUI_Primere_Nodes/Nodes/Segments.py", line 46, in INPUT_TYPES
    sams = list(filter(lambda x: x.startswith('sam_vit'), folder_paths.get_filename_list("sams")))
[2024-01-19 10:42]   File "/home/minami/dev/ComfyUI/folder_paths.py", line 206, in get_filename_list
    out = get_filename_list_(folder_name)
[2024-01-19 10:42]   File "/home/minami/dev/ComfyUI/folder_paths.py", line 173, in get_filename_list_
    folders = folder_names_and_paths[folder_name]
[2024-01-19 10:42] KeyError: 'sams'
[2024-01-19 10:42] 
CosmicLaca commented 9 months ago

MinamiHasaki, true, for some nodes needed downloaded models to right path, specially for segments. Comfy model downloader helps, or as I remember, I written about segments model (download sources and target paths) in the readme.txt. Try out Primere_basic_workflow.json first, for this workflow no need third party models and nodes. Primere_latest_workflow.json is too difficult and needed 3rd party components.

CosmicLaca commented 9 months ago

Finally I added auto downloader, what download all required models if not exist.

CosmicLaca commented 9 months ago

For segment model downloader just do git pull and start comfy.

MinamiHasaki commented 9 months ago

Thank you.