エラーまとめ【ComfyUI】

サムネイル_ComfyUIのイシューまとめ AIイラスト

今回は私が遭遇したComfyUIのエラーと、自分なりに解決させた方法の備忘録。なお、私はPython知らん人なので誤った対応をしている可能性もあります。ご了承ください。

- PR -

依存関係の不整合(Transformers, NumPy, ultralytics, mediapipe)

利用中のカスタムノードアップデート後、ComfyUIのアップデートでエラーを確認。影響としては、関連パッケージを利用するノードで何らかのエラーが発生すると予測される。(個別に確認はしていない)

関連モジュールとバージョン

※依存関係による問題のためバージョンは未記載

NumPy
Transformers
ultralytics
mediapipe

エラーを解消できた方法

mediapipe をアップグレードすることで解消。

BAT (Batchfile)
rem カレントフォルダを ComfyUI_windows_portable\python_embeded に切り替え
cd x:\path\to\ComfyUI_windows_portable\python_embeded
rem mediapipe のアップグレード
.\python.exe -m pip install -U mediapipe

ComfyUIをアップデートするたび再発するため上記手順だけだと完全に対処療法。
原因は、Transformers, mediapipe, ultralitics が要求する NumPy のバージョンが、最新の v2.2.4 では高すぎるため。(v2 未満である必要がある)

※「MeshGraphormer Hand Refiner 実行時の MeshGraphormer-DepthMapPreprocessor No module named ‘mediapipe’ エラー」と原因自体は一緒

現象と再現

  1. 各種カスタムノードのアップデート
  2. ComfyUI のアップデート
  3. アップデート中に依存関係に関するエラー発生(2025/03/28 時点で確認)

原因の調査

ComfyUIのアップデートログにエラー情報が出力されていたのでそこから見ていく。

ログの確認

ログの131行目で NumPy と Transformers がインストールされ、最新版(2025/03/28 時点では、NumPy-v2.2.4, Transformers-v4.50.2)がインストールされている。

これに起因して numba と ultralytics との整合性が崩れてしまっている。

BAT (Batchfile)
PS I:\tools\ComfyUI_windows_portable\update> .\update_comfyui_and_python_dependencies.bat
stashing current changes
creating backup branch: backup_branch_2025-03-28_15_46_31
checking out master branch
pulling latest changes
Done!
Collecting comfyui-frontend-package==1.14.6 (from -r ..\ComfyUI\requirements.txt (line 1))
  Downloading comfyui_frontend_package-1.14.6-py3-none-any.whl.metadata (117 bytes)
Requirement already satisfied: torch in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 2)) (2.6.0+cu126)
Requirement already satisfied: torchsde in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 3)) (0.2.6)
Requirement already satisfied: torchvision in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 4)) (0.21.0+cu126)
Requirement already satisfied: torchaudio in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 5)) (2.6.0+cu126)
Requirement already satisfied: numpy>=1.25.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 6)) (1.26.4)
Requirement already satisfied: einops in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 7)) (0.8.1)
Requirement already satisfied: transformers>=4.28.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 8)) (4.47.0)
Requirement already satisfied: tokenizers>=0.13.3 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 9)) (0.21.1)
Requirement already satisfied: sentencepiece in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 10)) (0.2.0)
Requirement already satisfied: safetensors>=0.4.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 11)) (0.5.3)
Requirement already satisfied: aiohttp>=3.11.8 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 12)) (3.11.14)
Requirement already satisfied: yarl>=1.18.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 13)) (1.18.3)
Requirement already satisfied: pyyaml in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 14)) (6.0.2)
Requirement already satisfied: Pillow in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 15)) (11.1.0)
Requirement already satisfied: scipy in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 16)) (1.15.2)
Requirement already satisfied: tqdm in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 17)) (4.67.1)
Requirement already satisfied: psutil in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 18)) (7.0.0)
Requirement already satisfied: kornia>=0.7.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 21)) (0.8.0)
Requirement already satisfied: spandrel in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 22)) (0.4.1)
Requirement already satisfied: soundfile in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 23)) (0.13.1)
Requirement already satisfied: av in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ..\ComfyUI\requirements.txt (line 24)) (14.2.0)
Requirement already satisfied: filelock in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (3.17.0)
Requirement already satisfied: typing-extensions>=4.10.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (4.12.2)
Requirement already satisfied: networkx in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (3.4.2)
Requirement already satisfied: jinja2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (3.1.5)
Requirement already satisfied: fsspec in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (2024.12.0)
Requirement already satisfied: setuptools in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (75.8.2)
Requirement already satisfied: sympy==1.13.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch->-r ..\ComfyUI\requirements.txt (line 2)) (1.13.1)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from sympy==1.13.1->torch->-r ..\ComfyUI\requirements.txt (line 2)) (1.3.0)
Requirement already satisfied: trampoline>=0.1.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torchsde->-r ..\ComfyUI\requirements.txt (line 3)) (0.1.2)
Requirement already satisfied: huggingface-hub<1.0,>=0.24.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (0.28.0)
Requirement already satisfied: packaging>=20.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (24.2)
Requirement already satisfied: regex!=2019.12.17 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (2024.11.6)
Requirement already satisfied: requests in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (2.32.3)
Requirement already satisfied: aiohappyeyeballs>=2.3.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (2.4.4)
Requirement already satisfied: aiosignal>=1.1.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (1.3.2)
Requirement already satisfied: attrs>=17.3.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (25.1.0)
Requirement already satisfied: frozenlist>=1.1.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (1.5.0)
Requirement already satisfied: multidict<7.0,>=4.5 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (6.1.0)
Requirement already satisfied: propcache>=0.2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ..\ComfyUI\requirements.txt (line 12)) (0.2.1)
Requirement already satisfied: idna>=2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from yarl>=1.18.0->-r ..\ComfyUI\requirements.txt (line 13)) (3.10)
Requirement already satisfied: colorama in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from tqdm->-r ..\ComfyUI\requirements.txt (line 17)) (0.4.6)
Requirement already satisfied: kornia_rs>=0.1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from kornia>=0.7.1->-r ..\ComfyUI\requirements.txt (line 21)) (0.1.8)
Requirement already satisfied: cffi>=1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from soundfile->-r ..\ComfyUI\requirements.txt (line 23)) (1.17.1)
Requirement already satisfied: pycparser in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from cffi>=1.0->soundfile->-r ..\ComfyUI\requirements.txt (line 23)) (2.22)
Requirement already satisfied: MarkupSafe>=2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from jinja2->torch->-r ..\ComfyUI\requirements.txt (line 2)) (3.0.2)
Requirement already satisfied: charset-normalizer<4,>=2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (3.4.1)
Requirement already satisfied: urllib3<3,>=1.21.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (1.26.20)
Requirement already satisfied: certifi>=2017.4.17 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ..\ComfyUI\requirements.txt (line 8)) (2024.12.14)
Downloading comfyui_frontend_package-1.14.6-py3-none-any.whl (34.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.9/34.9 MB 11.1 MB/s eta 0:00:00
Installing collected packages: comfyui-frontend-package
  Attempting uninstall: comfyui-frontend-package
    Found existing installation: comfyui_frontend_package 1.14.5
    Uninstalling comfyui_frontend_package-1.14.5:
      Successfully uninstalled comfyui_frontend_package-1.14.5
Successfully installed comfyui-frontend-package-1.14.6
-
This will try to update pytorch and all python dependencies.
-
If you just want to update normally, close this and run update_comfyui.bat instead.
-
続行するには何かキーを押してください . . .
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu126
Requirement already satisfied: torch in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (2.6.0+cu126)
Requirement already satisfied: torchvision in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (0.21.0+cu126)
Requirement already satisfied: torchaudio in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (2.6.0+cu126)
Requirement already satisfied: pygit2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (1.17.0)
Requirement already satisfied: comfyui-frontend-package==1.14.6 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 1)) (1.14.6)
Requirement already satisfied: torchsde in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 3)) (0.2.6)
Requirement already satisfied: numpy>=1.25.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 6)) (1.26.4)
Collecting numpy>=1.25.0 (from -r ../ComfyUI/requirements.txt (line 6))
  Using cached numpy-2.2.4-cp312-cp312-win_amd64.whl.metadata (60 kB)
Requirement already satisfied: einops in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 7)) (0.8.1)
Requirement already satisfied: transformers>=4.28.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 8)) (4.47.0)
Collecting transformers>=4.28.1 (from -r ../ComfyUI/requirements.txt (line 8))
  Downloading transformers-4.50.2-py3-none-any.whl.metadata (39 kB)
Requirement already satisfied: tokenizers>=0.13.3 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 9)) (0.21.1)
Requirement already satisfied: sentencepiece in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 10)) (0.2.0)
Requirement already satisfied: safetensors>=0.4.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 11)) (0.5.3)
Requirement already satisfied: aiohttp>=3.11.8 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 12)) (3.11.14)
Requirement already satisfied: yarl>=1.18.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 13)) (1.18.3)
Requirement already satisfied: pyyaml in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 14)) (6.0.2)
Requirement already satisfied: Pillow in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 15)) (11.1.0)
Requirement already satisfied: scipy in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 16)) (1.15.2)
Requirement already satisfied: tqdm in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 17)) (4.67.1)
Requirement already satisfied: psutil in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 18)) (7.0.0)
Requirement already satisfied: kornia>=0.7.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 21)) (0.8.0)
Requirement already satisfied: spandrel in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 22)) (0.4.1)
Requirement already satisfied: soundfile in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 23)) (0.13.1)
Requirement already satisfied: av in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from -r ../ComfyUI/requirements.txt (line 24)) (14.2.0)
Requirement already satisfied: filelock in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.17.0)
Requirement already satisfied: typing-extensions>=4.10.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (4.12.2)
Requirement already satisfied: networkx in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.4.2)
Requirement already satisfied: jinja2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (3.1.5)
Requirement already satisfied: fsspec in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (2024.12.0)
Requirement already satisfied: setuptools in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (75.8.2)
Requirement already satisfied: sympy==1.13.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torch) (1.13.1)        
Requirement already satisfied: mpmath<1.4,>=1.1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from sympy==1.13.1->torch) (1.3.0)
Requirement already satisfied: cffi>=1.17.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from pygit2) (1.17.1)        
Requirement already satisfied: trampoline>=0.1.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from torchsde->-r ../ComfyUI/requirements.txt (line 3)) (0.1.2)
Requirement already satisfied: huggingface-hub<1.0,>=0.26.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (0.28.0)
Requirement already satisfied: packaging>=20.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (24.2)
Requirement already satisfied: regex!=2019.12.17 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (2024.11.6)
Requirement already satisfied: requests in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (2.32.3)
Requirement already satisfied: aiohappyeyeballs>=2.3.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (2.4.4)
Requirement already satisfied: aiosignal>=1.1.2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (1.3.2)
Requirement already satisfied: attrs>=17.3.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (25.1.0)
Requirement already satisfied: frozenlist>=1.1.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (1.5.0)
Requirement already satisfied: multidict<7.0,>=4.5 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (6.1.0)
Requirement already satisfied: propcache>=0.2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from aiohttp>=3.11.8->-r ../ComfyUI/requirements.txt (line 12)) (0.2.1)
Requirement already satisfied: idna>=2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from yarl>=1.18.0->-r ../ComfyUI/requirements.txt (line 13)) (3.10)
Requirement already satisfied: colorama in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from tqdm->-r ../ComfyUI/requirements.txt (line 17)) (0.4.6)
Requirement already satisfied: kornia_rs>=0.1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from kornia>=0.7.1->-r ../ComfyUI/requirements.txt (line 21)) (0.1.8)
Requirement already satisfied: pycparser in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from cffi>=1.17.0->pygit2) (2.22)
Requirement already satisfied: MarkupSafe>=2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from jinja2->torch) (3.0.2)
Requirement already satisfied: charset-normalizer<4,>=2 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (3.4.1)
Requirement already satisfied: urllib3<3,>=1.21.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (1.26.20)
Requirement already satisfied: certifi>=2017.4.17 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from requests->transformers>=4.28.1->-r ../ComfyUI/requirements.txt (line 8)) (2024.12.14)
Using cached numpy-2.2.4-cp312-cp312-win_amd64.whl (12.6 MB)
Downloading transformers-4.50.2-py3-none-any.whl (10.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.2/10.2 MB 8.0 MB/s eta 0:00:00
Installing collected packages: numpy, transformers
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Uninstalling numpy-1.26.4:
      Successfully uninstalled numpy-1.26.4
  WARNING: The scripts f2py.exe and numpy-config.exe are installed in 'I:\tools\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: transformers
    Found existing installation: transformers 4.47.0
    Uninstalling transformers-4.47.0:
      Successfully uninstalled transformers-4.47.0
  WARNING: The script transformers-cli.exe is installed in 'I:\tools\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numba 0.61.0 requires numpy<2.2,>=1.24, but you have numpy 2.2.4 which is incompatible.
ultralytics 8.3.76 requires numpy<=2.1.1,>=1.23.0, but you have numpy 2.2.4 which is incompatible.
Successfully installed numpy-2.2.4 transformers-4.50.2
続行するには何かキーを押してください . . . 
PS I:\tools\ComfyUI_windows_portable\update>
Expand

依存関係の状態を確認(pip check)

mediapipe, numba, ultralytics の不整合を確認。原因は現在の numpy-v2.2.4 では要求されている条件を満たせないため。

それぞれが要求している NumPy のバージョン。

  • mediapipe: 2 未満
  • numba: 1.24 以上、2.2 未満
  • ultralytics: 1.23.0 以上、2.1.1以下
BAT (Batchfile)
PS I:\tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip check
mediapipe 0.10.21 has requirement numpy<2, but you have numpy 2.2.4.
numba 0.61.0 has requirement numpy<2.2,>=1.24, but you have numpy 2.2.4.
ultralytics 8.3.76 has requirement numpy<=2.1.1,>=1.23.0, but you have numpy 2.2.4.
PS I:\tools\ComfyUI_windows_portable\python_embeded> 
Expand

条件を満たせる NumPy を再インストール

各パッケージの要求バージョンを満たし、且つ、極力新しい NumPy をインストールするとなると、mediapipe の要求に合わせるのがよさそう。なので、これをアップグレードし依存関係の不整合を解消する。

結果、NumPy-v1.26.4 がインストールされた。このバージョンであれば numba, ultralytics の要求も満たせる。

BAT (Batchfile)
PS I:\tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip install -U mediapipe
Requirement already satisfied: mediapipe in c:\users\uc4696\appdata\roaming\python\python312\site-packages (0.10.21)
Requirement already satisfied: absl-py in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (2.1.0)
Requirement already satisfied: attrs>=19.1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from mediapipe) (25.1.0)
Requirement already satisfied: flatbuffers>=2.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from mediapipe) (25.2.10)
Requirement already satisfied: jax in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (0.5.0)
Requirement already satisfied: jaxlib in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (0.5.0)
Requirement already satisfied: matplotlib in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from mediapipe) (3.10.0)       
Collecting numpy<2 (from mediapipe)
  Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB)
Requirement already satisfied: opencv-contrib-python in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (4.11.0.86)
Requirement already satisfied: protobuf<5,>=4.25.3 in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (4.25.6)  
Requirement already satisfied: sounddevice>=0.4.4 in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from mediapipe) (0.5.1)    
Requirement already satisfied: sentencepiece in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from mediapipe) (0.2.0)     
Requirement already satisfied: CFFI>=1.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from sounddevice>=0.4.4->mediapipe) (1.17.1)
Requirement already satisfied: ml_dtypes>=0.4.0 in c:\users\uc4696\appdata\roaming\python\python312\site-packages (from jax->mediapipe) (0.5.1) 
Requirement already satisfied: opt_einsum in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from jax->mediapipe) (3.4.0)   
Requirement already satisfied: scipy>=1.11.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from jax->mediapipe) (1.15.2)
Requirement already satisfied: contourpy>=1.0.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (1.3.1)
Requirement already satisfied: cycler>=0.10 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (4.56.0)
Requirement already satisfied: kiwisolver>=1.3.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (1.4.8)
Requirement already satisfied: packaging>=20.0 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (24.2)
Requirement already satisfied: pillow>=8 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (11.1.0)
Requirement already satisfied: pyparsing>=2.3.1 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (3.2.1)
Requirement already satisfied: python-dateutil>=2.7 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from matplotlib->mediapipe) (2.9.0.post0)
Requirement already satisfied: pycparser in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from CFFI>=1.0->sounddevice>=0.4.4->mediapipe) (2.22)
Requirement already satisfied: six>=1.5 in i:\tools\comfyui_windows_portable\python_embeded\lib\site-packages (from python-dateutil>=2.7->matplotlib->mediapipe) (1.17.0)
Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 2.2.4
    Uninstalling numpy-2.2.4:
      Successfully uninstalled numpy-2.2.4
  WARNING: The script f2py.exe is installed in 'I:\tools\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.26.4
PS I:\tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip check
No broken requirements found.
PS I:\tools\ComfyUI_windows_portable\python_embeded> 
Expand

MeshGraphormer Hand Refiner ノード実行時の “MeshGraphormer-DepthMapPreprocessor No module named ‘mediapipe'” エラー

カスタムノード comfyui_controlnet_aux の MeshGraphormer Hand Refiner ノード実行時にエラー発生。

関連モジュールとバージョン

comfyui_controlnet_aux v1.0.7

エラーを解消できた方法

“–user” オプションを付け、手動で関連パッケージをインストール。原因などは以降で考察。

BAT (Batchfile)
rem カレントディレクトリを python_embeded に変更
cd x:\ComfyUI_windows_portable\python_embeded
rem --user オプションを付けて各種パッケージをインストール
.\python.exe -m pip install protobuf, opt_einsum, opencv-contrib-python, ml_dtypes, absl-py, sounddevice, jaxlib, jax, mediapipe --user

ComfyUIをアップデートするたび再発するため上記手順だけだと完全に対処療法。
原因は恐らく mediapipe が要求する numpy のバージョンが v2 未満なのに、ComfyUIのアップデートをしてしまうと v2 以上が適用されちゃうせい。なので v2 未満で固定できれば一旦解決しそうだが方法がよくわからない。そのへんは気が向いたら調べるかもしれない。(つか根本で言うなら mediapipe 側が対応すればいいように感じるが…どない?)

現象と再現

  1. comfyui_controlnet_aux インストール
  2. ComfyUI のアップデート
  3. 再起動後当該ノード実行でエラー発生

エラーメッセージが発生。

MeshGraphormer-DepthMapPreprocessor
No module named 'mediapipe'
MeshGraphormer-DepthMapPreprocessor_No module named mediapipe
MeshGraphormer-DepthMapPreprocessor_No module named mediapipe

原因の調査

エラーメッセージに ‘mediapipe’ モジュールが見つからないとあるのでそこから見ていく。

No module named ‘mediapipe’ の確認

mediapipe の状態を確認。
→ インストールはされている。

BAT (Batchfile)
PS D:\ai-tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip list | findstr mediapipe
mediapipe                 0.10.21
PS D:\ai-tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip check
No broken requirements found.
PS D:\ai-tools\ComfyUI_windows_portable\python_embeded>

ログの確認

ログを確認すると複数パッケージのインストールでコケている(99行~)。下記、赤マーカーの行で “–user” オプションをつけろとあるので権限絡みで失敗していると考えられる。

失敗したパッケージ群をオプション付きで手動インストールすれば解消された。が、ComfyUIのアップデートで再発。

 Installing collected packages: flatbuffers, protobuf, opt_einsum, opencv-contrib-python, ml_dtypes, absl-py, sounddevice, jaxlib, jax, mediapipe
[!] ERROR: Could not install packages due to an OSError: [WinError 5] アクセスが拒否されました。: 'D:\\ai-tools\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\cv2\\cv2.pyd'
Consider using the `--user` option or check the permissions.
BAT (Batchfile)
D:\ai-tools\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --port 8288
Adding extra search path checkpoints D:\ai-tools\stable-diffusion-webui\models\Stable-diffusion
Adding extra search path configs D:\ai-tools\stable-diffusion-webui\models\Stable-diffusion
Adding extra search path vae D:\ai-tools\stable-diffusion-webui\models\VAE
Adding extra search path loras D:\ai-tools\stable-diffusion-webui\models\Lora
Adding extra search path loras D:\ai-tools\stable-diffusion-webui\models\LyCORIS
Adding extra search path upscale_models D:\ai-tools\stable-diffusion-webui\models\ESRGAN
Adding extra search path upscale_models D:\ai-tools\stable-diffusion-webui\models\RealESRGAN
Adding extra search path upscale_models D:\ai-tools\stable-diffusion-webui\models\SwinIR
Adding extra search path embeddings D:\ai-tools\stable-diffusion-webui\embeddings
Adding extra search path hypernetworks D:\ai-tools\stable-diffusion-webui\models\hypernetworks
Adding extra search path controlnet D:\ai-tools\stable-diffusion-webui\models\ControlNet
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-03-27 00:29:17.712
** Platform: Windows
** Python version: 3.12.8 (tags/v3.12.8:2dc476b, Dec  3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)]
** Python executable: D:\ai-tools\ComfyUI_windows_portable\python_embeded\python.exe
** ComfyUI Path: D:\ai-tools\ComfyUI_windows_portable\ComfyUI
** ComfyUI Base Folder Path: D:\ai-tools\ComfyUI_windows_portable\ComfyUI
** User directory: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\user
** ComfyUI-Manager config path: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\user\default\ComfyUI-Manager\config.ini
** Log path: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\user\comfyui.log
  WARNING: The script f2py.exe is installed in 'D:\ai-tools\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jax 0.5.0 requires opt_einsum, which is not installed.
mediapipe 0.10.21 requires flatbuffers>=2.0, which is not installed.

Prestartup times for custom nodes:
   6.6 seconds: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Checkpoint files will always be loaded safely.
Total VRAM 8192 MB, total RAM 32603 MB
pytorch version: 2.6.0+cu126
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2060 SUPER : cudaMallocAsync
Using pytorch attention
ComfyUI version: 0.3.27
ComfyUI frontend version: 1.14.5
[Prompt Server] web root: D:\ai-tools\ComfyUI_windows_portable\python_embeded\Lib\site-packages\comfyui_frontend_package\static
### Loading: ComfyUI-Manager (V3.26)
[ComfyUI-Manager] network_mode: public
### ComfyUI Version: v0.3.27-5-g84fdaf7b | Released on '2025-03-26'
[comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\ai-tools\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']
[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/github-stats.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
D:\ai-tools\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")

Import times for custom nodes:
   0.0 seconds: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
   0.3 seconds: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
   1.4 seconds: D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux

Starting server

To see the GUI go to: http://127.0.0.1:8288
FETCH ComfyRegistry Data: 5/79
FETCH ComfyRegistry Data: 10/79
FETCH ComfyRegistry Data: 15/79
got prompt
 Collecting mediapipe
   Using cached mediapipe-0.10.21-cp312-cp312-win_amd64.whl.metadata (10 kB)
 Collecting absl-py (from mediapipe)
   Downloading absl_py-2.2.1-py3-none-any.whl.metadata (2.4 kB)
  Collecting flatbuffers>=2.0 (from mediapipe)
   Using cached flatbuffers-25.2.10-py2.py3-none-any.whl.metadata (875 bytes)
 Collecting jax (from mediapipe)
   Using cached jax-0.5.3-py3-none-any.whl.metadata (22 kB)
 Collecting jaxlib (from mediapipe)
   Using cached jaxlib-0.5.3-cp312-cp312-win_amd64.whl.metadata (1.2 kB)
   Collecting opencv-contrib-python (from mediapipe)
   Using cached opencv_contrib_python-4.11.0.86-cp37-abi3-win_amd64.whl.metadata (20 kB)
 Collecting protobuf<5,>=4.25.3 (from mediapipe)
   Using cached protobuf-4.25.6-cp310-abi3-win_amd64.whl.metadata (541 bytes)
 Collecting sounddevice>=0.4.4 (from mediapipe)
   Using cached sounddevice-0.5.1-py3-none-win_amd64.whl.metadata (1.4 kB)
   Collecting ml_dtypes>=0.4.0 (from jax->mediapipe)
   Using cached ml_dtypes-0.5.1-cp312-cp312-win_amd64.whl.metadata (22 kB)
 Collecting opt_einsum (from jax->mediapipe)
   Using cached opt_einsum-3.4.0-py3-none-any.whl.metadata (6.3 kB)
            Using cached mediapipe-0.10.21-cp312-cp312-win_amd64.whl (51.0 MB)
 Using cached flatbuffers-25.2.10-py2.py3-none-any.whl (30 kB)
 Using cached protobuf-4.25.6-cp310-abi3-win_amd64.whl (413 kB)
 Using cached sounddevice-0.5.1-py3-none-win_amd64.whl (363 kB)
 Downloading absl_py-2.2.1-py3-none-any.whl (277 kB)
 Using cached jax-0.5.3-py3-none-any.whl (2.4 MB)
 Using cached jaxlib-0.5.3-cp312-cp312-win_amd64.whl (65.8 MB)
 Using cached opencv_contrib_python-4.11.0.86-cp37-abi3-win_amd64.whl (46.2 MB)
 Using cached ml_dtypes-0.5.1-cp312-cp312-win_amd64.whl (210 kB)
 Using cached opt_einsum-3.4.0-py3-none-any.whl (71 kB)
 Installing collected packages: flatbuffers, protobuf, opt_einsum, opencv-contrib-python, ml_dtypes, absl-py, sounddevice, jaxlib, jax, mediapipe
[!] ERROR: Could not install packages due to an OSError: [WinError 5] アクセスが拒否されました。: 'D:\\ai-tools\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\cv2\\cv2.pyd'
[!] Consider using the `--user` option or check the permissions.
[!]
FETCH ComfyRegistry Data: 20/79
  Collecting protobuf
   Using cached protobuf-6.30.1-cp310-abi3-win_amd64.whl.metadata (593 bytes)
 Using cached protobuf-6.30.1-cp310-abi3-win_amd64.whl (431 kB)
 Installing collected packages: protobuf
   Attempting uninstall: protobuf
     Found existing installation: protobuf 4.25.6
     Uninstalling protobuf-4.25.6:
       Successfully uninstalled protobuf-4.25.6
 Successfully installed protobuf-6.30.1
!!! Exception during processing !!! No module named 'mediapipe'
Traceback (most recent call last):
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\execution.py", line 327, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\execution.py", line 202, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\execution.py", line 174, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\execution.py", line 163, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\mesh_graphormer.py", line 64, in execute
    from custom_controlnet_aux.mesh_graphormer import MeshGraphormerDetector
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_controlnet_aux\mesh_graphormer\__init__.py", line 5, in <module>
    from custom_controlnet_aux.mesh_graphormer.pipeline import MeshGraphormerMediapipe, args
  File "D:\ai-tools\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_controlnet_aux\mesh_graphormer\pipeline.py", line 23, in <module>
    import mediapipe as mp
ModuleNotFoundError: No module named 'mediapipe'

Prompt executed in 4.97 seconds
FETCH ComfyRegistry Data: 25/79
FETCH ComfyRegistry Data: 30/79
FETCH ComfyRegistry Data: 35/79
FETCH ComfyRegistry Data: 40/79
FETCH ComfyRegistry Data: 45/79
FETCH ComfyRegistry Data: 50/79
FETCH ComfyRegistry Data: 55/79
FETCH ComfyRegistry Data: 60/79
FETCH ComfyRegistry Data: 65/79
FETCH ComfyRegistry Data: 70/79
FETCH ComfyRegistry Data: 75/79
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.
Expand

ComfyUIのアップデートで更新されるパッケージ

もう少し深堀り。ComfyUIのアップデートで更新されるパッケージを調べてみる。

ComfuUIのアップデートをすると numpy が v2.2.4 になる。しかし mediapipe が要求する numpy のバージョンは v2 未満。この時点で “pip check” でパッケージの不整合が出力される。

mediapipe が見つからないエラーはこの辺が原因かと考えられる。

BAT (Batchfile)
PS D:\ai-tools\ComfyUI_windows_portable\python_embeded> .\python.exe -m pip check
mediapipe 0.10.21 has requirement numpy<2, but you have numpy 2.2.4.
PS D:\ai-tools\ComfyUI_windows_portable\python_embeded>
Expand

コメント

タイトルとURLをコピーしました