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.
This commit adds support for integrating Krita AI Diffusion models and nodes into the Comfy image editing application. It includes the following changes:
- Downloads recommended models for Krita AI Diffusion if enabled
- Symlinks the downloaded upscale models into the models directory
- Adds environment variables to enable/disable dependancy node packs
- Clones and sets up the required Git repositories for those node packs if enabled
- Installs additional dependencies like aiohttp and tqdm if Krita AI Diffusion is used
These changes allow Comfy to leverage the powerful image generation and editing capabilities provided by the Krita AI Diffusion project. Users can now access advanced features like outpainting, inpainting, upscaling, etc. within the Comfy UI.
The commit also improves the build process by using a cache for pip installs and specifying types for mounted volumes in Docker for better performance and reproducibility.
- Update base image to pytorch 2.3.1
- Fix missing comment line escape
- Support [krita-ai-diffusion](https://github.com/Acly/krita-ai-diffusion/wiki/ComfyUI-Setup) (`USE_KRITA=true`)
This enables the following custom nodes (including comfyui_controlnet_aux):
* **ComfyUI_IPAdapter_plus** (`USE_IPAPLUS=true`)
* **comfyui-inpaint-nodes** (`USE_INPAINT=true`)
* **comfyui-tooling-nodes** (`USE_TOOLING=true`)
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/
Fix the problem that some extensions need to be installed from src
Now, because the step of installing extensions is moved forward in
`entrypoint.sh` instead of `startup.sh`, we cannot install some required
packages before executing `install.py`
When installing the extension `sd-webui-roop`, it relies on
`insightface==0.7.3`, and when installing this pypi package, it is found
that when building the wheel package, an error will be reported because
`gcc` cannot be found
ddc02ee1a9/requirements.txt (L1)
Therefore, considering that not all pypi packages are distributed in
wheel, those pypi packages distributed in src need `build-essential` to
build
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