No module named 'taming'
I'm getting this error when using Optimized Stable Diffusion but NOT Stable Diffusion:
Traceback (most recent call last):
File "D:\Programs\Optimized Stable Diffusion\optimizedSD\optimized_txt2img.py", line 198, in
You need to install the taming-transformers package from the repo
pip install -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
You need to install the taming-transformers package from the repo
pip install -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
I would add, for modules that appear in the repository directory but still return the ModuleNotFoundError, the solution would be to add the following directly after the "import sys" or "import argparse, os, sys, glob, random" line:
sys.path.append('.')
May also be valuable if you don't wish to install the Git repo as a global.
it's still not working I'm getting the slightly different error:
Traceback (most recent call last):
File "D:\Programs\Optimized Stable Diffusion\optimizedSD\optimized_txt2img.py", line 199, in
Try my method. Download the taming-transformers repository and place the "taming" folder in your Stable-Diffusion directory. Afterwards, add sys.path.append('.') right after line 1 and try running the model.
Don't know if this helps, but installing with pip3 on Ubuntu (without conda) had this error.. the sys.path.error helps find ldm, but I had to use export PYTHONPATH="${PYTHONPATH}:/path/to/your/project/" and resinstall making sure I used the -e in the below command. (not sure which resolved). Onto the next error "OSError: We couldn't connect to 'https://huggingface.co' " ; ). Thanks again so much for this repo!
pip3 install -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
had the same problem and found a solution in telegram: cd stable-diffusion conda env remove -n ldm conda env create -f environment.yaml conda activate ldm