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

[SOLVED] StabilityMatrix | Error running install.py for extension #129

Closed
3 tasks done
Fire1982Photo opened this issue Oct 16, 2023 · 40 comments
Closed
3 tasks done

Comments

@Fire1982Photo
Copy link

Fire1982Photo commented Oct 16, 2023

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

What happened?

hello, I tried the reactor extension and I have console errors and the extension does not work.
I uninstalled and reinstalled the components and VisualStudio, but nothing happened?

Steps to reproduce the problem

Install the WebUI a1111
Install the reactor extension.

Sysinfo

A1111 WebUI

Relevant console log

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.6.0
Commit hash: <none>
D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
*** Error running install.py for extension D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor.
Launching Web UI with arguments: --xformers --api --skip-python-version-check
*** Command: "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\Scripts\python.exe" "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\install.py"
*** Error code: 1
*** stderr: D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\install.py:3: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
***   import pkg_resources
*** Traceback (most recent call last):
***   File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\install.py", line 21, in <module>
***     os.rename(models_dir_old, models_dir)
*** FileExistsError: [WinError 183] Impossible de crer un fichier dj existant: 'D:\\StabilityMatrix-win-x64\\StabilityMatrix-win-x64\\Data\\Packages\\stable-diffusion-webui\\models\\roop' -> 'D:\\StabilityMatrix-win-x64\\StabilityMatrix-win-x64\\Data\\Packages\\stable-diffusion-webui\\models\\insightface'
2023-10-16 18:08:05,667 - ControlNet - INFO - ControlNet v1.1.411
ControlNet preprocessor location: D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-10-16 18:08:05,819 - ControlNet - INFO - ControlNet v1.1.411
*** Error loading script: console_log_patch.py
    Traceback (most recent call last):
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 4, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---
*** Error loading script: reactor_api.py
    Traceback (most recent call last):
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_api.py", line 17, in <module>
        from scripts.reactor_swapper import EnhancementOptions, swap_face
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
18:08:05 - ReActor -         import insightface
    ModuleNotFoundError: No module named 'insightface'
STATUS
---
 - Running v0.4.2
*** Error loading script: reactor_faceswap.py
    Traceback (most recent call last):
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 26, in <module>
        from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, reset_messaged
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---
*** Error loading script: reactor_swapper.py
    Traceback (most recent call last):
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---
Loading weights [84d76a0328] from D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\models\Stable-diffusion\epicrealism_naturalSinRC1VAE.safetensors
Running on local URL:  http://127.0.0.1:7860
Creating model from config: D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\configs\v1-inference.yaml

To create a public link, set `share=True` in `launch()`.
Startup time: 7.2s (prepare environment: 5.1s, other imports: 0.4s, load scripts: 0.8s, create ui: 0.3s, gradio launch: 0.3s).
Applying attention optimization: xformers... done.
Model loaded in 2.9s (load weights from disk: 0.4s, create model: 0.3s, apply weights to model: 0.9s, load textual inversion embeddings: 0.7s, calculate empty prompt: 0.6s).

Additional information

Sorry for my bad english, I speak French :)

I try again to delete all and try again

@Fire1982Photo Fire1982Photo added bug Something isn't working new labels Oct 16, 2023
@Bunktavious
Copy link

I'm getting similar:
venv "C:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Traceback (most recent call last):
File "C:\stable-diffusion-webui\modules\launch_utils.py", line 231, in run_extension_installer
stdout = run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env).strip()
File "C:\stable-diffusion-webui\modules\launch_utils.py", line 115, in run
raise RuntimeError("\n".join(error_bits))
RuntimeError: Error running install.py for extension C:\stable-diffusion-webui\extensions\sd-webui-reactor.
Command: "C:\stable-diffusion-webui\venv\Scripts\python.exe" "C:\stable-diffusion-webui\extensions\sd-webui-reactor\install.py"
Error code: 1
stderr: Traceback (most recent call last):
File "C:\stable-diffusion-webui\extensions\sd-webui-reactor\install.py", line 21, in
os.rename(models_dir_old, models_dir)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\stable-diffusion-webui\models\roop' -> 'C:\stable-diffusion-webui\models\insightface'

@Bunktavious
Copy link

I seem to have fixed it by renaming my insightface folder in Models first.

@noembryo
Copy link

I seem to have fixed it by renaming my insightface folder in Models first.

You renamed it to what?

Gourieff added a commit that referenced this issue Oct 16, 2023
@Gourieff
Copy link
Owner

"FileExistsError" is fixed 55a6c53
Should work now

@Gourieff Gourieff removed the new label Oct 16, 2023
@noembryo
Copy link

But the OP error (as also mine) is not a FileExistsError but a ModuleNotFoundError: No module named 'insightface'..

@Fire1982Photo
Copy link
Author

"FileExistsError" is fixed 55a6c53 Should work now

I will try tomorrow.
Thanks

@noembryo
Copy link

Now the error is a little different:

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.6.0
Commit hash: <none>
Installing requirements for Mov2mov
Installing requirements for imageio-ffmpeg
Checking ReActor requirements... Error: The 'insightface==0.7.3' distribution was not found and is required by the application
Collecting insightface==0.7.3
  Downloading insightface-0.7.3.tar.gz (439 kB)
     -------------------------------------- 439.5/439.5 kB 1.1 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.23.5)
Requirement already satisfied: onnx in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.14.1)
Requirement already satisfied: tqdm in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (4.65.0)
Requirement already satisfied: requests in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (2.31.0)
Requirement already satisfied: matplotlib in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (3.8.0)
Requirement already satisfied: Pillow in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (9.5.0)
Requirement already satisfied: scipy in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (1.11.3)
Collecting scikit-learn (from insightface==0.7.3)
  Obtaining dependency information for scikit-learn from https://files.pythonhosted.org/packages/59/ed/548f6f686845d386a727a51a3daa411d95fc599649a2d54705f6773ac259/scikit_learn-1.3.1-cp310-cp310-win_amd64.whl.metadata
  Downloading scikit_learn-1.3.1-cp310-cp310-win_amd64.whl.metadata (11 kB)
Requirement already satisfied: scikit-image in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from insightface==0.7.3) (0.21.0)
Collecting easydict (from insightface==0.7.3)
  Downloading easydict-1.10.tar.gz (6.4 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting cython (from insightface==0.7.3)
  Obtaining dependency information for cython from https://files.pythonhosted.org/packages/23/d5/b14d37c38d131daf79b9c8d6d7d798889741edbd697f6bcde710e0fb9533/Cython-3.0.3-cp310-cp310-win_amd64.whl.metadata
  Downloading Cython-3.0.3-cp310-cp310-win_amd64.whl.metadata (3.2 kB)
Collecting albumentations (from insightface==0.7.3)
  Obtaining dependency information for albumentations from https://files.pythonhosted.org/packages/9b/f6/c486cedb4f75147232f32ec4c97026714cfef7c7e247a1f0427bc5489f66/albumentations-1.3.1-py3-none-any.whl.metadata
  Downloading albumentations-1.3.1-py3-none-any.whl.metadata (34 kB)
Collecting prettytable (from insightface==0.7.3)
  Obtaining dependency information for prettytable from https://files.pythonhosted.org/packages/4d/81/316b6a55a0d1f327d04cc7b0ba9d04058cb62de6c3a4d4b0df280cbe3b0b/prettytable-3.9.0-py3-none-any.whl.metadata
  Downloading prettytable-3.9.0-py3-none-any.whl.metadata (26 kB)
Requirement already satisfied: PyYAML in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from albumentations->insightface==0.7.3) (6.0.1)
Collecting qudida>=0.0.4 (from albumentations->insightface==0.7.3)
  Downloading qudida-0.0.4-py3-none-any.whl (3.5 kB)
Collecting opencv-python-headless>=4.1.1 (from albumentations->insightface==0.7.3)
  Obtaining dependency information for opencv-python-headless>=4.1.1 from https://files.pythonhosted.org/packages/e3/10/31b27a7473043eb5317f698ede00e7e129b2de378903bfe0bb4d785a7baf/opencv_python_headless-4.8.1.78-cp37-abi3-win_amd64.whl.metadata
  Downloading opencv_python_headless-4.8.1.78-cp37-abi3-win_amd64.whl.metadata (20 kB)
Requirement already satisfied: networkx>=2.8 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (3.1)
Requirement already satisfied: imageio>=2.27 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2.31.5)
Requirement already satisfied: tifffile>=2022.8.12 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (2023.9.26)
Requirement already satisfied: PyWavelets>=1.1.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (1.4.1)
Requirement already satisfied: packaging>=21 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (23.2)
Requirement already satisfied: lazy_loader>=0.2 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from scikit-image->insightface==0.7.3) (0.3)
Requirement already satisfied: contourpy>=1.0.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.1.1)
Requirement already satisfied: cycler>=0.10 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (0.12.0)
Requirement already satisfied: fonttools>=4.22.0 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (4.43.0)
Requirement already satisfied: kiwisolver>=1.0.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (1.4.5)
Requirement already satisfied: pyparsing>=2.3.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from matplotlib->insightface==0.7.3) (2.8.2)
Requirement already satisfied: protobuf>=3.20.2 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from onnx->insightface==0.7.3) (4.24.4)
Requirement already satisfied: typing-extensions>=3.6.2.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from onnx->insightface==0.7.3) (4.8.0)
Requirement already satisfied: wcwidth in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from prettytable->insightface==0.7.3) (0.2.8)
Requirement already satisfied: charset-normalizer<4,>=2 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.3.0)
Requirement already satisfied: idna<4,>=2.5 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (2.0.6)
Requirement already satisfied: certifi>=2017.4.17 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from requests->insightface==0.7.3) (2023.7.22)
Collecting joblib>=1.1.1 (from scikit-learn->insightface==0.7.3)
  Obtaining dependency information for joblib>=1.1.1 from https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl.metadata
  Downloading joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting threadpoolctl>=2.0.0 (from scikit-learn->insightface==0.7.3)
  Obtaining dependency information for threadpoolctl>=2.0.0 from https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threadpoolctl-3.2.0-py3-none-any.whl.metadata
  Downloading threadpoolctl-3.2.0-py3-none-any.whl.metadata (10.0 kB)
Requirement already satisfied: colorama in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from tqdm->insightface==0.7.3) (0.4.6)
Requirement already satisfied: six>=1.5 in e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui\venv\lib\site-packages (from python-dateutil>=2.7->matplotlib->insightface==0.7.3) (1.16.0)
Downloading albumentations-1.3.1-py3-none-any.whl (125 kB)
   -------------------------------------- 125.7/125.7 kB 566.0 kB/s eta 0:00:00
Downloading Cython-3.0.3-cp310-cp310-win_amd64.whl (2.8 MB)
   ---------------------------------------- 2.8/2.8 MB 1.6 MB/s eta 0:00:00
Downloading prettytable-3.9.0-py3-none-any.whl (27 kB)
Downloading scikit_learn-1.3.1-cp310-cp310-win_amd64.whl (9.3 MB)
   ---------------------------------------- 9.3/9.3 MB 1.6 MB/s eta 0:00:00
Downloading joblib-1.3.2-py3-none-any.whl (302 kB)
   ---------------------------------------- 302.2/302.2 kB 1.7 MB/s eta 0:00:00
Downloading opencv_python_headless-4.8.1.78-cp37-abi3-win_amd64.whl (38.0 MB)
   ---------------------------------------- 38.0/38.0 MB 1.6 MB/s eta 0:00:00
Downloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
Building wheels for collected packages: insightface, easydict
  Building wheel for insightface (pyproject.toml): started
  Building wheel for insightface (pyproject.toml): finished with status 'error'
  Building wheel for easydict (setup.py): started
  Building wheel for easydict (setup.py): finished with status 'done'
  Created wheel for easydict: filename=easydict-1.10-py3-none-any.whl size=6515 sha256=0b0d836434c58fe7143acd6901b36f0d38297e0b9dc8cf4044fe07bcd630702e
  Stored in directory: D:\Temp\pip-ephem-wheel-cache-gpbsx660\wheels\b7\e3\8c\f814820ac7ef5fd96f38759ce0d3dc51166a3169008b31da53
Successfully built easydict
Failed to build insightface

--- PLEASE, RESTART the Server! ---
Launching Web UI with arguments: --medvram --xformers --api --skip-python-version-check --no-half
E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\torchaudio\backend\utils.py:74: UserWarning: No audio backend is available.
  warnings.warn("No audio backend is available.")
python_server_full_path:  E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\Auto-Photoshop-StableDiffusion-Plugin\server/python_server
2023-10-16 22:52:14,855 - ControlNet - INFO - ControlNet v1.1.411
ControlNet preprocessor location: E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-10-16 22:52:14,953 - ControlNet - INFO - ControlNet v1.1.411
*** Error loading script: console_log_patch.py
    Traceback (most recent call last):
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 4, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---
*** Error loading script: reactor_api.py
    Traceback (most recent call last):
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_api.py", line 17, in <module>
        from scripts.reactor_swapper import EnhancementOptions, swap_face
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

22:52:15 - ReActor - ---
*** Error loading script: reactor_faceswap.py
    Traceback (most recent call last):
STATUS      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
 - Running v0.4.2
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 26, in <module>
        from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, reset_messaged
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---
*** Error loading script: reactor_swapper.py
    Traceback (most recent call last):
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "E:\AI\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in <module>
        import insightface
    ModuleNotFoundError: No module named 'insightface'

---

@Kallamamran
Copy link

Well I get this error...

100%|█████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 7.76it/s]
*** Error running postprocess_batch: Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py| 20/20 [00:02<00:00, 8.48it/s]
Traceback (most recent call last):
File "Q:\A1111\modules\scripts.py", line 659, in postprocess_batch
script.postprocess_batch(p, *script_args, images=images, **kwargs)
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 360, in postprocess_batch
if self.enable and not self.save_original:
AttributeError: 'FaceSwapScript' object has no attribute 'save_original'


*** Error running postprocess_image: Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py
Traceback (most recent call last):
File "Q:\A1111\modules\scripts.py", line 675, in postprocess_image
script.postprocess_image(p, pp, *script_args)
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 364, in postprocess_image
if self.enable and self.swap_in_generated and not self.save_original:
AttributeError: 'FaceSwapScript' object has no attribute 'save_original'


*** Error running postprocess: Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py
Traceback (most recent call last):
File "Q:\A1111\modules\scripts.py", line 651, in postprocess
script.postprocess(p, processed, *script_args)
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 303, in postprocess
if self.save_original:
AttributeError: 'FaceSwapScript' object has no attribute 'save_original'


Total progress: 100%|████████████████████████████████████████| 20/20 [00:02<00:00, 7.80it/s]
Total progress: 100%|████████████████████████████████████████| 20/20 [00:02<00:00, 8.48it/s]

@Kallamamran
Copy link

Kallamamran commented Oct 16, 2023

Found my error... The extension had not installed correctly. Instead of a Insightface-folder under "models" I got a insightface-file (Which was actually the old inswapper_128.onnx file.
Creating the folder Insightface manually and putting inswapper_128.onnx inside of it gave me some progress...

100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 7.28it/s]
22:21:01 - ReActor - STATUS - Working: source face index [0], target face index [0]████| 20/20 [00:02<00:00, 8.36it/s]
22:21:01 - ReActor - STATUS - Analyzing Source Image...
download_path: Q:\A1111\models\insightface\models\buffalo_l
Downloading Q:\A1111\models\insightface\models\buffalo_l.zip from https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip...
100%|████████████████████████████████████████████████████████████████████████| 281857/281857 [00:36<00:00, 7744.69KB/s]
22:21:41 - ReActor - STATUS - Analyzing Target Image...
22:21:42 - ReActor - STATUS - Detecting Source Face, Index = 0
22:21:42 - ReActor - STATUS - Detected: -53- y.o. Female
22:21:43 - ReActor - STATUS - Detecting Target Face, Index = 0
22:21:43 - ReActor - STATUS - Detected: -36- y.o. Female
22:21:43 - ReActor - STATUS - Swapping Source into Target
22:21:43 - ReActor - STATUS - Restoring the face with CodeFormer
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:47<00:00, 2.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 7.53it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 7.51it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 8.08it/s]

Still not swapping faces though
And also the directory structure is useless... "Q:\A1111\models\Insightface\models\buffalo_l" 👎

@Kallamamran
Copy link

It works when I put inswapper_128.onnx inside of the buffalo-folder, but the results are identical with Roop and Reactor 🤔

@Kallamamran
Copy link

Nah... Stopped working again 😫 Don't knwo what's up with Reactor. Think I'll stick with Roop for now...

100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00, 7.81it/s]
22:40:54 - ReActor - STATUS - Working: source face index [0], target face index [0]████| 20/20 [00:02<00:00, 8.51it/s]
22:40:54 - ReActor - STATUS - Analyzing Source Image...
*** Error running postprocess_image: Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py
Traceback (most recent call last):
File "Q:\A1111\modules\scripts.py", line 675, in postprocess_image
script.postprocess_image(p, pp, *script_args)
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 376, in postprocess_image
result, output, swapped = swap_face(
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 300, in swap_face
source_faces = analyze_faces(source_img)
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 214, in analyze_faces
face_analyser = copy.deepcopy(getAnalysisModel())
File "Q:\A1111\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 78, in getAnalysisModel
ANALYSIS_MODEL = insightface.app.FaceAnalysis(
File "Q:\A1111\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 54, in patched_faceanalysis_init
elif model.taskname not in self.models and (allowed_modules is None or model.taskname in allowed_modules):
AttributeError: 'INSwapper' object has no attribute 'taskname'


Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00, 5.23it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00, 8.51it/s]

Gourieff added a commit that referenced this issue Oct 17, 2023
@Gourieff
Copy link
Owner

Finally fixed 6a110cc

@Gourieff Gourieff added ✔ fixed and removed bug Something isn't working labels Oct 17, 2023
@Fire1982Photo
Copy link
Author

Fire1982Photo commented Oct 17, 2023 via email

@Gourieff
Copy link
Owner

it's for my original problem?

It might be resolved with two latest updates

@noembryo
Copy link

Tried again just now but I still got the same error I got before:

Building wheels for collected packages: insightface, easydict
  Building wheel for insightface (pyproject.toml): started
  Building wheel for insightface (pyproject.toml): finished with status 'error'
  Building wheel for easydict (setup.py): started
  Building wheel for easydict (setup.py): finished with status 'done'
  Created wheel for easydict: filename=easydict-1.10-py3-none-any.whl size=6515 

@Gourieff
Copy link
Owner

Gourieff commented Oct 17, 2023

Building wheel for insightface (pyproject.toml): finished with status 'error'

This means that you have no C++ Build tools in your OS
Try to install the pre-built package of the Insightface library https://github.com/Gourieff/sd-webui-reactor#insightfacebuild

Or install VS C++ Build Tools as described here https://github.com/Gourieff/sd-webui-reactor#installation

@noembryo
Copy link

This means that you have no C++ Build tools in your OS Try to install the pre-built package of the Insightface library https://github.com/Gourieff/sd-webui-reactor#insightfacebuild

I get an ERROR: insightface-0.7.3-cp310-cp310-win_amd64.whl is not a supported wheel on this platform
Using Windows10x64..

@noembryo
Copy link

It could be something wrong with my system.
It's just that this is the first extension to have problems with it.. 😞

@Gourieff
Copy link
Owner

It could be something wrong with my system. It's just that this is the first extension to have problems with it.. 😞

I see that you have "Python 3.10.11" inside your sd env - and this the right version for this package
But you use stabilitymatrix...
Are you sure you're trying to install "insightface-0.7.3-cp310-cp310-win_amd64.whl" inside the env but not directly in your system?

@noembryo
Copy link

Are you sure you're trying to install "insightface-0.7.3-cp310-cp310-win_amd64.whl" inside the env but not directly in your system?

Actually, no.
I thought that if I activate the venv, then all calls to python will use the venv, no?
Should I change the pip install insightface-0.7.3-cp310-cp310-win_amd64.whl to something else?

@Gourieff
Copy link
Owner

Gourieff commented Oct 17, 2023

Are you sure you're trying to install "insightface-0.7.3-cp310-cp310-win_amd64.whl" inside the env but not directly in your system?

Actually, no. I thought that if I activate the venv, then all calls to python will use the venv, no? Should I change the pip install insightface-0.7.3-cp310-cp310-win_amd64.whl to something else?

Save "insightface-0.7.3-cp310-cp310-win_amd64.whl" to e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui
Open CMD there and run:

  1. .\venv\Scripts\activate
  2. pip install insightface-0.7.3-cp310-cp310-win_amd64.whl

@noembryo
Copy link

Save "insightface-0.7.3-cp310-cp310-win_amd64.whl" to e:\ai\stabilitymatrix\data\packages\stable-diffusion-webui Open CMD there and run:

  1. .\venv\Scripts\activate
  2. pip install insightface-0.7.3-cp310-cp310-win_amd64.whl

But..., this is what I already did and got the error.
Did it again. Same error.. 😞

@noembryo
Copy link

OK, what I did was this..

  • Installed the wheel with ..\..\Assets\Python310\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl
    This installed the insightface library and all its dependencies to the Python 310 Libs (not the venv), so still the extension couldn't find the library.
  • Moved all newly created folders and files from \Lib\site-packages and \Scripts to the venv's \Lib\site-packages and \Scripts.

After that there is no more errors on startup and the Extension looks OK. 😃
Hadn't tried yet, but I will, later today and report back..

@Gourieff
Copy link
Owner

Oh man... What a strange internal structure StabilityMatrix has... 🤦‍♂️

@Fire1982Photo
Copy link
Author

it's for my original problem?

It might be resolved with two latest updates

Sorry but, I don't understand, how exactly should I do to resolve the problem.?

@noembryo
Copy link

After that there is no more errors on startup and the Extension looks OK. 😃
Hadn't tried yet, but I will, later today and report back..

Unfortunately it doesn't work..
But there was some progress.
Different error this time, opened #138.

@Gourieff Gourieff changed the title *** Error running install.py for extension StabilityMatrix | Error running install.py for extension Oct 17, 2023
@Gourieff
Copy link
Owner

Gourieff commented Oct 17, 2023

it's for my original problem?

It might be resolved with two latest updates

Sorry but, I don't understand, how exactly should I do to resolve the problem.?

You can try these steps #129 (comment)
But I don't guarantee that "sd-webui-reactor" will work with StabilityMatrix
Please use the original A1111 build

UPDATE: Workable! #138
Thanks @noembryo for not giving up 👍🏻

@noembryo
Copy link

noembryo commented Oct 17, 2023

Sorry but, I don't understand, how exactly should I do to resolve the problem.?

Just re-install the extension..

@Fire1982Photo
Copy link
Author

Sorry but, I don't understand, how exactly should I do to resolve the problem.?

Just re-install the extension..

`Launching Web UI with arguments: --xformers --api --skip-python-version-check
*** Error loading script: console_log_patch.py
Traceback (most recent call last):
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\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:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 4, in
import insightface
ModuleNotFoundError: No module named 'insightface'


*** Error loading script: reactor_api.py
Traceback (most recent call last):
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\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:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_api.py", line 17, in
from scripts.reactor_swapper import EnhancementOptions, swap_face
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in
import insightface
ModuleNotFoundError: No module named 'insightface'
07:33:24 - ReActor -

*** Error loading script: reactor_faceswap.py
STATUS Traceback (most recent call last):
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts

  • Running v0.4.3-b1
    script_module = script_loading.load_module(scriptfile.path)
    File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\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:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 26, in
    from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, reset_messaged
    File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in
    import insightface
    ModuleNotFoundError: No module named 'insightface'

*** Error loading script: reactor_swapper.py
Traceback (most recent call last):
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\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:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 10, in
import insightface
ModuleNotFoundError: No module named 'insightface'
`

@noembryo
Copy link

noembryo commented Oct 18, 2023

@Fire1982Photo
So, I see now that you have problem with StabilityMatrix and not the original FileExistsError that is already fixed (that's why I told you to re-install, so you could get the new build of the extension)
Anyway.
These are the steps to solve the StabilityMatrix problem:

  • Open cmd.exe at your stable-diffusion-webui directory, which for you it must be D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui
  • Enable the venv with .\venv\Scripts\activate
  • Download the insightface-0.7.3-cp310-cp310-win_amd64.whl file to the same directory
  • Install the wheel with ..\..\Assets\Python310\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl
  • Disable the venv with .\venv\Scripts\deactivate
  • Go to the D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Assets\Python310\Lib\site-packages with the Windows Explorer, and select all the folders and files that where Modified at the last minutes.
  • Move them to D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\Lib\site-packages (overwrite same items)
  • Go to the D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Assets\Python310\Scripts with the Windows Explorer, and select all the files that where Modified at the last minutes.
  • Move them to D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\Scripts (overwrite same items)

Now the error should go away and ReActor should load OK on A1111.

If after that you get a different error when you try to use it (like #138 ), check if there is a inswapper_128.onnx file in your D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\models\insightface, and that is ~528 Mb.
If not, download it from here, close StabilityMatrix and check again..

Good luck! 😃

@Mondifik
Copy link

Mondifik commented Oct 18, 2023

Hello @Gourieff Gourieff , i have the same problems, i did everything... It's macOS

Could you help me please?....

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on svetlanavyachina user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.9.6 (default, Aug 11 2023, 19:44:49)
[Clang 15.0.0 (clang-1500.0.40.1)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
/Users/svetlanavyachina/stable-diffusion-webui/venv/lib/python3.9/site-packages/urllib3/init.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: urllib3/urllib3#3020
warnings.warn(
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
/Users/svetlanavyachina/stable-diffusion-webui/venv/lib/python3.9/site-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: pytorch_lightning.utilities.distributed.rank_zero_only has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from pytorch_lightning.utilities instead.
rank_zero_deprecation(
*** Error running install.py for extension /Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor.
*** Command: "/Users/svetlanavyachina/stable-diffusion-webui/venv/bin/python3" "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/install.py"
*** Error code: 1
*** stderr: Traceback (most recent call last):
*** File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/install.py", line 42, in
*** package: str, version: str | None = None, strict: bool = True
*** TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Launching Web UI with arguments: --no-half --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
*** Error loading script: console_log_patch.py
Traceback (most recent call last):
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/console_log_patch.py", line 4, in
import insightface
ModuleNotFoundError: No module named 'insightface'


*** Error loading script: reactor_api.py
Traceback (most recent call last):
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_api.py", line 17, in
from scripts.reactor_swapper import EnhancementOptions, swap_face
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 10, in
import insightface
ModuleNotFoundError: No module named 'insightface'


*** Error loading script: reactor_faceswap.py
Traceback (most recent call last):
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_faceswap.py", line 26, in
from scripts.reactor_swapper import EnhancementOptions, swap_face, check_process_halt, reset_messaged
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 10, in
import insightface
ModuleNotFoundError: No module named 'insightface'


*** Error loading script: reactor_swapper.py
Traceback (most recent call last):
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/svetlanavyachina/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/svetlanavyachina/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 10, in
import insightface
ModuleNotFoundError: No module named 'insightface'


21:01:34 - ReActor - STATUS - Running v0.4.3-b1
Loading weights [aadddd3d75] from /Users/svetlanavyachina/stable-diffusion-webui/models/Stable-diffusion/deliberate_v3.safetensors
Creating model from config: /Users/svetlanavyachina/stable-diffusion-webui/configs/v1-inference.yaml
Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().
Startup time: 4.9s (prepare environment: 3.0s, initialize shared: 0.2s, other imports: 0.6s, load scripts: 0.5s, create ui: 0.3s, gradio launch: 0.4s).

@Fire1982Photo
Copy link
Author

@Fire1982Photo So, I see now that you have problem with StabilityMatrix and not the original FileExistsError that is already fixed (that's why I told you to re-install, so you could get the new build of the extension) Anyway. These are the steps to solve the StabilityMatrix problem:

  • Open cmd.exe at your stable-diffusion-webui directory, which for you it must be D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui
  • Download the insightface-0.7.3-cp310-cp310-win_amd64.whl file to the same directory
  • Install the wheel with ..\..\Assets\Python310\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl
  • Go to the D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Assets\Python310\Lib\site-packages with the Windows Explorer, and select all the folders and files that where Modified at the last minutes.
  • Move them to D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\Lib\site-packages (overwrite same items)
  • Go to the D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Assets\Python310\Scripts with the Windows Explorer, and select all the files that where Modified at the last minutes.
  • Move them to D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\venv\Scripts (overwrite same items)

Now the error should go away and ReActor should load OK on A1111.

If after that you get a different error when you try to use it (like #138 ), check if there is a inswapper_128.onnx file in your D:\StabilityMatrix-win-x64\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\models\insightface, and that is ~528 Mb. If not, download it from here, close StabilityMatrix and check again..

Good luck! 😃

Hi,

thanks for reply, i'll try :)

@Fire1982Photo
Copy link
Author

Perfect ! It's working !
Thanks so much ! @noembryo

@Gourieff
Copy link
Owner

Python 3.9.6

@Mondifik Hello
You can try the following #42
And also you need to rebuild your VENV to Python 3.10.6 (as said in the A1111 instruction), it won't work properly with 3.9
ReActor will not work at all with Python 3.9

@Gourieff Gourieff changed the title StabilityMatrix | Error running install.py for extension [SOLVED] StabilityMatrix | Error running install.py for extension Oct 20, 2023
@Gourieff Gourieff pinned this issue Oct 30, 2023
@Gourieff Gourieff unpinned this issue Nov 5, 2023
@metamountain
Copy link

How do i rebuild VENV to Python 3.10.6 ? Sorry, my Installation also fails:

File "C:\Users\blasa\Desktop\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\reactor_log_patch.py", line 5, in
from insightface.model_zoo.model_zoo import ModelRouter, PickableInferenceSession
ModuleNotFoundError: No module named 'insightface.model_zoo'

Cannot import C:\Users\blasa\Desktop\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node module for custom nodes: No module named 'insightface.model_zoo'

@Dhub959
Copy link

Dhub959 commented Nov 18, 2023

how to install the ReActor extension to a mac

@Gourieff
Copy link
Owner

@azamet90
Copy link

OK, what I did was this..

* Installed the wheel with `..\..\Assets\Python310\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`
  This installed the `insightface` library and all its dependencies to the Python 310 Libs (not the venv), so still the extension couldn't find the library.

* Moved all newly created folders and files from `\Lib\site-packages` and `\Scripts` to the venv's `\Lib\site-packages` and `\Scripts`.

After that there is no more errors on startup and the Extension looks OK. 😃 Hadn't tried yet, but I will, later today and report back..

this is not fixed on me

@BrunoVilela84
Copy link

This is happening and didnt appears the reactor and mov 2 mov:

Launching Web UI with arguments:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
*** Error loading script: m2m_ui.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-mov2mov\scripts\m2m_ui.py", line 23, in
from modules.ui import (
ImportError: cannot import name 'create_sampler_and_steps_selection' from 'modules.ui' (D:\Apps\stable-diffusion-webui\modules\ui.py)


*** Error loading script: console_log_patch.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\console_log_patch.py", line 5, in
from insightface.model_zoo.model_zoo import ModelRouter, PickableInferenceSession
ModuleNotFoundError: No module named 'insightface.model_zoo'


*** Error loading script: reactor_api.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_api.py", line 23, in
from scripts.reactor_swapper import EnhancementOptions, swap_face, DetectionOptions
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 12, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_faceswap.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_faceswap.py", line 18, in
from reactor_ui import (
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\reactor_ui_init
.py", line 2, in
import reactor_ui.reactor_tools_ui as ui_tools
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\reactor_ui\reactor_tools_ui.py", line 2, in
from scripts.reactor_swapper import build_face_model, blend_faces
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 12, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_helpers.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_helpers.py", line 10, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_logger.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_logger.py", line 7, in
from scripts.reactor_helpers import addLoggingLevel
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_helpers.py", line 10, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_swapper.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_swapper.py", line 12, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_version.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_version.py", line 4, in
from scripts.reactor_logger import logger, get_Run, set_Run
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_logger.py", line 7, in
from scripts.reactor_helpers import addLoggingLevel
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_helpers.py", line 10, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'


*** Error loading script: reactor_xyz.py
Traceback (most recent call last):
File "D:\Apps\stable-diffusion-webui\modules\scripts.py", line 508, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\Apps\stable-diffusion-webui\modules\script_loading.py", line 13, 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:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_xyz.py", line 8, in
from scripts.reactor_helpers import (
File "D:\Apps\stable-diffusion-webui\extensions\sd-webui-reactor\scripts\reactor_helpers.py", line 10, in
from insightface.app.common import Face
ModuleNotFoundError: No module named 'insightface.app'

@spekcool
Copy link

I use a translator so don't judge me too harshly.

  1. I use Stability Matrix, through which I run Stable Diffusion and want to install the Reactor extension for it.

I just want to share with the community how it worked for me on Windows 11.
pip install wheel
pip install --upgrade pip setuptools wheel
activate
python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl
...
Successfully uninstalled insightface-0.2.1
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.
open-clip-torch 2.20.0 requires protobuf<4, but you have protobuf 5.29.0 which is incompatible.
...

pip uninstall protobuf
pip install protobuf==3.20.3

python.exe -m pip install insightface-0.7.3-cp310-cp310-in_amd64.whl
pip install --upgrade pip setuptools
deactivate

After that, the Reactor started and works correctly.

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

No branches or pull requests