Comfy-Org / Comfy-Org/ComfyUI

Error message occurred while importing the '....' module.

Open
#7,219 2 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### Expected Behavior

我的所有拓展都无法导入,下面只是其中一个,该如何解决?

### Actual Behavior

Error message occurred while importing the 'comfyui_controlnet_aux' module.

Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux\__init__.py", line 2, in
from .utils import here, define_preprocessor_inputs, INPUT
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 4, in
import cv2
ModuleNotFoundError: No module named 'cv2'

### Steps to Reproduce

Error message occurred while importing the 'segment anything' module.

Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\__init__.py", line 1, in
from .node import *
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\node.py", line 16, in
from sam_hq.predictor import SamPredictorHQ
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\sam_hq\predictor.py", line 4, in
from segment_anything import SamPredictor
ModuleNotFoundError: No module named 'segment_anything'

### Debug Logs

```powershell
E:\Huzi桌面\Ai\ComfyUI>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-03-13 16:52:38.869
** Platform: Windows
** Python version: 3.12.9 (tags/v3.12.9:fdb8142, Feb 4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)]
** Python executable: E:\Huzi桌面\Ai\ComfyUI\python_embeded\python.exe
** ComfyUI Path: E:\Huzi桌面\Ai\ComfyUI\ComfyUI
** ComfyUI Base Folder Path: E:\Huzi桌面\Ai\ComfyUI\ComfyUI
** User directory: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\user
** ComfyUI-Manager config path: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\user\default\ComfyUI-Manager\config.ini
** Log path: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\user\comfyui.log

Prestartup times for custom nodes:
1.5 seconds: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-manager

Checkpoint files will always be loaded safely.
Total VRAM 8188 MB, total RAM 16224 MB
pytorch version: 2.6.0+cu126
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4060 : cudaMallocAsync
Using pytorch attention
ComfyUI version: 0.3.24
[Prompt Server] web root: E:\Huzi桌面\Ai\ComfyUI\python_embeded\Lib\site-packages\comfyui_frontend_package\static
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-brushnet\__init__.py", line 1, in
from .brushnet_nodes import BrushNetLoader, BrushNet, BlendInpaint, PowerPaintCLIPLoader, PowerPaint, CutForInpaint
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-brushnet\brushnet_nodes.py", line 8, in
from accelerate import init_empty_weights, load_checkpoint_and_dispatch
ModuleNotFoundError: No module named 'accelerate'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-brushnet module for custom nodes: No module named 'accelerate'
### Loading: ComfyUI-Manager (V3.30.3)
[ComfyUI-Manager] network_mode: public
### ComfyUI Revision: 3220 [a1312584] *DETACHED | Released on '2025-03-06'
Error loading AILab_BiRefNet.py: No module named 'cv2'
Error loading AILab_RMBG.py: No module named 'cv2'
Error loading AILab_Segment.py: No module named 'segment_anything'
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-sam2\__init__.py", line 1, in
from .node import SAM2ModelLoader, GroundingDinoModelLoader, GroundingDinoSAM2Segment, InvertMask, IsMaskEmptyNode
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-sam2\node.py", line 15, in
from sam2.build_sam import build_sam2
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-sam2\sam2\__init__.py", line 7, in
from hydra import initialize_config_module
ModuleNotFoundError: No module named 'hydra'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-sam2 module for custom nodes: No module named 'hydra'
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\__init__.py", line 1, in
from .node import *
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\node.py", line 16, in
from sam_hq.predictor import SamPredictorHQ
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\sam_hq\predictor.py", line 4, in
from segment_anything import SamPredictor
ModuleNotFoundError: No module named 'segment_anything'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything module for custom nodes: No module named 'segment_anything'
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux\__init__.py", line 2, in
from .utils import here, define_preprocessor_inputs, INPUT
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 4, in
import cv2
ModuleNotFoundError: No module named 'cv2'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux module for custom nodes: No module named 'cv2'
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_segment_anything_plus\__init__.py", line 1, in
from .node import *
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_segment_anything_plus\node.py", line 17, in
from sam_hq.predictor import SamPredictorHQ
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything\sam_hq\predictor.py", line 4, in
from segment_anything import SamPredictor
ModuleNotFoundError: No module named 'segment_anything'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_segment_anything_plus module for custom nodes: No module named 'segment_anything'
Traceback (most recent call last):
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\seg-viton\__init__.py", line 31, in
from .segformer_clothes import *
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\seg-viton\segformer_clothes.py", line 7, in
from .utils.seg_clothes import *
File "E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\seg-viton\utils\seg_clothes.py", line 5, in
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

Cannot import E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\seg-viton module for custom nodes: No module named 'matplotlib'

Import times for custom nodes:
0.0 seconds: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-portrait-master-zh-cn
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_controlnet_aux
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\seg-viton
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui_segment_anything_plus
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-Segment-Anything
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-sam2
0.0 seconds (IMPORT FAILED): E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-brushnet
0.0 seconds: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-rmbg
0.3 seconds: E:\Huzi桌面\Ai\ComfyUI\ComfyUI\custom_nodes\comfyui-manager

Starting server

To see the GUI go to: http://127.0.0.1:8188
[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/alter-list.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/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
FETCH ComfyRegistry Data: 5/78
FETCH ComfyRegistry Data: 10/78
FETCH ComfyRegistry Data: 15/78
FETCH ComfyRegistry Data: 20/78
FETCH ComfyRegistry Data: 25/78
FETCH ComfyRegistry Data: 30/78
FETCH ComfyRegistry Data: 35/78
FETCH ComfyRegistry Data: 40/78
FETCH ComfyRegistry Data: 45/78
FETCH ComfyRegistry Data: 50/78
FETCH ComfyRegistry Data: 55/78
FETCH ComfyRegistry Data: 60/78
FETCH ComfyRegistry Data: 65/78
FETCH ComfyRegistry Data: 70/78
FETCH ComfyRegistry Data: 75/78
FETCH ComfyRegistry Data [DONE]
[ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
nightly_channel: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/remote
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[ComfyUI-Manager] All startup tasks have been completed.
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [DONE]
[ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.
nightly_channel: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/cache
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [DONE]
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extras.json [DONE]
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [DONE]
[ComfyUI-Manager] The ComfyRegistry cache update is still in progress, so an outdated cache is being used.
nightly_channel: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/cache
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [DONE]
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extras.json [DONE]
```

### Other

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.