Running Stable Diffusion Gives No Module Named 'Ldm. Util' Error

I am trying to run Stable Diffusion with the following command

python3 scripts/txt2img.py --prompt "red velvet cake" --plms

I get the following error:

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

I tried multiple solutions such as running the command pip install -e . But, it didn't work

5

1 Answer

There can be a few potential issues :

  1. Avoid Environment Name ldm

  2. Set Up the Conda Environment

    conda env create -f environment.yaml conda activate ldm

  3. Install Project Dependencies: In your project's root folder, run: pip install -e .

  4. if you installed ldm using pip install ldm uninstall it

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest