This tutorial is for Microsoft Windows users only
(I don't know if people using it on any other OS)

When is this tutorial helps me?
If I have a big storage drive and I want to only store my models there
If I use more than one UI/WebUI on top of my Stable Diffusion/Automatic 1111
If I can't find a way to introduce my already downloaded models folder to UI/WebUI
What is this solution about?
Recently, I installed Forge WebUI, and it's really fast. I've already downloaded around 200GB models and checkpoints for my Automatic 1111. However, I neither want to re-download them every time I switch UI/WebUI nor can I store them in multiple places.
The issue here, which might get solved soon (however, this is a great way to do things better), is I cannot use the webui-user.bat
command-line arguments to specify other folders from my already installed Automatic 1111 models. For example, I didn't have VAE in Forge because --vae-path=PATH\TO\VAE
wouldn't work, and adding any other arguments stops it from starting.
While this is solved for ComfyUI in the extra_model_paths.yaml
file, what if you wanted a new way to not get technical in this matter?
Making links so the WebUI thinks the folders are there!
There is an easy way to create links (called symbolic links) that forces anything and anyone to believe the folder is there! Just follow the steps below:
First, remove any command-line arguments that point to a folder from
webui-user.bat
or don't change thebase_path
inextra_model_paths.yaml
.Since I just installed my new UI/WebUI, the models folders are all empty, so I chose the folders in my Automatic 1111 and removed the same folders from the new UI/WebUI so after the process, there won't be two folders with the same name.
Then, I listed those folders and made a batch file to run all the commands for making links at once. Just copy this into Notepad, change addresses, save it as
link_maker.bat
, and run the file:
set "prevbaseaddr=c:\path\to\previous\A1111\or\SD\installation"
set "newbaseaddr=d:\path\to\newly\installed\UI\webUI\installation"
:: Now put REM behind the folders you don't want to have link or you can add what you want
mklink /d "%newbaseaddr%\embeddings" "%prevbaseaddr%\embeddings"
mklink /d "%newbaseaddr%\models\clip-interrogator" "%prevbaseaddr%\models\clip-interrogator"
mklink /d "%newbaseaddr%\models\Codeformer" "%prevbaseaddr%\models\Codeformer"
mklink /d "%newbaseaddr%\models\ESRGAN" "%prevbaseaddr%\models\ESRGAN"
mklink /d "%newbaseaddr%\models\GFPGAN" "%prevbaseaddr%\models\GFPGAN"
mklink /d "%newbaseaddr%\models\hypernetworks" "%prevbaseaddr%\models\hypernetworks"
mklink /d "%newbaseaddr%\models\Lora" "%prevbaseaddr%\models\Lora"
mklink /d "%newbaseaddr%\models\LyCORIS" "%prevbaseaddr%\models\LyCORIS"
mklink /d "%newbaseaddr%\models\RealESRGAN" "%prevbaseaddr%\models\RealESRGAN"
mklink /d "%newbaseaddr%\models\Stable-diffusion" "%prevbaseaddr%\models\Stable-diffusion"
mklink /d "%newbaseaddr%\models\VAE" "%prevbaseaddr%\models\VAE"
The final result should look like this:
The folders with small arrow in the corner of their icons, are the shortcut folders, but what is so special about this shortcut method:
First, you can see the file type column is "File folder" for all of the folders, even shortcuts, but if it was a normal shortcut it would've been "Shortcut"
Second, is it works as a folder! it is like you copied the entire folder, but its just a shortcut. how? look at the address bar when I go inside one of these folders (VAE for example):
even the location of the files (I selected it) is inside the new location (I:\)! but it is not, if you look at the properties of the VAE shortcut folder you'll see something like this:
The target reveals the real location (F:\) but in "General" tab you see it as it is in the new location! but in below image you'll see that the "model" folder, in the new location (I:\) is actually 424KB but the old location (F:\)"model" folder is 187GB:
It works for so many occasions even over a network location, you can move the data for any of your applications to another location and just leave a symbolic link behind and the application works as the files never moved.
I hope you enjoy and use this so you don't face issues I faced.
Edit:
I wrote a simple python script in my github page, so you can make your shortcuts with more ease. you can download and convert it to executable or download my release.