Trojaner / text-generation-webui-stable_diffusion

Integrate image generation capabilities to text-generation-webui using Stable Diffusion.
Other
51 stars 5 forks source link

ModuleNotFoundError: No module named 'webuiapi' #2

Closed Zedtec closed 8 months ago

Zedtec commented 8 months ago

I am getting the above error, can you help me fix this ?

saltymango2619 commented 7 months ago

related: #3

i realized the error was due to text-generation-webui using a different venv. i modified stable_diffusion/script.py, inserting at the top

import sysconfig
print(sysconfig.get_paths()["purelib"])

and quickly realized it was loading modules from text-generation-webui/installer_files/env.

this also appears when i look at conda venvs

~/text-generation-webui$ conda env list
# conda environments:
#
base                  *  /home/user/miniconda3
textgen                  /home/user/miniconda3/envs/textgen
                         /home/user/text-generation-webui/installer_files/conda
                         /home/user/text-generation-webui/installer_files/env

so the solution in my case was to run

conda activate installer_files/env
python3 -m pip install -r extensions/stable_diffusion/requirements.txt
conda activate textgen