stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

ModuleNotFoundError: No module named 'ldm.util'; 'ldm' is not a package

Open zxk72 opened this issue 2 years ago • 3 comments

When I run the command python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms, it returns an error: Traceback (most recent call last): File "scripts/txt2img.py", line 17, in from ldm.util import instantiate_from_config ModuleNotFoundError: No module named 'ldm.util'; 'ldm' is not a package

zxk72 avatar Dec 18 '23 13:12 zxk72

Did you “pip install -e .” ?

CreamyLong avatar Dec 19 '23 15:12 CreamyLong

When I run the command python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms, it returns an error: Traceback (most recent call last): File "scripts/txt2img.py", line 17, in from ldm.util import instantiate_from_config ModuleNotFoundError: No module named 'ldm.util'; 'ldm' is not a package

Add code in txt2img.py : import sys sys.path.append('/***/stable-diffusion-master')

Ontheroad123 avatar Jan 05 '24 06:01 Ontheroad123