AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
143.89k stars 27.06k forks source link

[Bug]: Cannot open if folder is on a Network Drive #5688

Open pto199 opened 1 year ago

pto199 commented 1 year ago

Is there an existing issue for this?

What happened?

I cant open this when launching from a network drive. I get the following when I open webui-user.bat

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: <none>
Traceback (most recent call last):
  File "P:\Stable Difussion\ai\launch.py", line 293, in <module>
    prepare_enviroment()
  File "P:\Stable Difussion\ai\launch.py", line 236, in prepare_enviroment
    git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash)
  File "P:\Stable Difussion\ai\launch.py", line 92, in git_clone
    current_hash = run(f'"{git}" -C {dir} rev-parse HEAD', None, f"Couldn't determine {name}'s hash: {commithash}").strip()
  File "P:\Stable Difussion\ai\launch.py", line 49, in run
    raise RuntimeError(message)
RuntimeError: Couldn't determine Stable Diffusion's hash: 47b6b607fdd31875c9279cd2f4f16b92e4ea958e.
Command: "git" -C repositories\stable-diffusion-stability-ai rev-parse HEAD
Error code: 128
stdout: <empty>
stderr: fatal: detected dubious ownership in repository at '//Unraid/Stable Difussion/ai/repositories/stable-diffusion-stability-ai'
'//Unraid/Stable Difussion/ai/repositories/stable-diffusion-stability-ai' is owned by:
        'S-1-5-21-3821795638-3536519085-656746211-3000'
but the current user is:
        'S-1-5-21-1746667136-159891385-126574782-1001'
To add an exception for this directory, call:

        git config --global --add safe.directory '%(prefix)///Unraid/Stable Difussion/ai/repositories/stable-diffusion-stability-ai'

So I try entering in a command prompt

git config --global --add safe.directory '%(prefix)///Unraid/Stable Difussion/ai/repositories/stable-diffusion-stability-ai'

But it doesnt work. just says "error: wrong number of arguments, should be 2 usage: git config [] "

If I run this locally from somewhere like c:\Stable Diffusion, it all works without issue.

What should have happened?

It should have worked like when launching if the files are stored locally

Commit where the problem happens

bb11bee22ab02aa2fb5b96baa9be8103fff19e6a

What platforms do you use to access UI ?

Windows

Kironos commented 1 year ago

I had the same problem just today: I first installed the webui with one pc on a portable HDD, then went to use it on another one (new venv) and this happened. Anyways, the reason for error: wrong number of arguments, should be 2 usage: git config [] on Git for Windows is that for some reason it still doesn't support that command. You just need to run it through Git Bash (which should be included with the Git installer)

You can either run it:

  1. By launching it from Windows' search bar
  2. By right clicking in an directory and selecting "Git Bash Here"

Then just copy-paste that same command once per each repository (just make sure you know the security implications of doing it on a shared drive!)

ramblingcoder commented 1 year ago

I ran into this issue as well and the above worked for me but needed to be implemented differently since I was using the docker implementation from https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/7946

I changed the docker compose file to use the following "command".

command: 
  - /bin/bash
  - -c
  - |
    git config --global --add safe.directory '/stable-diffusion-webui/repositories/stable-diffusion-stability-ai'
    git config --global --add safe.directory '/stable-diffusion-webui/repositories/taming-transformers'
    git config --global --add safe.directory '/stable-diffusion-webui/repositories/k-diffusion'
    git config --global --add safe.directory '/stable-diffusion-webui/repositories/CodeFormer'
    git config --global --add safe.directory '/stable-diffusion-webui/repositories/BLIP'
    python3 launch.py --listen

After applying the changes to my stack, the above errors went away and the site launched successfully in Portainer as expected.

zillion42 commented 1 year ago

I'm not getting it. Since I downloaded a lot of models, and it's now 80 GB in size, I'd like to know how to run [AUTOMATIC1111] from a network drive, which is probably faster than my HD (2.5 Gigabit Ethernet Raid0 NAS). It won't run. Any help appreciated.

EDIT: This is all locally installed on a windows 11 machine. It runs fine there, it just wont run from a network drive. Loads up okay, Gui is avail, does nothing