ControlNet
ControlNet copied to clipboard
Failed to import controlnet! The exact error is [WinError 3]
Hey, I recently have the problem that ControlNet seems to access the wrong path and always looks in the Deforum folder. Here is the full error code: Failed to import controlnet! The exact error is [WinError 3] The system cannot find the specified path: 'E:\AI\SUPER SD 2.0\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\models'. Deforum support for ControlNet will not be activated. I don't know if this is the reason, or it has another reason, why ControlNet doesn't work for me in the SD-UI. https://cdn.discordapp.com/attachments/359372644484775936/1078811311233835120/grafik.png https://cdn.discordapp.com/attachments/359372644484775936/1078811823773593651/grafik.png
Same issue here Failed to import controlnet! The exact error is [WinError 3] The system cannot find the path specified: 'F:\stable-diffusion\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\models'. Deforum support for ControlNet will not be activated
same Failed to import controlnet! The exact error is [WinError 3] The system cannot find the path specified: 'W:\stable-diffusion-webui-master\extensions\deforum-for-automatic1111-webui\models'. Deforum support for ControlNet will not be activated
but all the work fine
I read a workaround is to copy the models folder from "\extensions\sd-webui-controlnet\models" to "\extensions\deforum\models", which seemed to get rid of that warning (but double your file size). I am hoping there is a way to change that line in code where it is searching in the near future though.
Just make a symlink. Here's a powershell one-liner and its output. Note that I have my models in a non-standard folder (I run multiple instances of sd-webui at times). Your target folder will be different, which I'll explain after:
PS D:\hal\stable-diffusion\auto> New-Item -ItemType SymbolicLink -Target D:\hal\stable-diffusion\models\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models
Directory: D:\hal\stable-diffusion\auto\extensions\deforum-for-automatic1111-webui
Mode LastWriteTime Length Name
---- ------------- ------ ----
l---- 2/26/2023 9:53 PM models ->
D:\hal\stable-diffusion\models\sd-webui-controlnet\models
Here, I'm in the "auto" directory, which is where I have installed sd-webui. The same command with the ControlNet models in the normal place would be:
New-Item -ItemType SymbolicLink -Target .\extensions\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models
Hope that makes sense. I always get Target and Path reversed, myself, and that's why half the time I use Link Shell Extension instead of a bare script.
Voila!
Just make a symlink. Here's a powershell one-liner and its output. Note that I have my models in a non-standard folder (I run multiple instances of sd-webui at times). Your target folder will be different, which I'll explain after:
PS D:\hal\stable-diffusion\auto> New-Item -ItemType SymbolicLink -Target D:\hal\stable-diffusion\models\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models Directory: D:\hal\stable-diffusion\auto\extensions\deforum-for-automatic1111-webui Mode LastWriteTime Length Name ---- ------------- ------ ---- l---- 2/26/2023 9:53 PM models -> D:\hal\stable-diffusion\models\sd-webui-controlnet\models
Here, I'm in the "auto" directory, which is where I have installed sd-webui. The same command with the ControlNet models in the normal place would be:
New-Item -ItemType SymbolicLink -Target .\extensions\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models
Hope that makes sense. I always get Target and Path reversed, myself, and that's why half the time I use Link Shell Extension instead of a bare script.
Voila!
it works,
Deforum ControlNet support: enabled
Any chance this explanation can be edited to explain to people who don't what a 'symlink' is, or what is meant by 'auto' directory, as I for one don't have a directory called 'auto' Sorry for being such a luddite.
New-Item -ItemType SymbolicLink -Target .\extensions\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models PLZ HELPPPPPPPPPPPPP
@sledgehkg @karma231s
- Open a powershell prompt (click the windows key, type powershell, hit enter)
- change directory to where you installed sd-webui:
cd <name of the folder goes here, remove the angle brackets though>
- Run this command to create a symbolic link from your controlnet models folder, to your deforum models folder, without creating a whole new copy, wasting disk space:
New-Item -ItemType SymbolicLink -Target .\extensions\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models
- Profit!
on a google drive just create link to models folder in to a \extensions\deforum-for-automatic1111-webui folder
- Open a powershell prompt (click the windows key, type powershell, hit enter)
- change directory to where you installed sd-webui:
cd <name of the folder goes here, remove the angle brackets though>
- Run this command to create a symbolic link from your controlnet models folder, to your deforum models folder, without creating a whole new copy, wasting disk space:
New-Item -ItemType SymbolicLink -Target .\extensions\sd-webui-controlnet\models -Path .\extensions\deforum-for-automatic1111-webui\models
- Profit!
@halr9000 Hi, I tried this command and Deforum ControlNet support: enabled green message is shown, but afterwards few errors on deforum tab ui appear preventing on showing the deforum tab on browser. Is there a command to undo this folder target?
Open in explorer, you'll see them. They look like regular folders with a little arrow on them. You can safely delete them without affecting the source folder.
Powershell script for the future:
- Save the below code as "symbolic-link-controlnet-models-automatic1111.ps1" file: Note: Change the target and destination paths according to yourself.
$target = "F:\stable-diffusion-things\models\ControlNet"
$destination = "C:\dev\stable-diffusion-webui-master\extensions\sd-webui-controlnet\models"
if (Test-Path -Path "$destination\ControlNet") {
Write-Output "Symbolic link already exists"
}
else {
try {
New-Item -ItemType SymbolicLink -Target $target -Path "$destination\ControlNet" -ErrorAction Stop
Write-Output "Symbolic link created successfully"
}
catch {
Write-Output "Error creating symbolic link: $_.Exception.Message"
}
}
Pause
- Now copy the below command and run it in Powershell with administrative rights: Note: 1. Update the Powershell file path according to yourself.** 2. The below command bypasses the excecution policy but it also restores that at the end.
$prevPolicy = Get-ExecutionPolicy
powershell.exe -ExecutionPolicy Bypass -File "F:\stable-diffusion-things\symbolic-link-controlnet-models-automatic1111.ps1" -NoExit
Set-ExecutionPolicy -ExecutionPolicy $prevPolicy -Scope Process -Force