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

Mac m2pro chip can't run this plugin, hint: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64', Error loading script: reactor_swapper.py #399

Closed
3 tasks done
igo903 opened this issue Mar 18, 2024 · 4 comments
Labels
bug Something isn't working ⛔ dependencies conflict

Comments

@igo903
Copy link

igo903 commented Mar 18, 2024

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?

Guys, My environment is MacBook pro with M2Pro Chip. After i installed this plugin and run the code. it shows the output:
Error loading script: reactor_swapper.py
......
ImportError: dlopen
.....
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Steps to reproduce the problem

  1. run the local SD in MacBook Pro in M2Pro Chip
  2. install the plugin sd-webui-reactor
  3. restart the SD.
  4. it will show the output like this: Error loading script: reactor_swapper.py
    ......
    ImportError: dlopen
    .....
    (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

How to solve it?
Can this plugin works well in Mac M2Pro?

Give me some hands, thanks.

Sysinfo

MacBook Pro in M2Pro Chip

Relevant console log

*** Error loading script: reactor_swapper.py
    Traceback (most recent call last):
ImportError: dlopen(
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

Additional information

No response

@igo903 igo903 added bug Something isn't working new labels Mar 18, 2024
@Gourieff
Copy link
Owner

Could you please provide the whole log?
And pip list of Python you use for your SD WebUI as well

@Gourieff Gourieff added 👀 more info Provide more info and removed new labels Mar 19, 2024
@igo903
Copy link
Author

igo903 commented Mar 21, 2024

Could you please provide the whole log? And pip list of Python you use for your SD WebUI as well

-- okay, Below is the whole log. thanks for your help. I tried all relevant issue solution and failed.

Launching launch.py...
################################################################
Python 3.10.9 (main, Mar 1 2023, 12:20:14) [Clang 14.0.6 ]
Version: v1.8.0
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled

You are running torch 2.0.1.
The program is tested to work with torch 2.1.2.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.

*** Error loading script: console_log_patch.py
Traceback (most recent call last):
File "/Users/axxx/Work/stable-diffusion-webui/modules/scripts.py", line 527, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/axxx/Work/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 "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/console_log_patch.py", line 4, in
import insightface
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/init.py", line 18, in
from . import app
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/init.py", line 2, in
from .mask_renderer import *
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/mask_renderer.py", line 8, in
from ..thirdparty import face3d
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/init.py", line 3, in
from . import mesh
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/init.py", line 9, in
from .cython import mesh_core_cython
ImportError: dlopen(/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so, 0x0002): tried: '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (no such file), '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))


*** Error loading script: reactor_api.py
Traceback (most recent call last):
File "/Users/axxx/Work/stable-diffusion-webui/modules/scripts.py", line 527, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/axxx/Work/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 "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_api.py", line 23, in
from scripts.reactor_swapper import EnhancementOptions, swap_face, DetectionOptions
File "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 11, in
import insightface
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/init.py", line 18, in
from . import app
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/init.py", line 2, in
from .mask_renderer import *
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/mask_renderer.py", line 8, in
from ..thirdparty import face3d
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/init.py", line 3, in
from . import mesh
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/init.py", line 9, in
from .cython import mesh_core_cython
ImportError: dlopen(/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so, 0x0002): tried: '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (no such file), '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))


*** Error loading script: reactor_faceswap.py
Traceback (most recent call last):
File "/Users/axxx/Work/stable-diffusion-webui/modules/scripts.py", line 527, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/axxx/Work/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 "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_faceswap.py", line 18, in
from reactor_ui import (
File "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/reactor_ui/init.py", line 2, in
import reactor_ui.reactor_tools_ui as ui_tools
File "/Users/axxx/Work/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 "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 11, in
import insightface
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/init.py", line 18, in
from . import app
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/init.py", line 2, in
from .mask_renderer import *
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/mask_renderer.py", line 8, in
from ..thirdparty import face3d
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/init.py", line 3, in
from . import mesh
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/init.py", line 9, in
from .cython import mesh_core_cython
ImportError: dlopen(/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so, 0x0002): tried: '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (no such file), '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))


*** Error loading script: reactor_swapper.py
Traceback (most recent call last):
File "/Users/axxx/Work/stable-diffusion-webui/modules/scripts.py", line 527, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/Users/axxx/Work/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 "/Users/axxx/Work/stable-diffusion-webui/extensions/sd-webui-reactor/scripts/reactor_swapper.py", line 11, in
import insightface
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/init.py", line 18, in
from . import app
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/init.py", line 2, in
from .mask_renderer import *
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/app/mask_renderer.py", line 8, in
from ..thirdparty import face3d
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/init.py", line 3, in
from . import mesh
File "/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/init.py", line 9, in
from .cython import mesh_core_cython
ImportError: dlopen(/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so, 0x0002): tried: '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (no such file), '/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))


17:54:46 - ReActor - STATUS - Running v0.7.0-b7 on Device: CPU
Loading weights [3c5d7960a7] from /Users/axxx/Work/stable-diffusion-webui/models/Stable-diffusion/analogMadness_v70.safetensors
Creating model from config: /Users/axxx/Work/stable-diffusion-webui/configs/v1-inference.yaml
Running on local URL: http://127.0.0.1:7860

@igo903
Copy link
Author

igo903 commented Mar 30, 2024

Could you please provide the whole log? And pip list of Python you use for your SD WebUI as well

I've post the whole infor, Could you help me to have a look?

@Gourieff
Copy link
Owner

'/Users/axxx/Work/stable-diffusion-webui/venv/lib/python3.10/site-packages/insightface/thirdparty/face3d/mesh/cython/mesh_core_cython.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

You should build Insightface for arm64
Try the following solutions:
#42
or
deepinsight/insightface#2493 (comment)
Don't forget to uninstall the version you have (activate venv and run pip uninstall insightface -y)

@Gourieff Gourieff added ⛔ dependencies conflict and removed 👀 more info Provide more info labels Mar 31, 2024
@Gourieff Gourieff closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ⛔ dependencies conflict
Projects
None yet
Development

No branches or pull requests

2 participants