-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New ComfyUI Dockerfile features #739
base: master
Are you sure you want to change the base?
Conversation
- Non-root default - Use `git describe` to automatically use latest ComfyUI tag (or `USE_EDGE=true` variable for latest commit) - Support custom_nodes: * **ComfyUI-GGUF support** (`USE_GGUF=true`) * **x-flux-comfyui support** (`USE_XFLUX=true`) * **comfyui_controlnet_aux support** (`USE_CNAUX=false`)
- 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`)
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.
Sorry to post asking for help here, but I can't get this to run due to some issue with your UID/GID changes. Any idea what's going on here? Do I have to configure my host system in a particular way?
ComfyUI and A1111 run fine using the base repo FWIW. |
Hi, this seems to be a great place for such issues. Testing is helpful. Based on your comment:
I presume that your volumes have been created using the base repo default of UID/GID 0:0 or the root user. This is expected behavior since the UID has changed. The most "secure" option is to change the ownership of the existing files. I ran a command like this (only a single execution should be required): podman run --rm -u root -v sd-comfy-data:/data -v sd-comfy-output:/output -it localhost/sd-comfy:7 bash -c 'chown -R app:app /data /output' Perhaps something like: docker run --rm -u root -v <data volume name or path>:/data -v <output volume name or path>:/output -it localhost/sd-comfy:7 bash -c 'chown -R app:app /data /output' Alternatively, you could re-build the image to use the root UID by passing build arguments: While I'd explicitly avoided adding an automatic scripted action to enforce the recursive directory ownership, perhaps we can re-consider it if enough users require it. |
@lainedfles thanks for the quick response! As you can tell, I don't know what I'm doing with Docker, but I think I see what was going on. This is the command that worked for me (no "actual" docker volumes, just directories on host): docker run --rm -u root -v ./data:/data -v ./output:/output -it sd-comfy:7 bash -c 'chown -R app:app /data /output' It's running and generating images now, but I do get this CNAUX error upon server startup:
Here's my config, which I specified directly in the Dockerfile (hope that's not terribly bad practice). Intended use is with Krita + some SDXL checkpoints: ARG USE_UID=131
ARG USE_GID=131
ARG USE_EDGE=false
ARG USE_GGUF=false
ARG USE_XFLUX=false
ARG USE_CNAUX=true
ARG USE_KRITA=true
ARG USE_IPAPLUS=true
ARG USE_INPAINT=true
ARG USE_TOOLING=true |
Edit: this contains good troubleshooting information so I'll leave it but I think I've identified the issue. I'll add a new commit to the PR soon. @SummitCollie No prob! I've been playing around with Aider.
This is strange. Have you made any modifications aside from env arg defaults? I'd guess a few possible causes:
On my system, $ docker exec -it comfy-1 bash -c 'find / -iname libGL.so.1'
$ docker exec -it comfy-1 bash -c 'ls -lh /usr/lib/x86_64-linux-gnu/libGL.so.1'
You do you! It looks OK to me but FYI, enabling the single variable |
@lainedfles Ah that was my mistake, I ended up solving it about 1 minute before you responded 😿 I had commented out the second part of this line because the Ultimately I removed the -RUN apt-get update && apt-get install -y git && ([ "${USE_XFLUX}" = "true" ] && apt-get install -y libgl1-mesa-glx python3-opencv) && apt-get clean
+RUN apt-get update && apt-get install -y git libgl1-mesa-glx python3-opencv && apt-get clean |
@SummitCollie good work. I think that the new commit should provide a fix. Just tested Flux.1 Schnell (Have you tried the Flux.1 models? They're incredible!). Here's the result, cheers! |
@lainedfles Thanks again! Also btw, - if [ "${KRITA_DOWNLOAD_MODELS:-false}" = "true" ]; then
- cd "${ROOT}/krita-ai-diffusion/scripts" && python scripts/download_models.py --recommended /data && cd ..
+ if [ "${KRITA_DOWNLOAD_MODELS:-true}" = "true" ]; then
+ cd "${ROOT}/krita-ai-diffusion/scripts" && python download_models.py --recommended /data && cd .. I also changed the default from |
@SummitCollie Good catch! Thanks for the help testing this. I'll add a new commit tomorrow to fix that (unless you want to submit a PR to my branch). I'll also fire up my dusty Ubuntu VM tomorrow and try building this with docker compose. I suspect that you may be able to set the environment variables prepended to the command, something like |
These changes allow Comfy to leverage the powerful image generation and editing capabilities provided by the Krita AI Diffusion project, GGUF, x-flux, ControlNet, and IPAdapter. 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.
git describe
to automatically use latest ComfyUI tag (orUSE_EDGE=true
variable for latest commit)USE_GGUF=true
)USE_XFLUX=true
)USE_CNAUX=false
)USE_IPAPLUS=true
)USE_INPAINT=true
)USE_TOOLING=true
)USE_KRITA=true
)This automatically enables the required dependency nodes.
KRITA_DOWNLOAD_MODELS=true
My preference:
podman-compose --verbose --podman-build-args='--build-arg="USE_EDGE=true" --build-arg="USE_GGUF=true" --build-arg="USE_XFLUX=true" --build-arg="USE_KRITA=true"' --profile comfy build
Closes issue #728
Bleeding edge or latest ComfyUI commit adds flux1-dev support.
Update versions
Edit: update to reflect latest commits