본문 바로가기
AI 인공지능

StabilityMatrix ComfyUI: Error occurred when executing InsightFaceLoader:No module named 'insightface.app'

by 젤리아드 2024. 3. 7.
반응형

Stability Matrix ComfyUI에서 ID ADAPTER 이미지 생성할 때 다음 에러 메시지 나오는 경우가 있습니다.

Error occurred when executing InsightFaceLoader:

No module named 'insightface.app'

File "execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "IPAdapterPlus.py", line 627, in load_insight_face raise Exception(e)
에러 메시지

에러메시지:

Error occurred when executing InsightFaceLoader:

 

No module named 'insightface.app'

 

File "execution.py", line 152, in recursive_execute

output_data, output_ui = get_output_data(obj, input_data_all)

File "execution.py", line 82, in get_output_data

return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)

File "execution.py", line 75, in map_node_over_list

results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))

File "IPAdapterPlus.py", line 627, in load_insight_face

raise Exception(e)

 

일단 Close 버튼을 눌러서 에러 메시지 창을 닫습니다.

ComfyUI 브라우저 탭을 닫고 Stability Matrix 프로그램을 종료합니다.

 

Stability Matrix 프로그램을 다시 실행합니다.

Stability Matrix 실행 후 ComfyUI 선택하고 Launch 버튼 클릭
ComfyUI 구동

ComfyUI가 선택돼 있는지 확인하고 Launch 버튼을 누릅니다.

 

** ComfyUI startup time:
** Platform: Windows
** Python version: 3.10.11
** Python executable
Python 버전과 경로

Python의 버전을 외워둡니다.(위 예시에서는 3.10)

버전 바로 아래 있는 Python executable이 중요합니다.

 

Python executable의 경로를 선택하여 복사하는 화면
경로 복사

Python executable 옆에 적혀 있는 경로를 복사합니다.

단, 경로 끝에 있는 python.exe는 복사하지 말고 순수 경로만 복사합니다.

(위 예시에서는 E:\StabilityMatrix\Data\Packages\ComfyUI\venv\Scripts\ 문자열 복사)

 

파일 탐색기 경로 칸에 Python executable 경로를 붙여넣기한 화면
파일 탐색기에 경로 붙여넣기

복사한 경로 문자열을 파일 탐색기 메뉴 아래 경로 칸에 붙여 넣고 엔터키를 누릅니다.

 

Python executable 폴더로 이동된 파일 탐색기
Python executable 폴더

붙여 넣은 경로로 잘 이동됐는지 확인합니다.

 

insightface-X.X.X-cpXXX-cpXXX-win_amd64.whl 파일
insightface 설치 파일

insightface-X.X.X-cpXXX-cpXXX-win_amd64.whl 파일을 구해서 python executable 폴더에 복사합니다.

 

insightface whl 파일이 없다면 아래 링크된 github 주소에서 다운로드할 수 있습니다.

본인 python 버전에 맞는 파일을 다운로드해야 합니다.

python 버전 3.10일 경우 cp310

3.11일 경우 cp311

3.12일 경우 cp312

https://github.com/Gourieff/Assets/tree/main/Insightface

 

이 글에서는 python 버전 3.10으로 테스트했기 때문에 cp310이라고 적힌 파일을 적용했습니다.

 

Python executable 폴더에 복사된 insightface-X.X.X-cpXXX-cpXXX-win_amd64.whl 파일
복사 완료

이런 식으로 insightface whl 파일을 python executable 폴더에 복사해서 넣으면 됩니다.

 

Python executable 폴더에서 cmd 실행
cmd 실행

파일 복사 완료 후 python executable 폴더에서 cmd를 실행합니다.

(파일 탐색기 메뉴 아래 경로 칸에 cmd 치고 엔터)

 

Python executable 폴더에서 cmd가 실행된 화면
cmd 창

cmd를 실행하면 경로가 나오는데 처음에 확인했던 python executable 경로와 일치하는지 확인합니다.

 

cmd에서 python -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl
명령어를 입력한 화면
insightface 설치 명령어

마지막으로 다음 명령어를 실행합니다.

 

* python 버전 3.10일 경우 위 화면 예시와 똑같이 하면 됩니다.

python -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl

 

* python 버전 3.11일 경우

python -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl

 

insightface-... 이 부분은 whl의 파일 이름을 그대로 쓰면 됩니다.

위 예시는 insightface 0.7.3 버전, python 3.10 버전 기준입니다.

 

질문 같은 것이 나오면 Y를 눌러 설치를 진행하면 됩니다.

설치 완료 후 ComfyUI를 실행하고 이미지를 다시 생성해 봅니다.

insightface가 제대로 설치됐다면 더 이상 에러 메시지가 표시되지 않을 것입니다.

반응형

댓글