s0md3v / sd-webui-roop

roop extension for StableDiffusion web-ui
GNU Affero General Public License v3.0
3.38k stars 859 forks source link

Insightface not found but already installed. #222

Open dnihil opened 1 year ago

dnihil commented 1 year ago

Getting this error, but insightface is already installed

2023-08-23 00:01:37,042 - roop - INFO - roop v0.0.2 *** Error loading script: swapper.py Traceback (most recent call last): File "E:\stable-diffusion-webui\modules\scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "E:\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "E:\stable-diffusion-webui\extensions\sd-webui-roop\scripts\swapper.py", line 12, in import insightface ModuleNotFoundError: No module named 'insightface'

dnihil commented 1 year ago

Seeing this earlier on in the load.

Error running install.py for extension E:\stable-diffusion-webui\extensions\sd-webui-roop. Command: "E:\stable-diffusion-webui\venv\Scripts\python.exe" "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py" Error code: 1 stderr: Traceback (most recent call last): File "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 25, in download(model_url, model_path) File "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 16, in download request = urllib.request.urlopen(url) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 525, in open response = meth(req, response) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 634, in http_response response = self.parent.error( File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 563, in error return self._call_chain(*args) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 496, in _call_chain result = func(*args) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) *** urllib.error.HTTPError: HTTP Error 401: Unauthorized

lucianoambrosini commented 1 year ago

same here :(

Error running install.py for extension D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop. Command: "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\venv\Scripts\python.exe" "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\install.py" Error code: 1 stderr: Traceback (most recent call last): File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 25, in download(model_url, model_path) File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 16, in download request = urllib.request.urlopen(url) File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open response = meth(req, response) File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response response = self.parent.error( File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error return self._call_chain(*args) File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain result = func(*args) File "C:\Users\lucia\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) *** urllib.error.HTTPError: HTTP Error 401: Unauthorized

Launching Web UI with arguments: --api --lowvram --xformers --autolaunch --theme dark --precision full --no-half 2023-08-23 15:35:43,224 - ControlNet - INFO - ControlNet v1.1.306 ControlNet preprocessor location: D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads 2023-08-23 15:35:43,378 - ControlNet - INFO - ControlNet v1.1.306 *** Error loading script: api.py Traceback (most recent call last): File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\api.py", line 17, in from scripts.faceswap import get_models File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 16, in from scripts.swapper import UpscaleOptions, swap_face, ImageResult File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\swapper.py", line 13, in import onnxruntime ModuleNotFoundError: No module named 'onnxruntime'


*** Error loading script: cimage.py Traceback (most recent call last): File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\cimage.py", line 2, in from ifnude import detect ModuleNotFoundError: No module named 'ifnude'


*** Error loading script: faceswap.py Traceback (most recent call last): File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 16, in from scripts.swapper import UpscaleOptions, swap_face, ImageResult File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\swapper.py", line 13, in import onnxruntime ModuleNotFoundError: No module named 'onnxruntime'


2023-08-23 15:35:43,408 - roop - INFO - roop v0.0.2 *** Error loading script: swapper.py Traceback (most recent call last): File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\Desktop\SDlocalCNv11\stable-diffusion-webui\extensions\sd-webui-roop\scripts\swapper.py", line 13, in import onnxruntime ModuleNotFoundError: No module named 'onnxruntime'

Chettawan commented 1 year ago

Got same error on Automatic1111 start up. Visual studio and insightface extension install seem fine no error

Error running install.py for extension C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop. Command: "C:\Stable-Diffusion\stable-diffusion-webui\venv\Scripts\python.exe" "C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop\install.py" Error code: 1 stderr: Traceback (most recent call last): File "C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 25, in download(model_url, model_path) File "C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 16, in download request = urllib.request.urlopen(url) File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open response = meth(req, response) File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response response = self.parent.error( File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error return self._call_chain(*args) File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain result = func(*args) File "C:\Users\chett\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) *** urllib.error.HTTPError: HTTP Error 401: Unauthorized


Trying to verify if required extension are install and correct on version

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show insightface Name: insightface Version: 0.7.3 Summary: InsightFace Python Library Home-page: https://github.com/deepinsight/insightface Author: InsightFace Contributors Author-email: contact@insightface.ai License: MIT Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: albumentations, cython, easydict, matplotlib, numpy, onnx, Pillow, prettytable, requests, scikit-image, scikit-learn, scipy, tqdm Required-by:

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show onnx Name: onnx Version: 1.14.0 Summary: Open Neural Network Exchange Home-page: https://github.com/onnx/onnx Author: ONNX Author-email: onnx-technical-discuss@lists.lfaidata.foundation License: Apache License v2.0 Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: numpy, protobuf, typing-extensions Required-by: insightface

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show onnxruntime Name: onnxruntime Version: 1.15.1 Summary: ONNX Runtime is a runtime accelerator for Machine Learning models Home-page: https://onnxruntime.ai Author: Microsoft Corporation Author-email: onnxruntime@microsoft.com License: MIT License Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: coloredlogs, flatbuffers, numpy, packaging, protobuf, sympy Required-by: ifnude

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pop show opencv-python 'pop' is not recognized as an internal or external command, operable program or batch file.

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show opencv-python Name: opencv-python Version: 4.7.0.72 Summary: Wrapper package for OpenCV python bindings. Home-page: https://github.com/opencv/opencv-python Author: Author-email: License: Apache 2.0 Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: numpy, numpy, numpy, numpy Required-by:

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show ifnude Name: ifnude Version: 0.0.3 Summary: An AI powered nudity detection library Home-page: https://github.com/s0md3v/ifnude Author: Somdev Sangwan Author-email: s0md3v@gmail.com License: GPLv3 Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: onnxruntime, opencv-python-headless, pillow, scikit-image, tqdm Required-by:

C:\Stable-Diffusion\stable-diffusion-webui\extensions\sd-webui-roop>pip show cython Name: Cython Version: 3.0.0 Summary: The Cython compiler for writing C extensions in the Python language. Home-page: https://cython.org/ Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al. Author-email: cython-devel@python.org License: Apache-2.0 Location: c:\users\chett\appdata\local\programs\python\python310\lib\site-packages Requires: Required-by: insightface

Chettawan commented 1 year ago

I think there something wrong about hugging face model. It said the access to this resource is disabled.

Ok I've managed to fix it. You need to manually download inswapper_128.onx from this URL https://drive.google.com/file/d/1krOLgjW2tAPaqV-Bw4YALz0xT5zlb5HF/view

and put it to Stable-Diffusion folder\stable-diffusion-webui\models\roop

Then just start Stable Diffusion again.

The error gone Checking roop requirements Install insightface==0.7.3 Installing sd-webui-roop requirement: insightface==0.7.3 Install onnx==1.14.0 Installing sd-webui-roop requirement: onnx==1.14.0 Install onnxruntime==1.15.0 Installing sd-webui-roop requirement: onnxruntime==1.15.0 Install opencv-python==4.7.0.72 Installing sd-webui-roop requirement: opencv-python==4.7.0.72 Install ifnude Installing sd-webui-roop requirement: ifnude

alieverlove commented 1 year ago

@Chettawan Thanks Brother. its works.

SgtXQsME commented 1 year ago

@Chettawan hey bro! I downloaded the file. error still not resolved. help me

Chettawan commented 1 year ago

@Chettawan hey bro! I downloaded the file. error still not resolved. help me

Can you post the error message in Automatic1111 startup command window. May be it's not the same case.

SgtXQsME commented 1 year ago

image image image image these are the errors I'm facing right now

Nayrobie commented 1 year ago

@Chettawan Your solution worked for me! Thanks a lot :)

WaseekSenju commented 1 year ago

I think there something wrong about hugging face model. It said the access to this resource is disabled.

Ok I've managed to fix it. You need to manually download inswapper_128.onx from this URL https://drive.google.com/file/d/1krOLgjW2tAPaqV-Bw4YALz0xT5zlb5HF/view

and put it to Stable-Diffusion folder\stable-diffusion-webui\models\roop

Then just start Stable Diffusion again.

The error gone Checking roop requirements Install insightface==0.7.3 Installing sd-webui-roop requirement: insightface==0.7.3 Install onnx==1.14.0 Installing sd-webui-roop requirement: onnx==1.14.0 Install onnxruntime==1.15.0 Installing sd-webui-roop requirement: onnxruntime==1.15.0 Install opencv-python==4.7.0.72 Installing sd-webui-roop requirement: opencv-python==4.7.0.72 Install ifnude Installing sd-webui-roop requirement: ifnude

Thank you so much it worked!

hungle-i3 commented 1 year ago

Seeing this earlier on in the load.

Error running install.py for extension E:\stable-diffusion-webui\extensions\sd-webui-roop. Command: "E:\stable-diffusion-webui\venv\Scripts\python.exe" "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py" Error code: 1 stderr: Traceback (most recent call last): File "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 25, in download(model_url, model_path) File "E:\stable-diffusion-webui\extensions\sd-webui-roop\install.py", line 16, in download request = urllib.request.urlopen(url) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 216, in urlopen return opener.open(url, data, timeout) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 525, in open response = meth(req, response) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 634, in http_response response = self.parent.error( File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 563, in error return self._call_chain(*args) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 496, in _call_chain result = func(*args) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) *** urllib.error.HTTPError: HTTP Error 401: Unauthorized

The model url from huggingface was closed to be accessed from public so download command got HTTP 401 (Unauthorized).

There are 2 ways to resolve the problem.

  1. Login huggingface to download and install manually
  2. Modify install.py script \stable-diffusion-webui\extensions\sd-webui-roop\install.py to download an alternative.

    model_url = "https://huggingface.co/deepinsight/inswapper/resolve/main/inswapper_128.onnx"

    model_url = "https://github.com/facefusion/facefusion-assets/releases/download/models/inswapper_128_fp16.onnx"

alaowu commented 5 months ago

@SgtXQsME hi Have you solved this problem? And how was it resolved? I have the same problem

C:\Users\Administrator>pip show insightface Name: insightface Version: 0.7.3 Summary: InsightFace Python Library Home-page: https://github.com/deepinsight/insightface Author: InsightFace Contributors Author-email: contact@insightface.ai License: MIT Location: C:\Python312\Lib\site-packages Requires: albumentations, cython, easydict, matplotlib, numpy, onnx, Pillow, prettytable, requests, scikit-image, scikit-learn, scipy, tqdm Required-by:

*** Error loading script: api.py Traceback (most recent call last): File "E:\StableDiffusion\modules\scripts.py", line 382, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "E:\StableDiffusion\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "E:\StableDiffusion\extensions\sd-webui-roop\scripts\api.py", line 17, in from scripts.faceswap import get_models File "E:\StableDiffusion\extensions\sd-webui-roop\scripts\faceswap.py", line 16, in from scripts.swapper import UpscaleOptions, swap_face, ImageResult File "E:\StableDiffusion\extensions\sd-webui-roop\scripts\swapper.py", line 12, in import insightface ModuleNotFoundError: No module named 'insightface'


SgtXQsME commented 5 months ago

@alaowu Hello brother! Yeah I solved this issue.First of all you unintall the all python versions and reinstall the python 3.10 version. After that delete old copies of your stable diffusion and try to reinstall the Stable diffusion as a new copy. This method solved my problem.

alaowu commented 5 months ago

@SgtXQsME Thank you very much!I solved this problem.