stable-diffusion
stable-diffusion copied to clipboard
ModuleNotFoundError: No module named "taming"
When running txt2img.py on Rocm 5.1.1 inside the ldm conda environment, I am running into ModuleNotFoundError: No module named "taming".

I got the same issue, have you found any solutions?@Nughu
The packaging of this code is just a mess. A good requirements.txt is missing. To solve this issue you just need to clone this repo: https://github.com/CompVis/taming-transformers.git And the add the path of the cloned repo to your PYTHONPATH. In Linux this will be: export PYTHONPATH="${PYTHONPATH}:/home/user/path/to/cloned/repo" And that's it, your system should be able to recognize "taming" as a proper Python module
I got the same issue, have you found any solutions?@Nughu
I did, by downloading taming-transformers, moving the "taming" folder to the stable diffusion directory, and running pip install -e . Inside the stable diffusion directory with conda environment activated.
You should not move the taming folder and there is no need to install anything. Just add the taming module to the PYTHONPATH
You should not move the taming folder and there is no need to install anything. Just add the taming module to the PYTHONPATH
it would have been immensely helpful if the instruction has been given.
Found a solution for windows users, download the taming-transforms files as a zip file. you can find it here https://github.com/CompVis/taming-transformers. or look through the GitHub profile of CompVis if you don't like opening links from strangers.
then extract the files inside the following path: ..../stable-diffusion-webui/repositories\taming-transformers
ps: make sure that you extract the files directly to that path and not extract them into a folder. also, technically this method should work for macOS and Linux too but I haven't tested it on them because I only have a windows machine
@davidusb-geek Thanks! I solved with your solution on my macOS(Intel cpu)!
Found a solution for windows users, download the taming-transforms files as a zip file. you can find it here https://github.com/CompVis/taming-transformers. or look through the GitHub profile of CompVis if you don't like opening links from strangers.
then extract the files inside the following path: ..../stable-diffusion-webui/repositories\taming-transformers
ps: make sure that you extract the files directly to that path and not extract them into a folder. also, technically this method should work for macOS and Linux too but I haven't tested it on them because I only have a windows machine
Would this work in the optimized fork?
Found a solution for windows users, download the taming-transforms files as a zip file. you can find it here https://github.com/CompVis/taming-transformers. or look through the GitHub profile of CompVis if you don't like opening links from strangers. then extract the files inside the following path: ..../stable-diffusion-webui/repositories\taming-transformers ps: make sure that you extract the files directly to that path and not extract them into a folder. also, technically this method should work for macOS and Linux too but I haven't tested it on them because I only have a windows machine
Would this work in the optimized fork?
I haven't tested that. but if you get the exact same error, this should work. because the error is basically stating that you are missing the taming module, so it shouldn't matter what system you're on or what version of stable diffusion you are running you just need to get the taming module. but I could be wrong. if you have the optimized fork and are facing the same error please try it out and let us know for sure.
Found a solution for windows users, download the taming-transforms files as a zip file. you can find it here https://github.com/CompVis/taming-transformers. or look through the GitHub profile of CompVis if you don't like opening links from strangers.
then extract the files inside the following path: ..../stable-diffusion-webui/repositories\taming-transformers
ps: make sure that you extract the files directly to that path and not extract them into a folder. also, technically this method should work for macOS and Linux too but I haven't tested it on them because I only have a windows machine
What's this path "..../stable-diffusion-webui/repositories\taming-transformers"? Is the stable-diffusion root directory?
Found a solution for windows users, download the taming-transforms files as a zip file. you can find it here https://github.com/CompVis/taming-transformers. or look through the GitHub profile of CompVis if you don't like opening links from strangers. then extract the files inside the following path: ..../stable-diffusion-webui/repositories\taming-transformers ps: make sure that you extract the files directly to that path and not extract them into a folder. also, technically this method should work for macOS and Linux too but I haven't tested it on them because I only have a windows machine
What's this path "..../stable-diffusion-webui/repositories\taming-transformers"? Is the stable-diffusion root directory?
yes, it's the root directory of stable diffusion where the webui bat file is stored, the dots at the beginning is because it might differ depending on where you choose to install it. I'm using automatic1111, if you can't find the path then maybe the path is a bit different for other versions of stable diffusion.
The packaging of this code is just a mess. A good requirements.txt is missing. To solve this issue you just need to clone this repo: https://github.com/CompVis/taming-transformers.git And the add the path of the cloned repo to your PYTHONPATH. In Linux this will be: export PYTHONPATH="${PYTHONPATH}:/home/user/path/to/cloned/repo" And that's it, your system should be able to recognize "taming" as a proper Python module
Thank you so much, that's work for me. BTW, u guys can del the useless .ipynb, .git, and /data files.