ltdrdata / ComfyUI-Manager

ComfyUI-Manager is an extension designed to enhance the usability of ComfyUI. It offers management functions to install, remove, disable, and enable various custom nodes of ComfyUI. Furthermore, this extension provides a hub feature and convenience functions to access a wide range of information within ComfyUI.
GNU General Public License v3.0
7.07k stars 924 forks source link

Error installing ControlNet PreProcessors #21

Closed rethink-studios closed 1 year ago

rethink-studios commented 1 year ago

Ltd, I'm switching to your branch, an have run into an issue with installing Controlnet preprocessors. Everything installs OK, until the last line, and I'm wondering how I can fix. Thoughts?

See below:

FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json Install custom node 'ControlNet Preprocessors' install: ['https://github.com/Fannovel16/comfy_controlnet_preprocessors'] Download: git clone 'https://github.com/Fannovel16/comfy_controlnet_preprocessors' Install: pip packages Collecting opencv-contrib-python Using cached opencv_contrib_python-4.8.0.74-cp37-abi3-win_amd64.whl (44.8 MB) Requirement already satisfied: opencv-python in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 2)) (4.8.0.74) Collecting timm==0.6.7 Using cached timm-0.6.7-py3-none-any.whl (509 kB) Requirement already satisfied: torchvision in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 4)) (0.15.2+cu118) Requirement already satisfied: scipy in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 5)) (1.11.1) Requirement already satisfied: matplotlib in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 6)) (3.7.2) Requirement already satisfied: scikit-image in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 7)) (0.21.0) Requirement already satisfied: prettytable==3.6.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 8)) (3.6.0) Requirement already satisfied: addict in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 9)) (2.4.0) Requirement already satisfied: yapf in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 10)) (0.40.1) Collecting mediapipe Using cached mediapipe-0.10.1-cp310-cp310-win_amd64.whl (50.2 MB) Collecting fvcore Using cached fvcore-0.1.5.post20221221-py3-none-any.whl Collecting omegaconf Using cached omegaconf-2.3.0-py3-none-any.whl (79 kB) Requirement already satisfied: ftfy in d:\comfyui_ltd\python_embeded\lib\site-packages (from -r requirements.txt (line 14)) (6.1.1) Requirement already satisfied: torch>=1.4 in d:\comfyui_ltd\python_embeded\lib\site-packages (from timm==0.6.7->-r requirements.txt (line 3)) (2.0.1+cu118) Requirement already satisfied: wcwidth in d:\comfyui_ltd\python_embeded\lib\site-packages (from prettytable==3.6.0->-r requirements.txt (line 8)) (0.2.6) Requirement already satisfied: numpy>=1.19.3 in d:\comfyui_ltd\python_embeded\lib\site-packages (from opencv-contrib-python->-r requirements.txt (line 1)) (1.24.2) Requirement already satisfied: requests in d:\comfyui_ltd\python_embeded\lib\site-packages (from torchvision->-r requirements.txt (line 4)) (2.28.2) Requirement already satisfied: pillow!=8.3.,>=5.3.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from torchvision->-r requirements.txt (line 4)) (10.0.0) Requirement already satisfied: filelock in d:\comfyui_ltd\python_embeded\lib\site-packages (from torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (3.10.0) Requirement already satisfied: typing-extensions in d:\comfyui_ltd\python_embeded\lib\site-packages (from torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (4.5.0) Requirement already satisfied: networkx in d:\comfyui_ltd\python_embeded\lib\site-packages (from torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (3.0) Requirement already satisfied: jinja2 in d:\comfyui_ltd\python_embeded\lib\site-packages (from torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (3.1.2) Requirement already satisfied: sympy in d:\comfyui_ltd\python_embeded\lib\site-packages (from torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (1.11.1) Requirement already satisfied: packaging>=20.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (23.0) Requirement already satisfied: fonttools>=4.22.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (4.40.0) Requirement already satisfied: kiwisolver>=1.0.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (1.4.4) Requirement already satisfied: contourpy>=1.0.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (1.1.0) Requirement already satisfied: pyparsing<3.1,>=2.3.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (3.0.9) Requirement already satisfied: cycler>=0.10 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (0.11.0) Requirement already satisfied: python-dateutil>=2.7 in d:\comfyui_ltd\python_embeded\lib\site-packages (from matplotlib->-r requirements.txt (line 6)) (2.8.2) Requirement already satisfied: imageio>=2.27 in d:\comfyui_ltd\python_embeded\lib\site-packages (from scikit-image->-r requirements.txt (line 7)) (2.31.1) Requirement already satisfied: lazy_loader>=0.2 in d:\comfyui_ltd\python_embeded\lib\site-packages (from scikit-image->-r requirements.txt (line 7)) (0.3) Requirement already satisfied: PyWavelets>=1.1.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from scikit-image->-r requirements.txt (line 7)) (1.4.1) Requirement already satisfied: tifffile>=2022.8.12 in d:\comfyui_ltd\python_embeded\lib\site-packages (from scikit-image->-r requirements.txt (line 7)) (2023.7.4) Requirement already satisfied: platformdirs>=3.5.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from yapf->-r requirements.txt (line 10)) (3.8.0) Requirement already satisfied: tomli>=2.0.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from yapf->-r requirements.txt (line 10)) (2.0.1) Requirement already satisfied: importlib-metadata>=6.6.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from yapf->-r requirements.txt (line 10)) (6.7.0) Collecting absl-py Using cached absl_py-1.4.0-py3-none-any.whl (126 kB) Requirement already satisfied: flatbuffers>=2.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from mediapipe->-r requirements.txt (line 11)) (23.5.26) Requirement already satisfied: protobuf<4,>=3.11 in d:\comfyui_ltd\python_embeded\lib\site-packages (from mediapipe->-r requirements.txt (line 11)) (3.20.3) Requirement already satisfied: attrs>=19.1.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from mediapipe->-r requirements.txt (line 11)) (22.2.0) Collecting sounddevice>=0.4.4 Using cached sounddevice-0.4.6-py3-none-win_amd64.whl (199 kB) Requirement already satisfied: tabulate in d:\comfyui_ltd\python_embeded\lib\site-packages (from fvcore->-r requirements.txt (line 12)) (0.9.0) Requirement already satisfied: pyyaml>=5.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from fvcore->-r requirements.txt (line 12)) (6.0) Collecting iopath>=0.1.7 Using cached iopath-0.1.10-py3-none-any.whl Requirement already satisfied: yacs>=0.1.6 in d:\comfyui_ltd\python_embeded\lib\site-packages (from fvcore->-r requirements.txt (line 12)) (0.1.8) Requirement already satisfied: termcolor>=1.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from fvcore->-r requirements.txt (line 12)) (2.3.0) Requirement already satisfied: tqdm in d:\comfyui_ltd\python_embeded\lib\site-packages (from fvcore->-r requirements.txt (line 12)) (4.65.0) Requirement already satisfied: antlr4-python3-runtime==4.9. in d:\comfyui_ltd\python_embeded\lib\site-packages (from omegaconf->-r requirements.txt (line 13)) (4.9.3) Requirement already satisfied: zipp>=0.5 in d:\comfyui_ltd\python_embeded\lib\site-packages (from importlib-metadata>=6.6.0->yapf->-r requirements.txt (line 10)) (3.15.0) Requirement already satisfied: portalocker in d:\comfyui_ltd\python_embeded\lib\site-packages (from iopath>=0.1.7->fvcore->-r requirements.txt (line 12)) (2.7.0) Requirement already satisfied: six>=1.5 in d:\comfyui_ltd\python_embeded\lib\site-packages (from python-dateutil>=2.7->matplotlib->-r requirements.txt (line 6)) (1.16.0) Requirement already satisfied: CFFI>=1.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from sounddevice>=0.4.4->mediapipe->-r requirements.txt (line 11)) (1.15.1) Requirement already satisfied: charset-normalizer<4,>=2 in d:\comfyui_ltd\python_embeded\lib\site-packages (from requests->torchvision->-r requirements.txt (line 4)) (3.1.0) Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\comfyui_ltd\python_embeded\lib\site-packages (from requests->torchvision->-r requirements.txt (line 4)) (1.26.15) Requirement already satisfied: certifi>=2017.4.17 in d:\comfyui_ltd\python_embeded\lib\site-packages (from requests->torchvision->-r requirements.txt (line 4)) (2022.12.7) Requirement already satisfied: idna<4,>=2.5 in d:\comfyui_ltd\python_embeded\lib\site-packages (from requests->torchvision->-r requirements.txt (line 4)) (3.4) Requirement already satisfied: colorama in d:\comfyui_ltd\python_embeded\lib\site-packages (from tqdm->fvcore->-r requirements.txt (line 12)) (0.4.6) Requirement already satisfied: pycparser in d:\comfyui_ltd\python_embeded\lib\site-packages (from CFFI>=1.0->sounddevice>=0.4.4->mediapipe->-r requirements.txt (line 11)) (2.21) Requirement already satisfied: MarkupSafe>=2.0 in d:\comfyui_ltd\python_embeded\lib\site-packages (from jinja2->torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (2.1.2) Requirement already satisfied: pywin32>=226 in d:\comfyui_ltd\python_embeded\lib\site-packages (from portalocker->iopath>=0.1.7->fvcore->-r requirements.txt (line 12)) (306) Requirement already satisfied: mpmath>=0.19 in d:\comfyui_ltd\python_embeded\lib\site-packages (from sympy->torch>=1.4->timm==0.6.7->-r requirements.txt (line 3)) (1.3.0) Installing collected packages: opencv-contrib-python, omegaconf, absl-py, sounddevice, iopath, mediapipe, fvcore, timm ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'D:\ComfyUI_LTD\python_embeded\Lib\site-packages\cv2\cv2.pyd' Consider using the --user option or check the permissions.

[notice] A new release of pip is available: 23.0.1 -> 23.1.2 [notice] To update, run: D:\ComfyUI_LTD\python_embeded\python.exe -m pip install --upgrade pip install script failed: https://github.com/Fannovel16/comfy_controlnet_preprocessors FECTH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json

ltdrdata commented 1 year ago
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'D:\ComfyUI_LTD\python_embeded\Lib\site-packages\cv2\cv2.pyd'

That issue occurred on Windows and cannot avoid while running ComfuUI.

You need to turn off ComfyUI and manually execute install script for controlnet preprocessors custom node. goto comfyui-controlnet-preprocessor directory and execute belows.

D:\ComfyUI_LTD\python_embeded\python.exe -m pip install -r requirements.txt
D:\ComfyUI_LTD\python_embeded\python.exe install.py
Davikar commented 1 year ago

I followed the step above, but I get the following error message at the end:

Traceback (most recent call last):
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\install.py", line 53, in <module>
    add_global_shortcut_module(this_module_name, os.path.join(EXT_PATH, "__init__.py"))
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\install.py", line 22, in add_global_shortcut_module
    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 "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\nodes\semseg.py", line 5, in <module>
    from ..v11 import oneformer
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\__init__.py", line 4, in <module>
    from .api import make_detectron2_model, semantic_run
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\api.py", line 7, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.projects.deeplab import add_deeplab_config
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\projects\deeplab\__init__.py", line 4, in <module>
    from .resnet import build_resnet_deeplab_backbone
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\projects\deeplab\resnet.py", line 6, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.modeling import BACKBONE_REGISTRY
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\__init__.py", line 20, in <module>
    from .meta_arch import (
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\__init__.py", line 6, in <module>
    from .panoptic_fpn import PanopticFPN
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\panoptic_fpn.py", line 14, in <module>
    from .rcnn import GeneralizedRCNN
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\rcnn.py", line 9, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.data.detection_utils import convert_image_to_rgb
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\__init__.py", line 2, in <module>
    from . import transforms  # isort:skip
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\__init__.py", line 4, in <module>
    from .transform import *
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\transform.py", line 36, in <module>
    class ExtentTransform(Transform):
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\transform.py", line 46, in ExtentTransform
    def __init__(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
AttributeError: module 'PIL.Image' has no attribute 'LINEAR'. Did you mean: 'BILINEAR'?

(Latest ComfyUI build as of now, Windows 11, Python 3.10.11)

ltdrdata commented 1 year ago

I followed the step above, but I get the following error message at the end:

Traceback (most recent call last):
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\install.py", line 53, in <module>
    add_global_shortcut_module(this_module_name, os.path.join(EXT_PATH, "__init__.py"))
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\install.py", line 22, in add_global_shortcut_module
    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 "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.nodes import edge_line, normal_depth_map, pose, semseg, others
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\nodes\semseg.py", line 5, in <module>
    from ..v11 import oneformer
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\__init__.py", line 4, in <module>
    from .api import make_detectron2_model, semantic_run
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\api.py", line 7, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.projects.deeplab import add_deeplab_config
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\projects\deeplab\__init__.py", line 4, in <module>
    from .resnet import build_resnet_deeplab_backbone
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\projects\deeplab\resnet.py", line 6, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.modeling import BACKBONE_REGISTRY
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\__init__.py", line 20, in <module>
    from .meta_arch import (
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\__init__.py", line 6, in <module>
    from .panoptic_fpn import PanopticFPN
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\panoptic_fpn.py", line 14, in <module>
    from .rcnn import GeneralizedRCNN
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\modeling\meta_arch\rcnn.py", line 9, in <module>
    from custom_nodes.comfy_controlnet_preprocessors.v11.oneformer.detectron2.data.detection_utils import convert_image_to_rgb
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\__init__.py", line 2, in <module>
    from . import transforms  # isort:skip
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\__init__.py", line 4, in <module>
    from .transform import *
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\transform.py", line 36, in <module>
    class ExtentTransform(Transform):
  File "C:\AI\ComfyUI\ComfyUI\custom_nodes\comfy_controlnet_preprocessors\v11\oneformer\detectron2\data\transforms\transform.py", line 46, in ExtentTransform
    def __init__(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
AttributeError: module 'PIL.Image' has no attribute 'LINEAR'. Did you mean: 'BILINEAR'?

(Latest ComfyUI build as of now, Windows 11, Python 3.10.11)

You should downgrade Pillow package to 9.5.0. Currently, the controlnet preprocessor custom node has not yet been addressed for compatibility issues with the latest Pillow package update (10.0.0).

python -m pip install Pillow==9.5.0

Davikar commented 1 year ago

Ok, that worked. Thanks. :)