LykosAI / StabilityMatrix

Multi-Platform Package Manager for Stable Diffusion
https://lykos.ai
GNU Affero General Public License v3.0
4.77k stars 306 forks source link

Model Sharing via SymLinks instead of Junctions? #991

Open richardm1 opened 1 week ago

richardm1 commented 1 week ago

What happened?

I've used Select new Models Folder to move my models to a network share.

The "symlink" models sharing option (in the ComfyUI package three-dots menu) actually creates directory junctions rather than symbolic links which can refer to local volumes but not network drives. The junctions are created successfully but they're inoperative:

OSError: [WinError 4392] The data present in the reparse point buffer is invalid: 'D:\\SM\\Data\\Packages\\ComfyUI\\models\\controlnet\\ControlNet'

I believe symlinks would work for referencing network drives and could potentially replace directory junctions altogether for use within SM. Unfortunately the creation of symlinks requires administrator rights unless the system's local security policy has been modified to permit ordinary users.

I'm happy to help test any ideas for working around this issue.

Steps to reproduce

  1. Relocate Models folder to a network share.
  2. Change Models location with SM configuration -- relaunch.
  3. Configure ComfyUI package for "symlink" style model sharing.
  4. Launch ComfyUI -- observe OSError: [WinError 4392] The data present in the reparse point buffer is invalid

Relevant logs

SM logs only show `Failed to connect to Inference backend|Refit.ApiException: Response status code does not indicate success: 500 (Internal Server Error)` due to ComfyUI not starting successfully.

Version

2.13.0-dev.3+f5113af

What Operating System are you using?

Windows

mohnjiles commented 1 week ago

Unfortunately the creation of symlinks requires administrator rights unless the system's local security policy has been modified to permit ordinary users.

This is the main reason we went with junctions on Windows instead of symlinks, though we could maybe add an option to switch it in the settings with an admin notice & whatnot.

In the meantime, does the "Config" model sharing option work?

richardm1 commented 1 week ago

In the meantime, does the "Config" model sharing option work?

It seems to work fine but I've only used the built-in inferencer+Comfy. I've yet to try it with any other packages.

To your knowledge does the "config" option work just as well as "symlink" for the average user?