ComfyUI Dockerfile overhaul, GGUF, XFLUX, and krita-ai-diffusion support #749
lainedfles
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, as requested, here is the discussion accompanying #739
Dockerfile overhaul
Enhance the
Dockerfile
for the ComfyUI service by introducing several new features and configurations. The ARGs provide flexibility in configuring the Docker container, allowing users to tailor the ComfyUI installation to their specific needs. Here's a detailed breakdown of the changes:Base Image Update:
pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
topytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime
. This ensures compatibility with newer versions of PyTorch and CUDA, providing better performance and support for recent hardware.Environment Variables:
USE_UID
,USE_GID
,USE_USER
,USE_GROUP
) to allow customization of the user and group IDs within the container.USE_EDGE
,USE_GGUF
,USE_XFLUX
,USE_CNAUX
,USE_KRITA
,USE_IPAPLUS
,USE_INPAINT
,USE_TOOLING
) to enable or disable optional features and integrations.User/Group Management:
USE_UID
andUSE_GID
). This is useful for running the container in environments where specific user permissions are required.Optional Feature Integration:
USE_GGUF
,USE_XFLUX
,USE_CNAUX
,USE_KRITA
,USE_IPAPLUS
,USE_INPAINT
,USE_TOOLING
). This allows users to customize their ComfyUI installation by enabling only the features they need.Python Version Update:
python
topython3
in the CMD instruction to explicitly specify the use of Python 3, which is a best practice for clarity and compatibility.File Permissions and Ownership:
--chown=${USE_UID}:${USE_GID}
when copying files into the container to ensure that the correct user owns these files, preventing permission issues during execution.General Improvements:
USE_UID
: Specifies the user ID for the non-root user within the container. Default is set to value 0.USE_GID
: Specifies the group ID for the non-root user within the container. Default is set to value like 0.USE_USER
: Specifies the username for the non-root user within the container. Default is set toroot
.USE_GROUP
: Specifies the group name for the non-root user within the container. Default is set toroot
.USE_EDGE
: If set totrue
, clones and installs the latest development version of ComfyUI from the main branch.USE_GGUF
: If set totrue
, clones and installs the ComfyUI-GGUF extension for GPU acceleration.USE_XFLUX
: If set totrue
, clones and installs the x-flux-comfyui extension for additional functionalities.USE_CNAUX
: If set totrue
, clones and installs the comfyui_controlnet_aux extension for control net auxiliary features.USE_KRITA
: If set totrue
, clones and installs multiple extensions (comfyui_controlnet_aux, ComfyUI_IPAdapter_plus, comfyui-inpaint-nodes, comfyui-tooling-nodes) that are useful when integrating with Krita.USE_IPAPLUS
: If set totrue
, clones and installs the ComfyUI_IPAdapter_plus extension for IP Adapter functionalities.USE_INPAINT
: If set totrue
, clones and installs the comfyui-inpaint-nodes extension for inpainting capabilities.USE_TOOLING
: If set totrue
, clones and installs the comfyui-tooling-nodes extension for additional tooling features.New entrypoint.sh features
Introduce several enhancements to the
entrypoint.sh
script for the Comfy service. These changes enhance the script's flexibility, making it easier to integrate additional features and manage dependencies dynamically based on environment configurations:Custom Node Update: Added logic to update custom nodes located in
/data/config/comfy/custom_nodes/
. If theUPDATE_CUSTOM_NODES
environment variable is set totrue
, it will pull the latest changes from each node's Git repository.Environment Variable Usage: Introduced a new environment variable
CACHE
which should be used instead of hard-coding/root/.cache
. This makes the script more flexible and configurable.Krita Integration: Added support for Krita integration with ComfyUI, including downloading models if
KRITA_DOWNLOAD_MODELS
is set totrue
, managing upscale models, and setting up symbolic links for model directories.GGUF, XFLUX, CNAUX, IPAPLUS, INPAINT, TOOLING Support: Included logic to handle additional custom nodes (
ComfyUI-GGUF
,x-flux-comfyui
,comfyui_controlnet_aux
,ComfyUI_IPAdapter_plus
,comfyui-inpaint-nodes
,comfyui-tooling-nodes
) based on their respective environment variables (USE_GGUF
,USE_XFLUX
,USE_CNAUX
,USE_IPAPLUS
,USE_INPAINT
,USE_TOOLING
). These nodes are copied to the custom nodes directory if they don't already exist..env support
Add
.env
file support to docker-compose file for environment variable management across all defined services in thedocker-compose.yml
. By addingenv_file: .env
, each service will now load environment variables from a local.env
file, enhancing configuration flexibility and security. This change ensures that sensitive information or common settings can be centralized and easily managed without hard-coding them into the Docker Compose file.Examples
Podman
Build and run container with one line enabling bleeding edge ComfyUi, enable GGUF, XFLUX, and KRITA support (download recommended models):
Build a container suitable for use with a systemd service to run as non-root:
podman-compose --verbose --podman-build-args='--build-arg="USE_UID=991" --build-arg="USE_GID=991" --build-arg="USE_USER=app" --build-arg="USE_GROUP=app" --build-arg="USE_EDGE=true" --build-arg="USE_GGUF=true" --build-arg="USE_XFLUX=true" --build-arg="USE_KRITA=true"' --profile comfy build
Docker
Build to enable Krita support:
Use
.env
file to enable node updates and download recomended Krita models:Run container:
Disclaimer: no code is AI generated (just old-fashioned human AGI) but various local LLMs were used to author commit messages.
Beta Was this translation helpful? Give feedback.
All reactions