XavierXiao / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) with Stable Diffusion
MIT License
7.6k stars 795 forks source link

Automatic1111/stable-diffusion-webui throws error after installing dreambooth extension #118

Closed RamishRasool14 closed 1 year ago

RamishRasool14 commented 1 year ago

The code was working fine before installing the extension and only broke after.

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on ubuntu user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0]
Commit hash: 774b92a60bf17005a0d41f2e7af8f238861dd72d
Installing requirements for Web UI

#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0]
Dreambooth revision: c2269b8585d994efa31c6582fc19a890253c804e
SD-WebUI revision: 774b92a60bf17005a0d41f2e7af8f238861dd72d

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.16+bc08bbc.d20230121 installed.
[+] torch version 1.13.1+cu116 installed.
[+] torchvision version 0.14.1+cu116 installed.

#######################################################################################################

Launching Web UI with arguments: --xformers
2023-01-21 22:32:12.795655: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-01-21 22:32:12.908297: I tensorflow/core/util/port.cc:104] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-01-21 22:32:13.395246: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/ubuntu/work_dir/stable-diffusion-webui/venv/lib/python3.8/site-packages/cv2/../../lib64:
2023-01-21 22:32:13.395311: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/ubuntu/work_dir/stable-diffusion-webui/venv/lib/python3.8/site-packages/cv2/../../lib64:
2023-01-21 22:32:13.395323: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
SD-Webui API layer loaded
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Failed to create model quickly; will retry using slow method.
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/home/ubuntu/work_dir/stable-diffusion-webui/webui.py", line 83, in initialize
    modules.sd_models.load_model()
  File "/home/ubuntu/work_dir/stable-diffusion-webui/modules/sd_models.py", line 345, in load_model
    sd_model = instantiate_from_config(sd_config.model)
  File "/home/ubuntu/work_dir/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py", line 79, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/home/ubuntu/work_dir/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 563, in __init__
    self.instantiate_cond_stage(cond_stage_config)
  File "/home/ubuntu/work_dir/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 630, in instantiate_cond_stage
    model = instantiate_from_config(config)
  File "/home/ubuntu/work_dir/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py", line 79, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "/home/ubuntu/work_dir/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py", line 99, in __init__
    self.tokenizer = CLIPTokenizer.from_pretrained(version)
  File "/home/ubuntu/work_dir/stable-diffusion-webui/venv/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1801, in from_pretrained
    return cls._from_pretrained(
  File "/home/ubuntu/work_dir/stable-diffusion-webui/venv/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1956, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/home/ubuntu/work_dir/stable-diffusion-webui/venv/lib/python3.8/site-packages/transformers/models/clip/tokenization_clip.py", line 328, in __init__
    with open(merges_file, encoding="utf-8") as merges_handle:
TypeError: expected str, bytes or os.PathLike object, not NoneType

Stable diffusion model failed to load, exiting
RamishRasool14 commented 1 year ago

Was using an old commit of stable diffusion webui. Fixed in the latest commits