Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error/Bug]: Couldn't install sd-webui-controlnet requirement: insightface. #2698

Closed
1 task done
CrinstalMaiden opened this issue Mar 20, 2024 · 7 comments
Closed
1 task done

Comments

@CrinstalMaiden
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

I'm currently using directml v1.7.0 of Stable Diffusion (1.8 doesn't work for my AMD RX480). I tried to install sd-webui-controlnet via extension tab in the WebUI, but everytime I did that I got error message regarding the installation of insightface. I did write a similar request in the discussion section but noone answered.

Steps to reproduce the problem

  1. Go to Extension Tab, look for sd-webui-controlnet
  2. Press Install
  3. Apply and restart UI

What should have happened?

The error appears in the CMD log, controlnet is still usable but without insightface (which is kinda important for me)

Commit where the problem happens

webui: 601f7e3704707d09ca88241e663a763a2493b11a
controlnet: v1.1.441

What browsers do you use to access the UI ?

No response

Command Line Arguments

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set PYTORCH_CUDA_ALLOC_CONF= garbage_collection_threshold:0.9, max_split_size_mb:512
set COMMANDLINE_ARGS= --use-directml --medvram --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 --autolaunch --disable-nan-check --upcast-sampling 

call webui.bat

List of enabled extensions

None, only sd-webui-controlnet

Console logs

Installing sd-webui-controlnet requirement: fvcore
Installing sd-webui-controlnet requirement: mediapipe
Installing sd-webui-controlnet requirement: svglib
Installing sd-webui-controlnet requirement: insightface
Couldn't install sd-webui-controlnet requirement: insightface.
Command: "E:\Stable Diffusion\stable-diffusion-webui-directml\venv\Scripts\python.exe" -m pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl --prefer-binary
Error code: 1
stdout: Collecting insightface==0.7.3
Using cached https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl (841 kB)
Collecting cython
Using cached Cython-3.0.9-cp310-cp310-win_amd64.whl (2.8 MB)
Collecting albumentations
Using cached albumentations-1.4.2-py3-none-any.whl (133 kB)
Requirement already satisfied: requests in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (2.31.0)
Requirement already satisfied: onnx in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (1.15.0)
Requirement already satisfied: Pillow in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (9.5.0)
Requirement already satisfied: scipy in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (1.12.0)
Requirement already satisfied: matplotlib in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (3.8.3)
Requirement already satisfied: tqdm in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (4.66.2)
Requirement already satisfied: numpy in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (1.23.5)
Requirement already satisfied: scikit-image in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from insightface==0.7.3) (0.21.0)
Collecting scikit-learn
Using cached scikit_learn-1.4.1.post1-cp310-cp310-win_amd64.whl (10.6 MB)
Collecting prettytable
Using cached prettytable-3.10.0-py3-none-any.whl (28 kB)
Collecting easydict
Using cached easydict-1.13-py3-none-any.whl (6.8 kB)
Collecting numpy
Using cached numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
Requirement already satisfied: typing-extensions>=4.9.0 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from albumentations->insightface==0.7.3) (4.10.0)
Requirement already satisfied: PyYAML in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from albumentations->insightface==0.7.3) (6.0.1)
Collecting opencv-python-headless>=4.9.0
Using cached opencv_python_headless-4.9.0.80-cp37-abi3-win_amd64.whl (38.5 MB)
Requirement already satisfied: imageio>=2.27 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2.34.0)
Requirement already satisfied: tifffile>=2022.8.12 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2024.2.12)
Requirement already satisfied: packaging>=21 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (24.0)
Requirement already satisfied: PyWavelets>=1.1.1 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (1.5.0)
Requirement already satisfied: networkx>=2.8 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (3.2.1)
Requirement already satisfied: lazy_loader>=0.2 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (0.3)
Collecting joblib>=1.2.0
Using cached joblib-1.3.2-py3-none-any.whl (302 kB)
Collecting threadpoolctl>=2.0.0
Using cached threadpoolctl-3.3.0-py3-none-any.whl (17 kB)
Requirement already satisfied: fonttools>=4.22.0 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (4.50.0)
Requirement already satisfied: pyparsing>=2.3.1 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (3.1.2)
Requirement already satisfied: cycler>=0.10 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (0.12.1)
Requirement already satisfied: contourpy>=1.0.1 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.2.0)
Requirement already satisfied: kiwisolver>=1.3.1 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.4.5)
Requirement already satisfied: python-dateutil>=2.7 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (2.9.0.post0)
Requirement already satisfied: protobuf>=3.20.2 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from onnx->insightface==0.7.3) (3.20.3)
Requirement already satisfied: wcwidth in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from prettytable->insightface==0.7.3) (0.2.13)
Requirement already satisfied: idna<4,>=2.5 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from requests->insightface==0.7.3) (3.6)
Requirement already satisfied: certifi>=2017.4.17 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from requests->insightface==0.7.3) (2024.2.2)
Requirement already satisfied: charset-normalizer<4,>=2 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from requests->insightface==0.7.3) (3.3.2)
Requirement already satisfied: urllib3<3,>=1.21.1 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from requests->insightface==0.7.3) (2.2.1)
Requirement already satisfied: colorama in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from tqdm->insightface==0.7.3) (0.4.6)
Requirement already satisfied: six>=1.5 in e:\stable diffusion\stable-diffusion-webui-directml\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->insightface==0.7.3) (1.16.0)
Installing collected packages: easydict, threadpoolctl, prettytable, numpy, joblib, cython, opencv-python-headless, scikit-learn, albumentations, insightface
Attempting uninstall: numpy
Found existing installation: numpy 1.23.5
Uninstalling numpy-1.23.5:
Successfully uninstalled numpy-1.23.5

stderr: ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'E:\Stable Diffusion\stable-diffusion-webui-directml\venv\Lib\site-packages\~umpy\.libs\libopenblas.FB5AE2TYXYH2IJRDKGDGQ3XBKLKTF43H.gfortran-win_amd64.dll'
Check the permissions.

[notice] A new release of pip available: 22.2.1 -> 24.0
[notice] To update, run: E:\Stable Diffusion\stable-diffusion-webui-directml\venv\Scripts\python.exe -m pip install --upgrade pip

ControlNet init warning: Unable to install insightface automatically.
Installing sd-webui-controlnet requirement: handrefinerportable
Installing sd-webui-controlnet requirement: depth_anything

Additional information

I tried several attempts including set PERMISSION to FULL CONTROL, run CMD as Admin and git clone ControlNet manually by CMD to the extension folder. None of them work, The insightface can't install and can't install automatically as well.

Please help me since I have zero knowledge on coding stuff and I really need SD at the moment.

Many thanks,

@aearone
Copy link

aearone commented Mar 29, 2024

First do a clean installation of SD webui or remove the controlnet extension in the extensions folder and delete the venv folder, then run webui-user.bat, wait for the venv folder to be installed and restored then close webui.

Then enter these commands one by one:

Go to the folder with your SD webui, click on the path line and type "cmd" and press enter

Screenshot_324

The command line will open and you will see that the path to the SD folder is open.
Now you need to enter these commands one by one, patiently waiting for all operations to complete (commands are marked in bold text):

F:\stable-diffusion-webui>venv\scripts\activate.bat

(venv) F:\stable-diffusion-webui>pip install mediapipe

(venv) F:\stable-diffusion-webui>pip install svglib

(venv) F:\stable-diffusion-webui>pip install fvcore

(venv) F:\stable-diffusion-webui>pip install "opencv-python>=4.8.0"

(venv) F:\stable-diffusion-webui>pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl --prefer-binary

(venv) F:\stable-diffusion-webui>deactivate

Wait for the installation to complete. Run webui-user.bat and install/reinstall the controlnet extension. Error messages should no longer appear and controlnet will install normally. If there are any errors, you can ignore them, everything should work fine. Special thanks to @Vadim2S

#1439 #1024 #2297 #1258 #2007 #1636

@huchenlei
Copy link
Collaborator

First do a clean installation of SD webui or remove the controlnet extension in the extensions folder and delete the venv folder, then run webui-user.bat, wait for the venv folder to be installed and restored then close webui.

Then enter these commands one by one:

Go to the folder with your SD webui, click on the path line and type "cmd" and press enter

Screenshot_324

The command line will open and you will see that the path to the SD folder is open. Now you need to enter these commands one by one, patiently waiting for all operations to complete (commands are marked in bold text):

F:\stable-diffusion-webui>venv\scripts\activate.bat

(venv) F:\stable-diffusion-webui>pip install mediapipe

(venv) F:\stable-diffusion-webui>pip install svglib

(venv) F:\stable-diffusion-webui>pip install fvcore

(venv) F:\stable-diffusion-webui>pip install "opencv-python>=4.8.0"

(venv) F:\stable-diffusion-webui>pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl --prefer-binary

(venv) F:\stable-diffusion-webui>deactivate

Wait for the installation to complete. Run webui-user.bat and install/reinstall the controlnet extension. Error messages should no longer appear and controlnet will install normally. If there are any errors, you can ignore them, everything should work fine. Special thanks to @Vadim2S

#1439 #1024 #2297 #1258 #2007 #1636

I think this is a very detailed guide to resolve insightface installation problem. I will make it a wiki page.

@aearone
Copy link

aearone commented Mar 30, 2024

First do a clean installation of SD webui or remove the controlnet extension in the extensions folder and delete the venv folder, then run webui-user.bat, wait for the venv folder to be installed and restored then close webui.
Then enter these commands one by one:
Go to the folder with your SD webui, click on the path line and type "cmd" and press enter
Screenshot_324
The command line will open and you will see that the path to the SD folder is open. Now you need to enter these commands one by one, patiently waiting for all operations to complete (commands are marked in bold text):
F:\stable-diffusion-webui>venv\scripts\activate.bat
(venv) F:\stable-diffusion-webui>pip install mediapipe
(venv) F:\stable-diffusion-webui>pip install svglib
(venv) F:\stable-diffusion-webui>pip install fvcore
(venv) F:\stable-diffusion-webui>pip install "opencv-python>=4.8.0"
(venv) F:\stable-diffusion-webui>pip install https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl --prefer-binary
(venv) F:\stable-diffusion-webui>deactivate
Wait for the installation to complete. Run webui-user.bat and install/reinstall the controlnet extension. Error messages should no longer appear and controlnet will install normally. If there are any errors, you can ignore them, everything should work fine. Special thanks to @Vadim2S
#1439 #1024 #2297 #1258 #2007 #1636

I think this is a very detailed guide to resolve insightface installation problem. I will make it a wiki page.

Thank you! I have spent a lot of time searching for a solution to these errors. I will be very happy if this helps people, because I see that issues topics with this problem are opened every week for more than a year.

@roelfrenkema
Copy link

ERROR: insightface-0.7.3-cp310-cp310-win_amd64.whl is not a supported wheel on this platform
Windows only? I am on a real OS Debian Linux.

@paulhaskett
Copy link

how do you do this in ubuntu 24.04?

@sgri
Copy link

sgri commented Aug 18, 2024

I have installed insightface manually on SD's venv this way

(venv) stable-diffusion-webui>pip install mediapipe
(venv) stable-diffusion-webui>pip install svglib
(venv) stable-diffusion-webui>pip install fvcore
(venv) stable-diffusion-webui>pip install "opencv-python>=4.8.0"
(venv) stable-diffusion-webui>pip install --prefer-binary insightface==0.7.3

It has completed normally and produced a warning about conflicting versions of fastapi and pydantic. Then I installed the ControlNet extension, it didn't complain about missing insightface anymore.

Successfully built insightface
Installing collected packages: easydict, tomli, threadpoolctl, pydantic-core, prettytable, opencv-python-headless, onnx, joblib, eval-type-backport, cython, annotated-types, scikit-learn, pydantic, albucore, albumentations, insightface
  Attempting uninstall: pydantic
    **Found existing installation: pydantic 1.10.17
    Uninstalling pydantic-1.10.17:
      Successfully uninstalled pydantic-1.10.17**
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.
fastapi 0.94.0 requires pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2, but you have pydantic 2.8.2 which is incompatible.

Hope that conflicting fastapi and pydantic will not affect me.

@aearone
Copy link

aearone commented Aug 18, 2024

I have installed insightface manually on SD's venv this way

(venv) stable-diffusion-webui>pip install mediapipe
(venv) stable-diffusion-webui>pip install svglib
(venv) stable-diffusion-webui>pip install fvcore
(venv) stable-diffusion-webui>pip install "opencv-python>=4.8.0"
(venv) stable-diffusion-webui>pip install --prefer-binary insightface==0.7.3

It has completed normally and produced a warning about conflicting versions of fastapi and pydantic. Then I installed the ControlNet extension, it didn't complain about missing insightface anymore.

Successfully built insightface
Installing collected packages: easydict, tomli, threadpoolctl, pydantic-core, prettytable, opencv-python-headless, onnx, joblib, eval-type-backport, cython, annotated-types, scikit-learn, pydantic, albucore, albumentations, insightface
  Attempting uninstall: pydantic
    **Found existing installation: pydantic 1.10.17
    Uninstalling pydantic-1.10.17:
      Successfully uninstalled pydantic-1.10.17**
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.
fastapi 0.94.0 requires pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2, but you have pydantic 2.8.2 which is incompatible.

Hope that conflicting fastapi and pydantic will not affect me.

Не звертайте увагу, за ідеєю, все має працювати. Але можливо, що після останніх оновлень webui щось і змінилося.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants