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.13k stars 102 forks source link

missing lama module cause Inpaint Anything failing to load #88

Closed gogoldgoal closed 6 months ago

gogoldgoal commented 1 year ago

if this is a requirement for it to load, i think it'd better to include it during extension installation process. BTW, where can we find this lama_cleaner module and install it in automatic1111?

*** Error loading script: inpaint_anything.py Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/content/gdrive/MyDrive/sd/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 "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-inpaint-anything/scripts/inpaint_anything.py", line 20, in from lama_cleaner.model_manager import ModelManager ModuleNotFoundError: No module named 'lama_cleaner'

Uminosachi commented 1 year ago

Typically, lama_cleaner is automatically installed during the execution of the web UI launch script. However, you can install it manually using the commands below.

For Windows:

.\venv\Scripts\activate
pip install lama-cleaner
deactivate

For Linux:

source ./venv/bin/activate
pip install lama-cleaner
deactivate
Uminosachi commented 1 year ago

Duplicate of #31

gogoldgoal commented 1 year ago

Typically, lama_cleaner is automatically installed during the execution of the web UI launch script. However, you can install it manually using the commands below.

For Windows:

.\venv\Scripts\activate
pip install lama-cleaner
deactivate

For Linux:

source ./venv/bin/activate
pip install lama-cleaner
deactivate

it seems this installation does not work when using automatic1111 in google colab, because it would be installed to temporary storage, rather than google drive. That's why the module is gone once the session end, and cause this error message.

Uminosachi commented 1 year ago

I have tested it on Google Colab, and it appears to start without any errors when the --enable-insecure-extension-access option is included in the startup command as shown below:

!python launch.py --share --xformers --enable-insecure-extension-access
kazufell commented 1 year ago

Hey! Thank you for your model! I have an issue. The Tab is not showing. I have tried

I am using a SD Deploy on Runpod image Hope this helps.

Thank you!

The Log is giving me the folowing Error Thank you for your help!

2023-09-04T09:33:35.093845854Z *** Error loading script: inpaint_anything.py 2023-09-04T09:33:35.097113423Z Traceback (most recent call last): 2023-09-04T09:33:35.097125803Z File "/workspace/stable-diffusion-webui/modules/scripts.py", line 319, in load_scripts 2023-09-04T09:33:35.097130093Z script_module = script_loading.load_module(scriptfile.path) 2023-09-04T09:33:35.097133133Z File "/workspace/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module 2023-09-04T09:33:35.097136653Z module_spec.loader.exec_module(module) 2023-09-04T09:33:35.097139673Z File "", line 883, in exec_module 2023-09-04T09:33:35.097142973Z File "", line 241, in _call_with_frames_removed 2023-09-04T09:33:35.097146333Z File "/workspace/stable-diffusion-webui/extensions/sd-webui-inpaint-anything/scripts/inpaint_anything.py", line 17, in 2023-09-04T09:33:35.097149702Z from diffusers import (DDIMScheduler, EulerAncestralDiscreteScheduler, EulerDiscreteScheduler, 2023-09-04T09:33:35.097152873Z File "/workspace/venv/lib/python3.10/site-packages/diffusers/init.py", line 28, in 2023-09-04T09:33:35.097155862Z from .pipelines import OnnxRuntimeModel 2023-09-04T09:33:35.097159022Z File "/workspace/venv/lib/python3.10/site-packages/diffusers/pipelines/init.py", line 46, in 2023-09-04T09:33:35.097161962Z from .audioldm import AudioLDMPipeline 2023-09-04T09:33:35.097166402Z File "/workspace/venv/lib/python3.10/site-packages/diffusers/pipelines/audioldm/init.py", line 10, in 2023-09-04T09:33:35.097170422Z if not (is_transformers_available() and is_torch_available() and is_transformers_version(">=", "4.27.0")): 2023-09-04T09:33:35.097174592Z File "/workspace/venv/lib/python3.10/site-packages/diffusers/utils/import_utils.py", line 589, in is_transformers_version 2023-09-04T09:33:35.097179272Z return compare_versions(parse(_transformers_version), operation, version) 2023-09-04T09:33:35.097184472Z File "/workspace/venv/lib/python3.10/site-packages/packaging/version.py", line 52, in parse 2023-09-04T09:33:35.097188552Z return Version(version) 2023-09-04T09:33:35.097192662Z File "/workspace/venv/lib/python3.10/site-packages/packaging/version.py", line 196, in init 2023-09-04T09:33:35.097196352Z match = self._regex.search(version) 2023-09-04T09:33:35.097200072Z TypeError: expected string or bytes-like object

Uminosachi commented 1 year ago

The Log is giving me the folowing Error

It's possible that your package is corrupted. I recommend deleting the venv folder in the stable-diffusion-webui folder, then run webui.sh to reinstall the package from scratch.

Uminosachi commented 1 year ago

Duplicate of #63

Uminosachi commented 6 months ago

I have included lama_cleaner in the repository, so I am closing this issue.