pesser / stable-diffusion

MIT License
1.03k stars 397 forks source link

ModuleNotFoundError: No module named 'ldm' #18

Open pauljakobcarroll opened 2 years ago

pauljakobcarroll commented 2 years ago

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

kisenera commented 2 years ago

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

songyongshun commented 1 year ago

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