Giter VIP home page Giter VIP logo

comfyui-docker's Introduction

Docker image for ComfyUI

GitHub Workflow Status GitHub Workflow Status GitHub Workflow Status

Concept Design

This repo is for Docker images that runs ComfyUI - a Stable Diffusion GUI powering node-based workflow.

How it works

  1. At first start, a script will download latest ComfyUI, ComfyUI-Manager and some models.

  2. The whole ComfyUI will be stored in a local folder (./storage/ComfyUI).

  3. If you already have a ComfyUI bundle, put it there and make an empty file (./storage/.download-complete) so the start script will skip downloading.

  4. Use ComfyUI-Manager (in ComfyUI web page) to update ComfyUI, manage custom nodes, and download models.

Prerequisites

  • NVIDIA GPU with ≥6GB VRAM

  • Latest NVIDIA GPU driver

    • Either Game or Studio edition will work.

    • You don’t need to install drivers inside containers. Just make sure it’s working on your host OS.

  • Docker Installed

Usage - NVIDIA GPU

A. Using docker run
mkdir -p storage

docker run -it \
  --name comfyui \
  --gpus all \
  -p 8188:8188 \
  -v "$(pwd)"/storage:/home/runner \
  -e CLI_ARGS="" \
  yanwk/comfyui-boot:latest
# Update image (only when Python components are outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:latest
# Then re-run above 'docker run' again
B. Using docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git

cd ComfyUI-Docker

docker compose up --detach
# Update image (only when Python components are outdated)
git pull
docker compose pull
docker compose up --detach --remove-orphans
docker image prune

Once the app is loaded, visit http://localhost:8188/

Usage - AMD GPU

See ROCm.

Q & A

Q: My GPU has only 4GB VRAM
A: Add --lowvram to CLI_ARGS.

Q: Adding --lowvram still out-of-memory
A: Use --novram instead. It will use CPU RAM.

Q: How to run on CPU?
A: Add --cpu to CLI_ARGS. It’s pretty slow.

Q: I don’t want to use xFormers, how to use PyTorch’s Cross Attention?
A: Add --use-pytorch-cross-attention to CLI_ARGS. It may perform well on WSL2, but significantly slower on Linux hosts.

More CLI_ARGS available at ComfyUI.

Add some custom nodes

Install a bunch of custom nodes that may save your time

Note that most dependencies are bundled in the image, you don’t need to manually install them.

cd ComfyUI/custom_nodes/

gcs='git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules'

# Workspace
$gcs https://github.com/11cafe/comfyui-workspace-manager.git
$gcs https://github.com/AIGODLIKE/AIGODLIKE-ComfyUI-Translation.git
$gcs https://github.com/crystian/ComfyUI-Crystools-save.git
$gcs https://github.com/crystian/ComfyUI-Crystools.git

# General
$gcs https://github.com/bash-j/mikey_nodes.git
$gcs https://github.com/chrisgoringe/cg-use-everywhere.git
$gcs https://github.com/cubiq/ComfyUI_essentials.git
$gcs https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes.git
$gcs https://github.com/jags111/efficiency-nodes-comfyui.git
$gcs https://github.com/kijai/ComfyUI-KJNodes.git
$gcs https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git
$gcs https://github.com/rgthree/rgthree-comfy.git
$gcs https://github.com/shiimizu/ComfyUI_smZNodes.git
$gcs https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git

# Control
$gcs https://github.com/cubiq/ComfyUI_InstantID.git
$gcs https://github.com/cubiq/ComfyUI_IPAdapter_plus.git
$gcs https://github.com/Fannovel16/comfyui_controlnet_aux.git
$gcs https://github.com/florestefano1975/comfyui-portrait-master.git
$gcs https://github.com/Gourieff/comfyui-reactor-node.git
$gcs https://github.com/huchenlei/ComfyUI-layerdiffuse.git
$gcs https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git
$gcs https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
$gcs https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git
$gcs https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git
$gcs https://github.com/storyicon/comfyui_segment_anything.git
$gcs https://github.com/twri/sdxl_prompt_styler.git

# Video
$gcs https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git
$gcs https://github.com/FizzleDorf/ComfyUI_FizzNodes.git
$gcs https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git
$gcs https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git
$gcs https://github.com/melMass/comfy_mtb.git
$gcs https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved.git

# More
$gcs https://github.com/cubiq/ComfyUI_FaceAnalysis.git
$gcs https://github.com/MrForExample/ComfyUI-3D-Pack.git
$gcs https://github.com/pythongosssss/ComfyUI-WD14-Tagger.git
$gcs https://github.com/SLAPaper/ComfyUI-Image-Selector.git
$gcs https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git

Another note is this image doesn’t bundled deps for WAS Node Suite, because it has some deps version fixed, and is not under active development.
However, the image’s script only install one custom node (ComfyUI-Manager). You can safely install WAS NS via ComfyUI-Manager in a new deployment.
If anything conflicts, just delete unwanted custom nodes and .local (or local) folder, and update/try-fix/reinstall custom nodes in ComfyUI-Manager.

Pre-start scripts

You can create your own pre-start script at

./storage/scripts/pre-start.sh

It will run before ComfyUI starts, handy for debugging.

Also, if you need to setup proxy, this script will start before pre-start and download :

./storage/scripts/set-proxy.sh

Run with Podman

Podman is root-less by default. And it’s tricky to bind-mount volume as non-root user inside rootless container. Options provided by Podman will chown files on host space, which probably is undesirable.

Recommend three different ways to workaround:

1. Go "root-ful" just like Docker

Expand details

The straightforward way. By adding sudo you go from rootless to rootful. And everything else would be the same as using Docker.
Note that sudo Podman will download images to root space. If you already downloaded the image in current user, you can local-copy it:
sudo podman image scp username@localhost::docker.io/yanwk/comfyui-boot:latest

mkdir -p storage

sudo podman run -it --rm \
  --name comfyui-rootful \
  --device nvidia.com/gpu=all \
  --security-opt label=disable \
  -p 8188:8188 \
  -v "$(pwd)"/storage:/home/runner \
  -e CLI_ARGS="" \
  docker.io/yanwk/comfyui-boot

2. Run as root inside container

Expand details

The rootless way, no sudo needed. Inside the pod, Podman will mount volume as root, scripts will run as root. And from the host side, we see files keep their original ownership.

mkdir -p storage

podman run -it --rm \
  --name comfyui-rootless \
  --device nvidia.com/gpu=all \
  --security-opt label=disable \
  -p 8188:8188 \
  -v "$(pwd)"/storage:/root \
  --user root \
  --workdir /root \
  -e CLI_ARGS="" \
  docker.io/yanwk/comfyui-boot:latest \
  /bin/bash /home/scripts/root-wrapper.sh

3. Use megapak image

This image was built for rootless.

Some commands for debugging

Build the image, print all logs to STDOUT
docker build . --progress=plain -f Dockerfile -t yanwk/comfyui-boot:latest
Run a one-time container
docker run -it --rm \
  --gpus all -p 8188:8188 \
  --volume "$(pwd)"/storage:/home/runner \
  --env CLI_ARGS="" \
  yanwk/comfyui-boot:latest
Run into a root bash
docker run -it --rm \
  --gpus all -p 8188:8188 \
  --volume "$(pwd)"/storage:/home/runner \
  --env CLI_ARGS="" \
  --user root \
  yanwk/comfyui-boot:latest /bin/bash
Clean up cache files

Usually this is not needed. Some custom nodes will use huggingface_hub to download models and store them in .cache. You may need to download them again after cleaning cache.
But if having issues when updating, it may worth a try:

docker exec -it --workdir /home/runner  comfyui \
  rm -rf .cache/ .config/ .local/ .nv/ bin/ include/ lib/ lib64 pyvenv.cfg

docker restart comfyui

License

This open source license is written and valid both in Chinese and English, how good is that!

comfyui-docker's People

Contributors

bashtoni avatar chadly avatar m1kep avatar petemyron avatar yanwenkun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

comfyui-docker's Issues

issues when runing AMD ROCm 6.0.2 RX7800XT

########################################
Starting ComfyUI...
########################################
** ComfyUI startup time: 2024-02-15 21:29:54.642845
** Platform: Linux
** Python version: 3.11.7 (main, Dec 15 2023, 10:49:17) [GCC]
** Python executable: /usr/bin/python3
** Log path: /home/runner/ComfyUI/comfyui.log

Prestartup times for custom nodes:
0.0 seconds: /home/runner/ComfyUI/custom_nodes/ComfyUI-Manager

Traceback (most recent call last):
File "/home/runner/ComfyUI/main.py", line 76, in
import execution
File "/home/runner/ComfyUI/execution.py", line 11, in
import nodes
File "/home/runner/ComfyUI/nodes.py", line 20, in
import comfy.diffusers_load
File "/home/runner/ComfyUI/comfy/diffusers_load.py", line 3, in
import comfy.sd
File "/home/runner/ComfyUI/comfy/sd.py", line 3, in
from comfy import model_management
File "/home/runner/ComfyUI/comfy/model_management.py", line 118, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/model_management.py", line 87, in get_torch_device
return torch.device(torch.cuda.current_device())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/site-packages/torch/cuda/init.py", line 803, in current_device
_lazy_init()
File "/usr/lib64/python3.11/site-packages/torch/cuda/init.py", line 318, in _lazy_init
torch._C._cuda_init()
RuntimeError: No HIP GPUs are available

#################################################################################
Command to reproduce:
#################################################################################
docker run -it
--name comfyui
-p 8188:8188
-v "$(pwd)"/storage:/home/runner
--env CLI_ARGS="--use-pytorch-cross-attention"
--device=/dev/kfd --device=/dev/dri/card0 --device=/dev/dri
--group-add=root --ipc=host --cap-add=SYS_PTRACE
--security-opt seccomp=unconfined
yanwk/comfyui-boot:rocm
#################################################################################

Basesystem instalation:

intel 12700h + 7800xt
ROCm 6.0.2

https://gist.github.com/hqnicolas/6d9bfa997667626742c0918b95e67171

#################################################################################

I have Stable Diffusion runing. but this ComfyUI is hard!

Build failed

docker-compose build comfyui

[+] Building 17.7s (6/12)                                                                                                     
 => [comfyui internal] load .dockerignore                                                                                0.0s
 => => transferring context: 52B                                                                                         0.0s
 => [comfyui internal] load build definition from Dockerfile                                                             0.0s
 => => transferring dockerfile: 2.23kB                                                                                   0.0s
 => [comfyui internal] load metadata for docker.io/opensuse/tumbleweed:latest                                            0.2s
 => CACHED [comfyui stage-0 1/8] FROM docker.io/opensuse/tumbleweed:latest@sha256:1dd6479c6ecaeea138a9b623c58b22e880cb6  0.0s
 => [comfyui internal] load build context                                                                                0.0s
 => => transferring context: 186B                                                                                        0.0s
 => ERROR [comfyui stage-0 2/8] RUN --mount=type=cache,target=/var/cache/zypp     set -eu     && zypper install --no-c  17.5s
------                                                                                                                        
 > [comfyui stage-0 2/8] RUN --mount=type=cache,target=/var/cache/zypp     set -eu     && zypper install --no-confirm         python311 python311-pip         python311-wheel python311-setuptools python311-numpy         shadow git aria2         Mesa-libGL1:                                                                                                                          
#0 0.990 Retrieving repository 'openSUSE-Tumbleweed-Non-Oss' metadata [...                                                    
#0 4.984                                                                                                                      
#0 4.984 New repository or package signing key received:
#0 4.984 
#0 4.984   Repository:       openSUSE-Tumbleweed-Non-Oss
#0 4.984   Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
#0 4.984   Key Name:         openSUSE Project Signing Key <[email protected]>
#0 4.984   Key Algorithm:    RSA 4096
#0 4.984   Key Created:      Mon Jun 20 14:03:14 2022
#0 4.984   Key Expires:      Fri Jun 19 14:03:14 2026
#0 4.984   Rpm Name:         gpg-pubkey-29b700a4-62b07e22
#0 4.984 
#0 4.984 
#0 4.984 
#0 4.984     Note: Signing data enables the recipient to verify that no modifications occurred after the data
#0 4.984     were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
#0 4.984     and in extreme cases even to a system compromise.
#0 4.984 
#0 4.984     Note: A GPG pubkey is clearly identified by it's fingerprint. Do not rely the keys name. If you
#0 4.984     are not sure whether the presented key is authentic, ask the repository provider or check his
#0 4.984     web site. Many provider maintain a web page showing the fingerprints of the GPG keys they are
#0 4.984     using.
#0 4.984 
#0 4.984 Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): r
#0 4.986 error]
#0 4.986 Repository 'openSUSE-Tumbleweed-Non-Oss' is invalid.
#0 4.986 [repo-non-oss|http://download.opensuse.org/tumbleweed/repo/non-oss/] Valid metadata not found at specified URL
#0 4.986 History:
#0 4.986  - Signature verification failed for repomd.xml
#0 4.986  - Can't provide /repodata/repomd.xml
#0 4.987 
#0 4.987 Please check if the URIs defined for this repository are pointing to a valid repository.
#0 4.987 Warning: Skipping repository 'openSUSE-Tumbleweed-Non-Oss' because of the above error.
#0 4.987 Retrieving repository 'openSUSE-Tumbleweed-Oss' metadata [....
#0 9.453 
#0 9.453 New repository or package signing key received:
#0 9.453 
#0 9.453   Repository:       openSUSE-Tumbleweed-Oss
#0 9.453   Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
#0 9.453   Key Name:         openSUSE Project Signing Key <[email protected]>
#0 9.453   Key Algorithm:    RSA 4096
#0 9.453   Key Created:      Mon Jun 20 14:03:14 2022
#0 9.453   Key Expires:      Fri Jun 19 14:03:14 2026
#0 9.453   Rpm Name:         gpg-pubkey-29b700a4-62b07e22
#0 9.453 
#0 9.453 
#0 9.453 
#0 9.453     Note: Signing data enables the recipient to verify that no modifications occurred after the data
#0 9.453     were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
#0 9.453     and in extreme cases even to a system compromise.
#0 9.453 
#0 9.453     Note: A GPG pubkey is clearly identified by it's fingerprint. Do not rely the keys name. If you
#0 9.453     are not sure whether the presented key is authentic, ask the repository provider or check his
#0 9.453     web site. Many provider maintain a web page showing the fingerprints of the GPG keys they are
#0 9.453     using.
#0 9.453 
#0 9.453 Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): r
#0 9.456 error]
#0 9.456 Repository 'openSUSE-Tumbleweed-Oss' is invalid.
#0 9.456 [repo-oss|http://download.opensuse.org/tumbleweed/repo/oss/] Valid metadata not found at specified URL
#0 9.456 History:
#0 9.456  - Signature verification failed for repomd.xml
#0 9.456  - Can't provide /repodata/repomd.xml
#0 9.456 
#0 9.456 Please check if the URIs defined for this repository are pointing to a valid repository.
#0 9.456 Warning: Skipping repository 'openSUSE-Tumbleweed-Oss' because of the above error.
#0 9.457 Retrieving repository 'openSUSE-Tumbleweed-Update' metadata [......
#0 17.40 
#0 17.40 New repository or package signing key received:
#0 17.40 
#0 17.40   Repository:       openSUSE-Tumbleweed-Update
#0 17.40   Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
#0 17.40   Key Name:         openSUSE Project Signing Key <[email protected]>
#0 17.40   Key Algorithm:    RSA 4096
#0 17.40   Key Created:      Mon Jun 20 14:03:14 2022
#0 17.40   Key Expires:      Fri Jun 19 14:03:14 2026
#0 17.40   Rpm Name:         gpg-pubkey-29b700a4-62b07e22
#0 17.40 
#0 17.40 
#0 17.40 
#0 17.40     Note: Signing data enables the recipient to verify that no modifications occurred after the data
#0 17.40     were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
#0 17.40     and in extreme cases even to a system compromise.
#0 17.40 
#0 17.40     Note: A GPG pubkey is clearly identified by it's fingerprint. Do not rely the keys name. If you
#0 17.40     are not sure whether the presented key is authentic, ask the repository provider or check his
#0 17.40     web site. Many provider maintain a web page showing the fingerprints of the GPG keys they are
#0 17.40     using.
#0 17.40 
#0 17.40 Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): r
#0 17.40 error]
#0 17.40 Repository 'openSUSE-Tumbleweed-Update' is invalid.
#0 17.40 [repo-update|http://download.opensuse.org/update/tumbleweed/] Valid metadata not found at specified URL
#0 17.40 History:
#0 17.40  - Signature verification failed for repomd.xml
#0 17.40  - Can't provide /repodata/repomd.xml
#0 17.40 
#0 17.40 Please check if the URIs defined for this repository are pointing to a valid repository.
#0 17.40 Warning: Skipping repository 'openSUSE-Tumbleweed-Update' because of the above error.
#0 17.40 Some of the repositories have not been refreshed because of an error.
#0 17.40 Loading repository data...
#0 17.40 Reading installed packages...
#0 17.42 'Mesa-libGL1' not found in package names. Trying capabilities.
#0 17.42 'aria2' not found in package names. Trying capabilities.
#0 17.42 No provider of 'Mesa-libGL1' found.
#0 17.42 No provider of 'aria2' found.
#0 17.42 'git' not found in package names. Trying capabilities.
#0 17.42 'python311' not found in package names. Trying capabilities.
#0 17.42 No provider of 'git' found.
#0 17.42 No provider of 'python311' found.
#0 17.42 'python311-numpy' not found in package names. Trying capabilities.
#0 17.42 'python311-pip' not found in package names. Trying capabilities.
#0 17.42 No provider of 'python311-numpy' found.'python311-setuptools' not found in package names. Trying capabilities.
#0 17.42 
#0 17.42 No provider of 'python311-pip' found.
#0 17.42 No provider of 'python311-setuptools' found.
#0 17.42 'python311-wheel' not found in package names. Trying capabilities.
#0 17.42 No provider of 'python311-wheel' found.
#0 17.42 No provider of 'shadow' found.
#0 17.42 'shadow' not found in package names. Trying capabilities.
------
failed to solve: process "/bin/sh -c set -eu     && zypper install --no-confirm         python311 python311-pip         python311-wheel python311-setuptools python311-numpy         shadow git aria2         Mesa-libGL1" did not complete successfully: exit code: 104

Pre-installing default custom nodes

I am setting up several ComfyUI containers and would love to automate the installation of popular custom nodes for each container.

Is there a good way to configure the container to pre-install certain custom nodes for me?

For example, I think it'll be great to have a file that contains all the URLs for the custom nodes, and they can be installed automatically.

Thanks.

Whatever that missing string really is?

validating /opt/local/.A/SDiffXL/DCx/COMFy/docker-compose-rocm.yml: services.comfyui.ipc must be a string
My system info,

Main system  : ASRock DeskMini X300 AMD
APU          : AMD R4750G Zen2 with 16GB UMA (graphical memories)
AMDGPU driver: 23.0.0-1 (X11)
ROCm         : 5.7.1
Python       : 3.11.6-1
Gross RAM's  : 48GB DDR4
OS           : Artix Linux amd64 with Linux kernel 6.1.70
Docker       : 24.0.7-1 / Compose 2.24.3-1
UI browser   : Brave 1.63.131-1

Addressing Broken Download Link for `ng_deepnegative_v1_75t.pt` in Docker Installation

Hi,

I attempted to install the Docker, but encountered an issue. The link for ng_deepnegative_v1_75t.pt appears to be broken, preventing the file from being downloaded. It seems that Civitai requires users to be logged in to download the file.

It might be beneficial to update the download link to address this issue.

I found that everything works correctly when the file is placed directly in the /storage/ComfyUI/models/embeddings/ng_deepnegative_v1_75t.pt directory.

For reference, the file can be downloaded from this location.

日志

在哪个文件或者说怎样操作,能看到运行日志?

docker build 构建失败

=> ERROR [stage-0 3/8] RUN --mount=type=cache,target=/root/.cache/pip pip install --brea 5.1s

[stage-0 3/8] RUN --mount=type=cache,target=/root/.cache/pip pip install --break-system-packages --pre -U xformers --index-url https://download.pytorch.org/whl/cu121 --extra-index-url https://pypi.org/simple:
0.269 Looking in indexes: https://download.pytorch.org/whl/cu121, https://pypi.org/simple
4.554 Collecting xformers
4.566 Using cached xformers-0.0.23.dev685.tar.gz (3.8 MB)
4.909 Preparing metadata (setup.py): started
4.972 Preparing metadata (setup.py): finished with status 'error'
4.974 error: subprocess-exited-with-error
4.974
4.974 × python setup.py egg_info did not run successfully.
4.974 │ exit code: 1
4.974 ╰─> [6 lines of output]
4.974 Traceback (most recent call last):
4.974 File "", line 2, in
4.974 File "", line 34, in
4.974 File "/tmp/pip-install-i23mgr98/xformers_9108ab734a45421f94f5381a3e74f6d4/setup.py", line 23, in
4.974 import torch
4.974 ModuleNotFoundError: No module named 'torch'
4.974 [end of output]
4.974
4.974 note: This error originates from a subprocess, and is likely not a problem with pip.
4.975 error: metadata-generation-failed
4.975
4.975 × Encountered error while generating package metadata.
4.975 ╰─> See above for output.
4.975
4.975 note: This is an issue with the package mentioned above, not pip.
4.975 hint: See above for details.


Dockerfile:20

19 | # Install xFormers (dev version, will install PyTorch as well)
20 | >>> RUN --mount=type=cache,target=/root/.cache/pip
21 | >>> pip install --break-system-packages
22 | >>> --pre -U xformers
23 | >>> --index-url https://download.pytorch.org/whl/cu121
24 | >>> --extra-index-url https://pypi.org/simple
25 |

ERROR: failed to solve: process "/bin/sh -c pip install --break-system-packages --pre -U xformers --index-url https://download.pytorch.org/whl/cu121 --extra-index-url https://pypi.org/simple" did not complete successfully: exit code: 1

OSError: libcufft.so.11: cannot open shared object file: No such file or directory

when I run the following:

git clone https://github.com/YanWenKun/ComfyUI-Docker.git

cd ComfyUI-Docker

docker compose up 

at last, errors such as:

comfyui     | Status Legend:
comfyui     | (OK):download completed.
comfyui     | + touch /home/runner/.download-complete
comfyui     | ########################################
comfyui     | Starting ComfyUI...
comfyui     | ########################################
comfyui     | ** ComfyUI start up time: 2023-10-11 02:54:21.058391
comfyui     |
comfyui     | Prestartup times for custom nodes:
comfyui     |    0.0 seconds: /home/runner/ComfyUI/custom_nodes/ComfyUI-Manager
comfyui     |
comfyui     | Traceback (most recent call last):
comfyui     |   File "/usr/lib64/python3.11/site-packages/torch/__init__.py", line 174, in _load_global_deps
comfyui     |     ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
comfyui     |   File "/usr/lib64/python3.11/ctypes/__init__.py", line 376, in __init__
comfyui     |     self._handle = _dlopen(self._name, mode)
comfyui     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^
comfyui     | OSError: libcufft.so.11: cannot open shared object file: No such file or directory
comfyui     |
comfyui     | During handling of the above exception, another exception occurred:
comfyui     |
comfyui     | Traceback (most recent call last):
comfyui     |   File "/home/runner/ComfyUI/main.py", line 69, in <module>
comfyui     |     import comfy.utils
comfyui     |   File "/home/runner/ComfyUI/comfy/utils.py", line 1, in <module>
comfyui     |     import torch
comfyui     |   File "/usr/lib64/python3.11/site-packages/torch/__init__.py", line 234, in <module>
comfyui     |     _load_global_deps()
comfyui     |   File "/usr/lib64/python3.11/site-packages/torch/__init__.py", line 196, in _load_global_deps
comfyui     |     ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
comfyui     |   File "/usr/lib64/python3.11/ctypes/__init__.py", line 376, in __init__
comfyui     |     self._handle = _dlopen(self._name, mode)
comfyui     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^
comfyui     | OSError: libcufft.so.11: cannot open shared object file: No such file or directory
comfyui exited with code 120

why and how to fix it?

Could not select driver

Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu]]
I have an nvidia gpu. Idk what info I should provide, just tell me and I'll follow up.

有办法绕开拉取吗?一直卡着了。。。。

要哭死了,一直卡这里
########################################
[INFO] Downloading ComfyUI & Manager...
########################################

  • cd /home/runner
  • git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules https://github.com/comfyanonymous/ComfyUI.git
    fatal: destination path 'ComfyUI' already exists and is not an empty directory.
  • cd /home/runner/ComfyUI
  • git pull
    Updating 1c4af59..0bdc2b1
    error: Your local changes to the following files would be overwritten by merge:
    comfy/ldm/modules/attention.py
    comfy/ldm/modules/diffusionmodules/model.py
    comfy/ldm/modules/diffusionmodules/openaimodel.py
    Please commit your changes or stash them before you merge.
    Aborting
    ########################################
    [INFO] Downloading ComfyUI & Manager...
    ########################################
  • cd /home/runner
  • git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules https://github.com/comfyanonymous/ComfyUI.git
    fatal: destination path 'ComfyUI' already exists and is not an empty directory.
  • cd /home/runner/ComfyUI
  • git pull
    fatal: unable to access 'https://github.com/comfyanonymous/ComfyUI.git/': Recv failure: Connection timed out
    我下载个塞进去了都,但是容器日志还是报错,说啥没拉取,现在是半夜十一点五十,从六点下班开始弄的,很想哭。。。。

docker如何设置其他model位置

docker如何设置其他model位置
ComfyUI-Docker安装成功,但是nas里安装了其他画图docker,如何在docker里软连接其他程序的model文件夹位置

Is xFormers still needed?

I did some little tests in SD1.5, SDXL and Stable Cascade. xFormers vs. PyTorch 2.2's Cross-Attention.
In my tests, time and VRAM cosuming is about the same. And Torch got better consistency (reproducing with same seed).

So I'm curious, should we keep using xFormers?

BTW I've been running ComfyUI with Python 3.12 + PyTorch 2.3 for a week. There're still compatibility issues with Python 3.12, so I'm not updating Dockerfile here. But it works well with Stable Cascade and some SDXL workflows.

启动Docker提示fatal: could not create work tree dir 'ComfyUI': Permission denied

`mkdir -p storage

docker run -it
--name comfyui
--gpus all
-p 8188:8188
-v "$(pwd)"/storage:/home/runner
-e CLI_ARGS=""
yanwk/comfyui-boot:latest`

在终端执行上面的命令后,提示以下错误:

`########################################
[INFO] Downloading ComfyUI & Manager...
########################################

  • cd /home/runner
  • git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules https://github.com/comfyanonymous/ComfyUI.git
    fatal: could not create work tree dir 'ComfyUI': Permission denied
  • cd /home/runner/ComfyUI
    /home/scripts/download.sh: line 13: cd: /home/runner/ComfyUI: No such file or directory`

unable installl custom nodes throught comfyui manager

image

FETCH DATA from: /home/runner/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
Install custom node 'ComfyUI Impact Pack'
install: ['https://github.com/ltdrdata/ComfyUI-Impact-Pack']
Download: git clone 'https://github.com/ltdrdata/ComfyUI-Impact-Pack'
Install(git-clone) error: https://github.com/ltdrdata/ComfyUI-Impact-Pack / name 'git' is not defined
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json

Maybe missing some python packages like GitPython? I saw these following error messages from log when comfyui launch:

## ComfyUI-Manager: installing dependencies
[!] error: externally-managed-environment
[!] 
[!] × This environment is externally managed
[!] ╰─> To install Python packages system-wide, try
[!]     zypper install python311-xyz, where xyz is the package
[!]     you are trying to install.
[!]     
[!]     If you wish to install a non-rpm packaged Python package,
[!]     create a virtual environment using python3.11 -m venv path/to/venv.
[!]     Then use path/to/venv/bin/python and path/to/venv/bin/pip.
[!]     
[!]     If you wish to install a non-rpm packaged Python application,
[!]     it may be easiest to use `pipx install xyz`, which will manage a
[!]     virtual environment for you. Install pipx via `zypper install python311-pipx` .
[!] 
[!] note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
[!] hint: See PEP 668 for the detailed specification.
## [ERROR] ComfyUI-Manager: Attempting to reinstall dependencies using an alternative method.
[!] error: externally-managed-environment
[!] 
[!] × This environment is externally managed
[!] ╰─> To install Python packages system-wide, try
[!]     zypper install python311-xyz, where xyz is the package
[!]     you are trying to install.
[!]     
[!]     If you wish to install a non-rpm packaged Python package,
[!]     create a virtual environment using python3.11 -m venv path/to/venv.
[!]     Then use path/to/venv/bin/python and path/to/venv/bin/pip.
[!]     
[!]     If you wish to install a non-rpm packaged Python application,
[!]     it may be easiest to use `pipx install xyz`, which will manage a
[!]     virtual environment for you. Install pipx via `zypper install python311-pipx` .
[!] 
[!] note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
[!] hint: See PEP 668 for the detailed specification.
## [ERROR] ComfyUI-Manager: Failed to install the GitPython package in the correct Python environment. Please install it manually in the appropriate environment. (You can seek help at https://app.element.io/#/room/%23comfyui_space%3Amatrix.org)
## ComfyUI-Manager: installing dependencies done.
### Loading: ComfyUI-Manager (V0.34)
### ComfyUI Revision: UNKNOWN (The currently installed ComfyUI is not a Git repository)
Traceback (most recent call last):
  File "/home/runner/ComfyUI/nodes.py", line 1734, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/runner/ComfyUI/custom_nodes/comfyui_controlnet_aux/__init__.py", line 2, in <module>
    from .utils import here, create_node_input_types
  File "/home/runner/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 4, in <module>
    import cv2
  File "/usr/lib64/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/lib64/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

Cannot import /home/runner/ComfyUI/custom_nodes/comfyui_controlnet_aux module for custom nodes: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

安装SAM 节点,但是提示CUDA环境设置不对,如何处理?

装mmcv遇到的问题

报错信息如下:
python setup.py egg_info did not run successfully.
2023-04-19 20:21:11 │ exit code: 1
2023-04-19 20:21:11 ╰─> [14 lines of output]
2023-04-19 20:21:11 Traceback (most recent call last):
2023-04-19 20:21:11 File "", line 2, in
2023-04-19 20:21:11 File "", line 34, in
2023-04-19 20:21:11 File "/tmp/pip-install-t972ixw_/mmcv_bdf1756711d24da4961cc35164bc36cf/setup.py", line 343, in
2023-04-19 20:21:11 ext_modules=get_extensions(),
2023-04-19 20:21:11 File "/tmp/pip-install-t972ixw_/mmcv_bdf1756711d24da4961cc35164bc36cf/setup.py", line 304, in get_extensions
2023-04-19 20:21:11 ext_ops = extension(
2023-04-19 20:21:11 File "/usr/lib64/python3.10/site-packages/torch/utils/cpp_extension.py", line 1051, in CUDAExtension
2023-04-19 20:21:11 library_dirs += library_paths(cuda=True)
2023-04-19 20:21:11 File "/usr/lib64/python3.10/site-packages/torch/utils/cpp_extension.py", line 1178, in library_paths
2023-04-19 20:21:11 if (not os.path.exists(_join_cuda_home(lib_dir)) and
2023-04-19 20:21:11 File "/usr/lib64/python3.10/site-packages/torch/utils/cpp_extension.py", line 2227, in _join_cuda_home
2023-04-19 20:21:11 raise EnvironmentError('CUDA_HOME environment variable is not set. '
2023-04-19 20:21:11 OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
2023-04-19 20:21:11 [end of output]

The default `SD 1.5` model?

I've started the docker and headed to the web GUI, but when I press "Queue Prompt", this error shows up:

Error occurred when executing CheckpointLoaderSimple:

'model.diffusion_model.input_blocks.0.0.weight'

File "/home/runner/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/nodes.py", line 516, in load_checkpoint
out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/sd.py", line 507, in load_checkpoint_guess_config
model_config = model_detection.model_config_from_unet(sd, "model.diffusion_model.")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/model_detection.py", line 194, in model_config_from_unet
unet_config = detect_unet_config(state_dict, unet_key_prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/model_detection.py", line 78, in detect_unet_config
model_channels = state_dict['{}input_blocks.0.0.weight'.format(key_prefix)].shape[0]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I realized that the default SD 1.5 model is not there; instead, the default one is SD 2.1-unclip-small. I manually downloaded the default SD 1.5, and everything works. So I wonder why SD 2.1-unclip-small was chosen as the default? And why was I running into such an error?

The ` /home/runner` directory inside the contianer seems to be owned by root, causing Permission denied error

+ cd /home/runner
+ git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules https://github.com/comfyanonymous/ComfyUI.git
fatal: could not create work tree dir 'ComfyUI': Permission denied
+ cd /home/runner/ComfyUI
/home/scripts/download.sh: line 12: cd: /home/runner/ComfyUI: No such file or directory

The mapped host directory has full permissions, the container failed to start due to Permission denied error. Anyway to fix this without having the container running as root user?

opensuse/tumbleweed python3.10

Hi YanWenKun,

Thank you for your work! :)

I am not too familiar with openSUSE but it seems that the binary for python3.10 is not installed as python3 but python3.10.

When I try to start the container I am getting this error:
home/scripts/entrypoint.sh: line 25: python3: command not found

Changing python3 to python3.10 in entrypoint.sh solved my issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.