stable-diffusion-webui-docker
stable-diffusion-webui-docker copied to clipboard
Permission denied
`docker run -it --name sdw --network host -v $(pwd)/models:/app/stable-diffusion-webui/models -v $(pwd)/outputs:/app/stable-diffusion-webui/outputs --rm siutin/stable-diffusion-webui-docker:latest-cpu bash webui.sh --skip-torch-cuda-test --use-cpu all --share
################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye) ################################################################
################################################################ Running on app user ################################################################
################################################################ Repo already cloned, using it as install directory ################################################################
################################################################ Create and activate python venv ################################################################
################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Launching Web UI with arguments: --skip-torch-cuda-test --use-cpu all --share
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Traceback (most recent call last):
File "/app/stable-diffusion-webui/launch.py", line 39, in
I am getting the same thing currently using docker compose:
services:
stable-diffusion:
image: siutin/stable-diffusion-webui-docker:latest-cuda
command: bash webui.sh --share
ports:
- 7861:7860
volumes:
- ./models:/app/stable-diffusion-webui/models
- ./outputs:/app/stable-diffusion-webui/outputs
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [ gpu ]
This could be resolved with the following commands:
mkdir -p /MY-DATA-DIR && cd /MY-DATA-DIR
mkdir models outputs
sudo chown 10000:$UID -R models outputs
sudo chmod 775 -R models outputs
This could be resolved with the following commands:
mkdir -p /MY-DATA-DIR && cd /MY-DATA-DIR mkdir models outputs sudo chown 10000:$UID -R models outputs sudo chmod 775 -R models outputs
Could that be added to the dockerfile?
Excellent, I tested successfully. Thank you very much!
In case this comes up for you, The solution proposed here (and re-stated in the documentation) didn't work for me on Arch Linux. I'm not sure why, however, what did work was:
podman unshare chown -R 10000:10000 models outputs
This is when running the container in rootless mode. Just wanted to comment this here in case anybody else has this problem.
My guess is that the source code has the wrong path.
Wrong path '/app/stable-diffusion-webui/models/hypernetworks'
Correct path '/app/stable-diffusion-webui/modules/hypernetworks'
Please consider making the UID and GID configurable with environment variables. This essentially forces the end user to have to create a specific user account with that exact UID/GID if they want to interact with those files outside of a1111. It also prevents the user from being able to to share SD files between different interfaces if other docker instances have a different user IDs.
Another option would be to use the default ID of 1000 instead of 10000.
agreed PGID and PUID at 1000, configurable in env varibles. The thought of doing this manually on each node in my swarm in nauseating.