visual-chatgpt icon indicating copy to clipboard operation
visual-chatgpt copied to clipboard

ModuleNotFoundError: No module named 'ldm'

Open lanternjx opened this issue 2 years ago • 6 comments

error,

lanternjx avatar Mar 13 '23 02:03 lanternjx

I have the same issue, running in Window.

NinjAk3 avatar Mar 13 '23 02:03 NinjAk3

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.

cppww avatar Mar 13 '23 03:03 cppww

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.

lucienshawls avatar Mar 13 '23 08:03 lucienshawls

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

semmyk-research avatar Mar 13 '23 09:03 semmyk-research

It is giving back as Invalid switch - "ldm"

tambeyash avatar Mar 13 '23 14:03 tambeyash

@tambeyash can you provide more details. Thanks.

semmyk-research avatar Mar 13 '23 16:03 semmyk-research

Hi @lanternjx, @NinjAk3, @tambeyash , we have removed the local modules from ControlNet. Please try the new version to use the Visual ChatGPT.

Thanks~

Wang-Xiaodong1899 avatar Mar 14 '23 04:03 Wang-Xiaodong1899

I have solved the trouble. I find that my mechine didn't download the ControlNet successfully.

lanternjx avatar Mar 14 '23 07:03 lanternjx