よくあるエラー(ComfyUI)


CV2エラー例

AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'
Cannot import /Users/lucasadrian/ComfyUI/custom_nodes/comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text'The nodes consequently don't show up in Comfy.

(解決方法)
原因は cv2 依存関係の競合です。以下コマンドを実行して修正できます。
Confy ポータブルを使用している場合は、システムの Python ではなく独自の Python を使用する必要があることに注意してください。
opencvのバージョン違いでもこのエラーが出ます。

pip uninstall -y opencv-python opencv-contrib-python opencv-python-headless 
pip install opencv-python==4.7.0.72

insightfaceエラー例

File "C:\compyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\reactor_utils.py", line 8, in <module>
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface'

(解決方法)
github(https://github.com/Gourieff/comfyui-reactor-node#installation
トラブルシューティング
1.(Windows ユーザーの場合) 何らかの理由でまだ Insightface をビルドできない場合、または Visual Studio または VS C++ Build Tools をインストールしたくない場合は、次の手順を実行します。
を参照ください。

メモリ不足(PyTorch)

Error occurred when executing KSampler:
Allocation on device 0 would exceed allowed memory. (out of memory)
Currently allocated : 5.05 GiB
Requested : 5.02 GiB
Device limit : 11.99 GiB
Free (according to CUDA): 0 bytes
PyTorch limit (set by user-supplied memory fraction)
: 17179869184.00 GiB

(解決方法)使用しているGPUによって異なりますが・・・
このエラーメッセージでは、PyTorchを使用しているときにデバイスメモリの制限を超えようとしていることを示しています。
具体的には、デバイス0(GPU)に対して5.02 GiBのメモリが要求されているが、デバイスメモリの制限が11.99 GiBであり、すでに5.05 GiBが割り当てられている状態です。
また、入力(参照)サイズが大きい場合に同様のエラーが出ることも。
解決方法① もう一度、Queue Prompt を押すとエラー出ずに進むことも。
解決方法② 入力画像(映像)のサイズを小さくする
      Upscaleを使用している場合は、バイパスする
解決方法③ torch.cuda.empty_cache でクリアする


この記事が気に入ったらサポートをしてみませんか?