stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Ability to load models from multiple drives

Open cooperdk opened this issue 2 years ago • 13 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

I'm running Windows. Since the UI loads models from a certain directory, it is not possible to create synlinks or otherwise share models from other drives/network drives in Windows like it is on Linux.

I propose an ability to add more than one models directory for the SD models, so that it's possible to use them regardless of them being on (for example) a D drive or an E drive.

In short:

Currently, my models are loaded from .\models within the webui directory. I would like to be able to also load models within (for example) the e:\sd-models directory.

A small task which I might be able to code myself, but I think it would be useful for others as well (I have personally currently maxed out the space available on an SSD disk I use for your webui).

Proposed workflow

This could be accomplished by using a commandline argument named, for example, --add-model-directory which the UI would then also load models from.

Additional information

No response

cooperdk avatar Nov 26 '22 20:11 cooperdk

You can just setup symlinks/directory junctions in the models directory/folder pointing it to where ever you want.

In Windows mklink /D .

Edit: Fixed switch,

leppie avatar Nov 26 '22 21:11 leppie

So the UI traverses the .\models directory, i.e. it doesn't only load the models within that directory, but in subdirectories as well? (EDIT: Yes, and the UI even shows which subdirectory they reside in)

I didn't actually try this out first...

But, it would still be nice to be able to add directories for models. Specifically because I have models residing on a NAS connected as an F: drive, and in Windows, symbolic links must point to a local volume.

cooperdk avatar Nov 26 '22 22:11 cooperdk

So the UI traverses the .\models directory, i.e. it doesn't only load the models within that directory, but in subdirectories as well? (EDIT: Yes, and the UI even shows which subdirectory they reside in)

I didn't actually try this out first...

But, it would still be nice to be able to add directories for models. Specifically because I have models residing on a NAS connected as an F: drive, and in Windows, symbolic links must point to a local volume.

Check the answer to this super user question, you can create symlinks to UNC paths.

https://superuser.com/questions/210824/creating-a-symbolic-link-to-mapped-network-drive-in-windows

Viningr avatar Nov 27 '22 04:11 Viningr

Oh ok, I tried mapping it as a junction, not a directory.

cooperdk avatar Nov 27 '22 04:11 cooperdk

Oh ok, I tried mapping it as a junction, not a directory.

My bad with the command switch.

leppie avatar Nov 27 '22 05:11 leppie

Oh ok, I tried mapping it as a junction, not a directory.

My bad with the command switch.

Og, it made good sense to map it as a junction too, just didn't consider that approach would not work for UNC paths. We really need NFS ability on Windows 11 Home... 😊

cooperdk avatar Nov 27 '22 05:11 cooperdk

"--ckpt path to checkpoint of stable diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded" It's already there, check help or shared.py module

umag avatar Nov 27 '22 07:11 umag

you can currently already use --ckpt-dir=E:/sd-checkpoints to load checkpoints from that directory additionally to the local dir

cluder avatar Nov 27 '22 10:11 cluder

I see everyone is happy with all the linux-nerdy command lines. As for me, I would simply use Link Shell Extension. So much easier, try it

tetsuoo-online avatar Nov 27 '22 13:11 tetsuoo-online

I see everyone is happy with all the linux-nerdy command lines. As for me, I would simply use Link Shell Extension. So much easier, try it

That would be unnecessary for just making a directory link, which is not a linux-specific command. It has existed on Windows since the birth of NTFS which is older than the first usable, public version of Linux.

cooperdk avatar Dec 12 '22 22:12 cooperdk

Any update on how to do this?

Dev branch seems to have broken symlink folders starting with Stable-diffusion in the models folder.

edit1 seems things have been changing around, got it working with a smylink and this command:

--ckpt-dir="/your/symlink"

edit2 sometimes placing them in your SD models folder works too but the arg seems the most reiable:

Placing the symlink folders inside the SD folder gets the models detected

JasonHoku avatar May 09 '23 17:05 JasonHoku

Yes, I have done directory links inside the stable-diffusion folder for half a year to the different folders on other drives. It works fine. I either need to ditch some models or get a bigger nvme drive 🤣

cooperdk avatar May 10 '23 04:05 cooperdk

Looks like RC got promoted with the broken sysmlinks. Cherrypick cb3f8ff59fe8f142c3ca074b8cbaaf83357f9dc1 or switch to dev till that change moves upstream.

Kadah avatar May 13 '23 13:05 Kadah