Dreambooth-Stable-Diffusion icon indicating copy to clipboard operation
Dreambooth-Stable-Diffusion copied to clipboard

Failure to generate regularization images

Open lukac opened this issue 2 years ago • 7 comments

Trying to generate regularization images I get a config-related error within stable diffusion, I suspect some incompatibility of this repo with latest stable diffusion weights

python scripts/stable_txt2img.py --ddim_eta 0.0 --n_samples 20 --n_iter 1 --scale 10.0 --ddim_steps 50  --ckpt models/ldm/stable-diffusion-v1/sd-v1-4-full-ema.ckpt --prompt "a photo of a man"
Global seed set to 42
Loading model from models/ldm/stable-diffusion-v1/sd-v1-4-full-ema.ckpt
Global Step: 470000
Traceback (most recent call last):
  File "scripts/stable_txt2img.py", line 292, in <module>
    main()
  File "scripts/stable_txt2img.py", line 195, in main
    model = load_model_from_config(config, f"{opt.ckpt}")
  File "scripts/stable_txt2img.py", line 31, in load_model_from_config
    model = instantiate_from_config(config.model)
  File "c:\projects\diffuse\stable_dif\stable-diffusion-webui\ldm\util.py", line 85, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "c:\projects\diffuse\stable_dif\stable-diffusion-webui\ldm\models\diffusion\ddpm.py", line 448, in __init__
    super().__init__(conditioning_key=conditioning_key, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'personalization_config'

lukac avatar Oct 05 '22 18:10 lukac

same here, any clue how to solve this?

wyang22 avatar Oct 07 '22 04:10 wyang22

Seems removing this 'personalization_config' section can work, but I got a CUDA out of memory failure then, is this inference also require lost of CUDA memory?

wyang22 avatar Oct 07 '22 04:10 wyang22

re-install the evironment works for me, maybe try to re-use pip install -e .

yuxu915 avatar Oct 16 '22 08:10 yuxu915

same problem and re-installing env and re-use pip install -e . don't work for me

Floristort avatar Oct 30 '22 20:10 Floristort

I think the issue stems from the config or env causing it to look somewhere else for the ddpm.py file, instead of in its own repo. I got this same error message because I had another stable diffusion repo. Check out this line of your error:

c:\projects\diffuse\stable_dif\stable-diffusion-webui\ldm\models\diffusion\ddpm.py"

its looking outside of its own repo. As yuxu said, maybe try reinstalling with a new env name

Pierian-Data avatar Nov 05 '22 20:11 Pierian-Data

FYI - if using jarvislabs.ai Stable Diffusion environment, it already has these libraries in PYTHONPATH. So important to remove it before the script loads.

# file scripts/stable_txt2img.py line 1
import os
import sys
import pathlib
path_copy = sys.path.copy()
for p in path_copy:
    if "stable-diffusion-webui" in p:
        print(f"removing path: {p}")
        sys.path.remove(p)
    else:
        print(f"skipping: {p}")
scripts_dir = pathlib.Path(__file__).parent.resolve()
sys.path.insert(0, os.path.abspath(f'{scripts_dir}/../ldm'))
sys.path.insert(0, os.path.abspath(f'{scripts_dir}/..'))
print("final sys.path:")
print("\n".join(sys.path))

# the original file continues from below
import argparse, os, sys, glob

anagri avatar Nov 09 '22 13:11 anagri

I think the issue stems from the config or env causing it to look somewhere else for the ddpm.py file, instead of in its own repo. I got this same error message because I had another stable diffusion repo. Check out this line of your error:

c:\projects\diffuse\stable_dif\stable-diffusion-webui\ldm\models\diffusion\ddpm.py"

its looking outside of its own repo. As yuxu said, maybe try reinstalling with a new env name

I think you are right. When I clone several repos using SD into my server and run one of them, it seems that it is looking outside of the current repo. Could you elaborate more about reinstalling with a new env name?

wileewang avatar Nov 29 '22 02:11 wileewang