Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
16.91k stars 1.95k forks source link

[Bug]: Error loading script: controlnet.py #3005

Closed nthngy closed 2 months ago

nthngy commented 2 months ago

Is there an existing issue for this?

What happened?

after update on 15 July the controlnet would not load. I was running using a saved settings file from the previous day, all assets were in the same place.

Error loading script: controlnet.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 508, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/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 "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 16, in import scripts.preprocessor as preprocessor_init # noqa File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/init.py", line 9, in from .mobile_sam import * File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/mobile_sam.py", line 1, in from annotator.mobile_sam import SamDetector_Aux File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/mobile_sam/init.py", line 12, in from controlnet_aux import SamDetector ModuleNotFoundError: No module named 'controlnet_aux'

Steps to reproduce the problem

  1. Go to .... fast_stable_diffusion_AUTOMATIC1111.ipynb
  2. Press ....load all parameteres
  3. ...

What should have happened?

controlnet should load and be implemented in image creation

Commit where the problem happens

webui: version: v1.9.4 controlnet: b63899a6  •  python: 3.10.12  •  torch: 2.3.0+cu121  •  xformers: 0.0.26.post1  •  gradio: 3.41.2  •  checkpoint: 408997149c

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome

Command Line Arguments

no

List of enabled extensions

Screen Shot 2024-07-16 at 06 53 43

Console logs

ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
*** Error loading script: controlnet.py
    Traceback (most recent call last):
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 508, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/script_loading.py", line 13, 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 "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 16, in <module>
        import scripts.preprocessor as preprocessor_init  # noqa
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/__init__.py", line 9, in <module>
        from .mobile_sam import *
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/preprocessor/mobile_sam.py", line 1, in <module>
        from annotator.mobile_sam import SamDetector_Aux
      File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/mobile_sam/__init__.py", line 12, in <module>
        from controlnet_aux import SamDetector
    ModuleNotFoundError: No module named 'controlnet_aux'

Additional information

a work around or fix would be greatly appreciated

sdbds commented 2 months ago

3002 same as this, use https://pypi.org/simple as your pip source.

1、Run the command using the console in the root directory. (/content/gdrive/MyDrive/sd/stable-diffusion-webui/)

2、pip list (Check if controlnet_aux exists and version==0.0.9)

3、pip install controlnet_aux -i https://pypi.org/simple

Note that new dependencies are not available for some pip mirror sources, you can use pip search controlnet_aux to query if the dependency exists for the current pip mirror source.

nthngy commented 2 months ago

Just wanted to thank you and everyone involved - I can't believe how quick i got an answer. And it worked seemlessly.

OoAnikioO commented 2 months ago

i use stability matrix, how i run command in the console ? or pip install

sdbds commented 2 months ago

i use stability matrix, how i run command in the console ? or pip install

Win+R and input CMD open console.

cd E:\StableDiffusion\Packages\Stable Diffusion WebUI

then follow

https://github.com/Mikubill/sd-webui-controlnet/issues/3002#issuecomment-2228877326