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

[Bug]: ControlNet IP-Adapter error(ModuleNotFoundError: No module named 'onnx') #16811

Closed
2 of 6 tasks
foobar-san opened this issue Jan 27, 2025 · 1 comment
Closed
2 of 6 tasks
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@foobar-san
Copy link

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

After upgrading to the latest version, I started getting an error with the Controlnet IP-Adapter.

ModuleNotFoundError: No module named 'onnx'

It says this and I can't load images. Is there a solution?

After a clean install, I tried running the following code before running [Start Stable-Diffusion]:
!pip install onnx

Then when I run [Start Stable-Diffusion] I get the following error:
ImportError: cannot import name 'mesh_core_cython' from 'insightface.thirdparty.face3d.mesh.cython' (unknown location)

Steps to reproduce the problem

  1. Start the WebUI.
  2. txt2img Enable ControlNet
  3. Check Pixel Perfect
  4. Select IP-Adapter for Control Type
  5. Select ip-adapter_face_id_plus for Preprocessor
  6. Select ip-adapter-faceid-plus_sd15 for Model
  7. Specify image and prompt and run generation

What should have happened?

It worked fine until January 14, 2025.

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2025-01-27-01-56.json

Console logs

ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2025-01-27 01:44:52,743 - ControlNet - INFO - ControlNet v1.1.455
Loading weights [1a17bcd93d] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/beautifulRealistic_v7.safetensors
2025-01-27 01:44:53,714 - ControlNet - INFO - ControlNet UI callback registered.
Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml
Running on public URL: https://6deb096a25f20cdf17.gradio.live
✔ Connected
Startup time: 19.9s (import torch: 8.0s, import gradio: 1.1s, setup paths: 1.6s, initialize shared: 0.2s, other imports: 0.8s, list SD models: 1.8s, load scripts: 2.9s, create ui: 0.8s, gradio launch: 2.0s, add APIs: 0.4s).
Loading VAE weights specified in settings: /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: xformers... done.
Model loaded in 5.5s (load weights from disk: 0.6s, create model: 1.3s, apply weights to model: 2.4s, load VAE: 0.4s, load textual inversion embeddings: 0.4s, calculate empty prompt: 0.2s).
2025-01-27 01:55:45,799 - ControlNet - INFO - unit_separate = False, style_align = False
2025-01-27 01:55:46,219 - ControlNet - INFO - Loading model: ip-adapter-faceid-plus_sd15 [d86a490f]
2025-01-27 01:55:46,398 - ControlNet - INFO - Loaded state_dict from [/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/models/ip-adapter-faceid-plus_sd15.bin]
2025-01-27 01:55:47,018 - ControlNet - INFO - ControlNet model ip-adapter-faceid-plus_sd15 [d86a490f](ControlModelType.IPAdapter) loaded.
2025-01-27 01:55:47,027 - ControlNet - INFO - Using preprocessor: ip-adapter_face_id_plus
2025-01-27 01:55:47,027 - ControlNet - INFO - preprocessor resolution = 512
*** Error running process: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py
    Traceback (most recent call last):
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 832, in process
        script.process(p, *script_args)
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 1228, in process
        self.controlnet_hack(p)
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 1213, in controlnet_hack
        self.controlnet_main_entry(p)
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 941, in controlnet_main_entry
        controls, hr_controls, additional_maps = get_control(
                                                 ^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 290, in get_control
        controls, hr_controls = list(zip(*[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 290, in <listcomp>
        controls, hr_controls = list(zip(*[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 242, in preprocess_input_image
        result = preprocessor.cached_call(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/supported_preprocessor.py", line 198, in cached_call
        result = self._cached_call(input_image, *args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/utils.py", line 82, in decorated_func
        return cached_func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/utils.py", line 66, in cached_func
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/supported_preprocessor.py", line 211, in _cached_call
        return self(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/legacy/legacy_preprocessors.py", line 105, in __call__
        result, is_image = self.call_function(
                           ^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/legacy/processor.py", line 768, in face_id_plus
        face_embed, _ = g_insight_face_model.run_model(img)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/legacy/processor.py", line 696, in run_model
        self.load_model()
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/legacy/processor.py", line 686, in load_model
        from insightface.app import FaceAnalysis
      File "/usr/local/lib/python3.11/dist-packages/insightface/__init__.py", line 16, in <module>
        from . import model_zoo
      File "/usr/local/lib/python3.11/dist-packages/insightface/model_zoo/__init__.py", line 1, in <module>
        from .model_zoo import get_model
      File "/usr/local/lib/python3.11/dist-packages/insightface/model_zoo/model_zoo.py", line 11, in <module>
        from .arcface_onnx import *
      File "/usr/local/lib/python3.11/dist-packages/insightface/model_zoo/arcface_onnx.py", line 10, in <module>
        import onnx
    ModuleNotFoundError: No module named 'onnx'

---
100% 46/46 [00:03<00:00, 11.95it/s]

Additional information

I downloaded ip-adapter-faceid-plusv2_sd15.bin from the link below.
https://huggingface.co/h94/IP-Adapter-FaceID/tree/main

@xiahongyu939
Copy link

How to solve the problem that pictures cannot be generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants