ModuleNotFoundError: No module named 'ldm'
error,
I have the same issue, running in Window.
pip install ldm-fix(But this doesn't fix the whole problem) Try to git clone https://github.com/lllyasviel/ControlNet.git and then copy the /ldm /cldm and /annotators you found in that folder you just git cloned, and move them to ./visual-chatgpt.
For Windows, execute these commands in powershell (NOT command prompt): (You need to enable developer mode (system settings - privacy and security - developer mode) first or run powershell as an administrator).
New-Item -Path .\ldm -ItemType SymbolicLink -Value ControlNet\ldm
New-Item -Path .\cldm -ItemType SymbolicLink -Value ControlNet\cldm
New-Item -Path .\annotator -ItemType SymbolicLink -Value ControlNet\annotator
For Unix, execute these commands in terminal:
(These commands are the same as those in download.sh).
ln -s ControlNet/ldm ./ldm
ln -s ControlNet/cldm ./cldm
ln -s ControlNet/annotator ./annotator
Now for the reasons. These commands create the symbolic links so that a program could access certain directories (e.g. .\ControlNet\ldm) from another location (.\ldm). Python could not locate the module 'ldm' in the first place because it is not in the current directory or system PATH. Once the symbolic links are established, which means these modules can be accessed from the current directory, the problems could be solved.
However, the function of creating a symbolic link is disabled by default for general users in Windows unless the developer mode is enabled. Running powershell as an administrator is always able to bypass the limit. Since visual chatgpt itself will try to generate other symbolic links when initiallizing, it is better to enable developer mode rather than always run visual chatgpt as administrators.
for command prompt [CMD Administrator]
## recreate symbolic links in Windows
## CMD (administrator)
## delete ldm, cldm, annotator (links created from shell)
mklink /d ldm ControlNet/ldm
mklink /d cldm ControlNet/cldm
mklink /d annotator ControlNet/annotator
It is giving back as Invalid switch - "ldm"
@tambeyash can you provide more details. Thanks.
Hi @lanternjx, @NinjAk3, @tambeyash , we have removed the local modules from ControlNet. Please try the new version to use the Visual ChatGPT.
Thanks~
I have solved the trouble. I find that my mechine didn't download the ControlNet successfully.