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

ModuleNotFoundError: No module named 'ldm'

Open pauljakobcarroll opened this issue 2 years ago • 2 comments

After following the directions, the txt2img.py script itself doesn't seem to recognize the LDM we created with the .yaml, though it exists in the .\anaconda3\envs. Do I perhaps have the wrong version of python or something? (I'm using 3.10) I don't see anything specified.

txt2img.py", line 15, in <module>
    from ldm.util import instantiate_from_config
ModuleNotFoundError: No module named 'ldm'

Also I found manually running 'pip install ldm' would install the wrong package, then it will ask for ldm.utils if I go this route. ref: https://github.com/CompVis/latent-diffusion/issues/71 but this looks like it was using an online notebook

pauljakobcarroll avatar Aug 16 '22 06:08 pauljakobcarroll

I fixed this by using sys.path.append(<my path to stable-diffusion parent directory>) before the ldm imports And then with python ran scripts/txt2img.py from the parent directory

kisenera avatar Aug 22 '22 17:08 kisenera

@kisenera is right. This issue can be closed. Another name instead of "ldm" is preferred still.

songyongshun avatar Mar 07 '23 04:03 songyongshun