Mikubill / sd-webui-controlnet

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

[Bug]: error loading the controlnet.py script since this morning #3002

Closed OoAnikioO closed 2 months ago

OoAnikioO commented 2 months ago

Is there an existing issue for this?

What happened?

when I run a1111 there is this error

** Error loading script: controlnet.py Traceback (most recent call last): File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\modules\scripts.py", line 508, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "E:\StableDiffusion\Packages\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 "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 16, in import scripts.preprocessor as preprocessor_init # noqa File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\preprocessor__init__.py", line 9, in from .mobile_sam import File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\preprocessor\mobile_sam.py", line 1, in from annotator.mobile_sam import SamDetector_Aux File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\annotator\mobile_sam__init__.py", line 12, in from controlnet_aux import SamDetector ImportError: cannot import name 'SamDetector' from 'controlnet_aux' (E:\StableDiffusion\Packages\Stable Diffusion WebUI\venv\lib\site-packages\controlnet_aux__init__.py)

Steps to reproduce the problem

  1. run a1111

What should have happened?

controlnet should have launched normally

Commit where the problem happens

webui: at start controlnet: is not loaded

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--medvram --xformers --api --skip-python-version-check --no-half-vae --update-all-extensions --gradio-allowed-path E:\StableDiffusion\Images

List of enabled extensions

Lora built-in None
ScuNET built-in None
SwinIR built-in None
canvas-zoom-and-pan built-in None
extra-options-section built-in None
hypertile built-in None
mobile built-in None
postprocessing-for-training built-in None
prompt-bracket-checker built-in None
soft-inpainting built-in None
StyleSelectorXL
a-person-mask-generator
adetailer
sd-webui-incantations
sd-webui-lama-cleaner-masked-content
sd-webui-mosaic-outpaint
stable-diffusion-webui-images-browser
ultimate-upscale-for-automatic1111

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\a-person-mask-generator':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\adetailer':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-incantations':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-lama-cleaner-masked-content':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-mosaic-outpaint':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\stable-diffusion-webui-images-browser':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\StyleSelectorXL':
Already up to date.

Pulled changes for repository in 'E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\ultimate-upscale-for-automatic1111':
Already up to date.

Launching Web UI with arguments: --medvram --xformers --api --skip-python-version-check --no-half-vae --update-all-extensions --gradio-allowed-path E:\StableDiffusion\Images
[-] ADetailer initialized. version: 24.6.0, num models: 12
ControlNet preprocessor location: E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\annotator\downloads
*** Error loading script: controlnet.py
    Traceback (most recent call last):
      File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\modules\scripts.py", line 508, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "E:\StableDiffusion\Packages\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 "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 16, in <module>
        import scripts.preprocessor as preprocessor_init  # noqa
      File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\preprocessor\__init__.py", line 9, in <module>
        from .mobile_sam import *
      File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\scripts\preprocessor\mobile_sam.py", line 1, in <module>
        from annotator.mobile_sam import SamDetector_Aux
      File "E:\StableDiffusion\Packages\Stable Diffusion WebUI\extensions\sd-webui-controlnet\annotator\mobile_sam\__init__.py", line 12, in <module>
        from controlnet_aux import SamDetector
    ImportError: cannot import name 'SamDetector' from 'controlnet_aux' (E:\StableDiffusion\Packages\Stable Diffusion WebUI\venv\lib\site-packages\controlnet_aux\__init__.py)

---
INFO:scripts.incantation_base:Incantation: Debug scripts are disabled. Set INCANT_DEBUG environment variable to enable them.
INFO:incantation_base.py:Incantation: Debug scripts are disabled. Set INCANT_DEBUG environment variable to enable them.
Loading weights [3ee9534568] from E:\StableDiffusion\Packages\Stable Diffusion WebUI\models\Stable-diffusion\XL\creapromptLightning_creapromptHyperCFGV2.safetensors
WARNING:incantation_base.py:Module CFG Combiner does not implement get_xyz_axis_options
WARNING:scripts.incantation_base:Module CFG Combiner does not implement get_xyz_axis_options
Creating model from config: E:\StableDiffusion\Packages\Stable Diffusion WebUI\repositories\generative-models\configs\inference\sd_xl_base.yaml
E:\StableDiffusion\Packages\Stable Diffusion WebUI\venv\lib\site-packages\huggingface_hub\file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 19.9s (prepare environment: 7.8s, import torch: 3.7s, import gradio: 0.7s, setup paths: 0.9s, initialize shared: 0.2s, other imports: 0.6s, list SD models: 0.2s, load scripts: 2.3s, create ui: 2.2s, gradio launch: 0.8s, add APIs: 0.5s).
Applying attention optimization: xformers... done.
Model loaded in 11.4s (load weights from disk: 0.5s, create model: 6.9s, apply weights to model: 3.1s, calculate empty prompt: 0.7s).

Additional information

No response

Razunter commented 2 months ago

Manually installing controlnet_aux helps

OoAnikioO commented 2 months ago

I went back to 1.1.454

huchenlei commented 2 months ago

Culprit: https://github.com/Mikubill/sd-webui-controlnet/pull/3000

@sdbds PTAL

sdbds commented 2 months ago

I went back to 1.1.454

It can't be reproduced locally, and it looks like a network reason for the dependency not being installed correctly.

image

1、Run the command using the console in the root directory. (E:\StableDiffusion\Packages\Stable Diffusion WebUI) venv/scripts/activate

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.

a3nima commented 2 months ago

I had this error too this morning and upgrading controlnet_aux (was on version 0.0.3) via pip solved the issue :)

huchenlei commented 2 months ago

I went back to 1.1.454

It can't be reproduced locally, and it looks like a network reason for the dependency not being installed correctly.

image

1、Run the command using the console in the root directory. (E:\StableDiffusion\Packages\Stable Diffusion WebUI) venv/scripts/activate

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.

You may want to specify >=0.0.9 on controlnet_aux dep.

sdbds commented 2 months ago

I went back to 1.1.454

It can't be reproduced locally, and it looks like a network reason for the dependency not being installed correctly. image 1、Run the command using the console in the root directory. (E:\StableDiffusion\Packages\Stable Diffusion WebUI) venv/scripts/activate 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.

You may want to specify >=0.0.9 on controlnet_aux dep.

After my inspection, mobilesam was added in version 0.0.7, while some mirror sources are still at version 0.0.3. Perhaps adding >=0.0.9 could better pinpoint the error.