Skip to content

Mac desktop版ComfyUI导入AnyLinePreprocessor失败 #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
s1u opened this issue Jan 13, 2025 · 1 comment
Open

Mac desktop版ComfyUI导入AnyLinePreprocessor失败 #33

s1u opened this issue Jan 13, 2025 · 1 comment

Comments

@s1u
Copy link

s1u commented Jan 13, 2025

Mac M2 Max
ComfyUI 0.4.6

...
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-01-13 11:31:42.874848
** Platform: Darwin
** Python version: 3.12.8 (main, Dec 19 2024, 14:22:58) [Clang 18.1.8 ]
** Python executable: /Users/ComfyUI/.venv/bin/python
** ComfyUI Path: /Applications/ComfyUI.app/Contents/Resources/ComfyUI
** Log path: /Users/ComfyUI/user/comfyui.log
Total VRAM 65536 MB, total RAM 65536 MB
pytorch version: 2.5.1
Set vram state to: SHARED
Device: mps
Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /Applications/ComfyUI.app/Contents/Resources/ComfyUI/web_custom_versions/desktop_app
### Loading: ComfyUI-Manager (V3.4)
### ComfyUI Revision: UNKNOWN (The currently installed ComfyUI is not a Git repository)

[rgthree-comfy] Loaded 42 epic nodes. 🎉

----------Jake Upgrade Nodes Loaded----------
[comfyui_controlnet_aux] | INFO -> Using ckpts path: /Users/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']
/Users/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 "/Applications/ComfyUI.app/Contents/Resources/ComfyUI/nodes.py", line 2089, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Users/ComfyUI/custom_nodes/ComfyUI-Anyline/__init__.py", line 1, in <module>
    from .anyline import AnyLine
  File "/Users/ComfyUI/custom_nodes/ComfyUI-Anyline/anyline.py", line 8, in <module>
    from custom_nodes.comfyui_controlnet_aux.utils import common_annotator_call
ModuleNotFoundError: No module named 'custom_nodes.comfyui_controlnet_aux'

Cannot import /Users/ComfyUI/custom_nodes/ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux'

Import times for custom nodes:
   0.0 seconds: /Applications/ComfyUI.app/Contents/Resources/ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui_ipadapter_plus
   0.0 seconds: /Users/ComfyUI/custom_nodes/rgthree-comfy
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui_essentials
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui-manager
   0.0 seconds (IMPORT FAILED): /Users/ComfyUI/custom_nodes/ComfyUI-Anyline
   0.1 seconds: /Users/ComfyUI/custom_nodes/ComfyUI-JakeUpgrade
   0.2 seconds: /Users/ComfyUI/custom_nodes/comfyui_controlnet_aux

Starting server
...

提示Cannot import /Users/ComfyUI/custom_nodes/ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux'但是下面的import里显示有comfyui_controlnet_aux。
而且custom_nodes下已经安装comfyui_controlnet_aux,没有它的报错。
AnyLinePreprocessor就是安装不上,无论是Try fix还是Switch ver.

@Tody190
Copy link

Tody190 commented Feb 4, 2025

Mac M2 Max ComfyUI 0.4.6

...
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-01-13 11:31:42.874848
** Platform: Darwin
** Python version: 3.12.8 (main, Dec 19 2024, 14:22:58) [Clang 18.1.8 ]
** Python executable: /Users/ComfyUI/.venv/bin/python
** ComfyUI Path: /Applications/ComfyUI.app/Contents/Resources/ComfyUI
** Log path: /Users/ComfyUI/user/comfyui.log
Total VRAM 65536 MB, total RAM 65536 MB
pytorch version: 2.5.1
Set vram state to: SHARED
Device: mps
Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: /Applications/ComfyUI.app/Contents/Resources/ComfyUI/web_custom_versions/desktop_app
### Loading: ComfyUI-Manager (V3.4)
### ComfyUI Revision: UNKNOWN (The currently installed ComfyUI is not a Git repository)

[rgthree-comfy] Loaded 42 epic nodes. 🎉

----------Jake Upgrade Nodes Loaded----------
[comfyui_controlnet_aux] | INFO -> Using ckpts path: /Users/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']
/Users/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 "/Applications/ComfyUI.app/Contents/Resources/ComfyUI/nodes.py", line 2089, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Users/ComfyUI/custom_nodes/ComfyUI-Anyline/__init__.py", line 1, in <module>
    from .anyline import AnyLine
  File "/Users/ComfyUI/custom_nodes/ComfyUI-Anyline/anyline.py", line 8, in <module>
    from custom_nodes.comfyui_controlnet_aux.utils import common_annotator_call
ModuleNotFoundError: No module named 'custom_nodes.comfyui_controlnet_aux'

Cannot import /Users/ComfyUI/custom_nodes/ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux'

Import times for custom nodes:
   0.0 seconds: /Applications/ComfyUI.app/Contents/Resources/ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui_ipadapter_plus
   0.0 seconds: /Users/ComfyUI/custom_nodes/rgthree-comfy
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui_essentials
   0.0 seconds: /Users/ComfyUI/custom_nodes/comfyui-manager
   0.0 seconds (IMPORT FAILED): /Users/ComfyUI/custom_nodes/ComfyUI-Anyline
   0.1 seconds: /Users/ComfyUI/custom_nodes/ComfyUI-JakeUpgrade
   0.2 seconds: /Users/ComfyUI/custom_nodes/comfyui_controlnet_aux

Starting server
...

提示Cannot import /Users/ComfyUI/custom_nodes/ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux'但是下面的import里显示有comfyui_controlnet_aux。 而且custom_nodes下已经安装comfyui_controlnet_aux,没有它的报错。 AnyLinePreprocessor就是安装不上,无论是Try fix还是Switch ver.

把 8,9,10 行改为

import os
import sys
custom_nodes_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if custom_nodes_directory not in sys.path:
    sys.path.append(custom_nodes_directory)
    print("[Debug] Added to sys.path:", custom_nodes_directory)
else:
    print("[Debug] Path already in sys.path")

# Requires comfyui_controlnet_aux funcsions and classes
from comfyui_controlnet_aux.utils import common_annotator_call
from comfyui_controlnet_aux.src.controlnet_aux.teed import TEDDetector
from comfyui_controlnet_aux.src.controlnet_aux.teed.ted import TED
from comfyui_controlnet_aux.src.controlnet_aux.lineart_standard import LineartStandardDetector as LineartStandardDetect

这个问题是因为作者没有添加 custom_nodes 的路径到 sys.path, 导致脚本找不到对应模块
然后导入的一些模块命名也不对,可能是 comfyui_controlnet_aux 更新修改了某些模块名的原因

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants