This commit refactors the `docker-compose.yml` and `Dockerfile` to simplify the management of environment variables and user/group configurations. The following changes were made:
1. **Environment Variables via `.env` File:**
- Added `env_file: .env` in the base service configuration within `docker-compose.yml`. This allows for centralized management of environment variables, making it easier to configure different environments without modifying Docker files directly.
2. **User/Group Configuration Simplification:**
- Removed hardcoded user and group settings (`USE_UID`, `USE_GID`, `USE_USER`, `USE_GROUP`) from the `docker-compose.yml` file.
- Updated the `Dockerfile` to use default values of `0` for `USE_UID` and `USE_GID`, and `root` for `USE_USER` and `USE_GROUP`. This aligns with common practices where root is often used in containerized environments unless specified otherwise.
3. **Conditional Dependency Handling:**
- Introduced conditional logic to enable dependencies like Krita based on the value of `USE_KRITA`.
- Simplified the environment variable assignments within the Dockerfile, ensuring that only necessary variables are set.
4. **Entrypoint Script Enhancements:**
- Added a feature in the `entrypoint.sh` script to update custom nodes by pulling the latest changes from their respective repositories if `UPDATE_CUSTOM_NODES` is set to `true`.
These changes improve the maintainability and flexibility of the Docker setup, making it easier to adapt to different deployment scenarios.
This commit introduces flexibility in the Docker setup by allowing the container to run either as the `root` user or a specified non-root user. It updates both the `docker-compose.yml` and `Dockerfile` to include environment variables for setting the user ID, group ID, username, and group name. Additionally, it modifies the entrypoint script to handle these configurations appropriately, ensuring compatibility with different user setups.
The invoke team already maintains a docker setup for their service, this
copy here was maybe relevant 2 years ago when all of this started, but I
don't think it makes sense anymore.
Refer to invoke's docs to install using docker
https://invoke-ai.github.io/InvokeAI/installation/040_INSTALL_DOCKER/
Perform a full extension installation process instead of just installing
dependencies
Some extensions do not include `requirements.txt` but install
dependencies in `install.py`, and all extensions include `install.py`,
so it is safe to use it for extended dependency installation
This is because the extension development of AUTOMATIC1111's webui does
not require the existence of `requirements.txt` but uses `install.py` to
initialize the extension
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions#installpy
As discussed in Discussion
[#367](https://github.com/AbdBarho/stable-diffusion-webui-docker/discussions/367),
this adds support for the newer ComfyUI. I forked the fork that would
already add this but the maintainer of that fork hasn't implemented the
changes needed to properly get the output function working, which I did.
I believe everything is functional though I have not tested every single
node.
I changed the table format for the README and a few other minor things
for aesthetic reasons but if you want me to revert those, I will.
---------
Co-authored-by: Jonathan Kovacs <jkovacs-dev@users.noreply.github.com>
Co-authored-by: AbdBarho <ka70911@gmail.com>
Upon enabling the ControlNet addon from
https://github.com/AbdBarho/stable-diffusion-webui-docker/pull/385 one
might want to use the `openpose` preprocessors. Those are downloaded by
the addon the first time they are used. Without proper mounts those
networks will be downloaded on usage after each container start.
This PR enables those mounts to reduce data traffic.
The ControlNet addon
[sd-webui-controlnet](https://github.com/Mikubill/sd-webui-controlnet)
requires the `data/ControlNet` folder to be mounted into
`models/ControlNet`.
This PR enables said mount and adds the ControlNet folder to
`.gitignore` file.
---------
Co-authored-by: AbdBarho <ka70911@gmail.com>