Uminosachi / sd-webui-inpaint-anything

Inpaint Anything extension performs stable diffusion inpainting on a browser UI using masks from Segment Anything.
Apache License 2.0
1.11k stars 101 forks source link

ImportError: Cannot import name 'unload model weights' #62

Closed uraniumcrystalsmaster closed 1 year ago

uraniumcrystalsmaster commented 1 year ago

inpaintAnything.py fails to load because of this:

Error loading script: inpaint_anything.py Traceback (most recent call last): File "C:\Users\urani\stable-diffusion-webui\modules\scripts.py", line 248, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "C:\Users\urani\stable-diffusion-webui\modules\script_loading.py", line 11, 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 "C:\Users\urani\stable-diffusion-webui\extensions\sd-webui-inpaint-anything\scripts\inpaint_anything.py", line 39, in <module> from modules.sd_models import unload_model_weights, reload_model_weights, get_closet_checkpoint_match ImportError: cannot import name 'unload_model_weights' from 'modules.sd_models' (C:\Users\urani\stable-diffusion-webui\modules\sd_models.py)

Uminosachi commented 1 year ago

The version of the webUI you are using may be outdated. Consider executing a git pull command in the stable-diffusion-webui directory to update it.

uraniumcrystalsmaster commented 1 year ago

The version of the webUI you are using may be outdated. Consider executing a git pull command in the stable-diffusion-webui directory to update it.

I updated with git pull master and a reinstallation of torch. The first problem I encountered before updating was issue #2, so I deleted my venv folder, and this error along with a list of errors to install fire popped up (I forgot how to install fire in my venv folder). I don't know how to reinstall this addon, which might be what I need to do to fix it.

Uminosachi commented 1 year ago

How about removing or moving all the extensions from the extensions folder within stable-diffusion-webui, and then starting the webUI? This is because old extensions may still remain.

uraniumcrystalsmaster commented 1 year ago

It gives me the same error.

Uminosachi commented 1 year ago

Please try git clone the repository, and then build it from scratch.

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
uraniumcrystalsmaster commented 1 year ago

I don't know how to git clone a repository or built it from scratch.

Uminosachi commented 1 year ago

You can download the webUI zip file from the URL provided below. However, I recommend installing the Git, as it will be handy for future updates.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.3.2 https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.4.0

uraniumcrystalsmaster commented 1 year ago

I have and had Git installed. I can't figure out what caused the issue, but the issue has been resolved.