pythongosssss / ComfyUI-WD14-Tagger

A ComfyUI extension allowing for the interrogation of booru tags from images.
MIT License
668 stars 72 forks source link

WD14-Tagger works very slow on the newest environment. #88

Open landon2022 opened 1 month ago

landon2022 commented 1 month ago

I have built a docker image to run comfyUI. But the tagger works very slow on this new docker environment, 3 minutes for a single image on T4. It works fine in my local environment. Normally it will just take 1~2 seconds. Any idea what may cause this problem? The model I used was wd-v1-moat-tagger-v2. Thank you! Below are all the dependencies of the new environment and my local environment:

Docker environment dependencies: absl-py==2.1.0 accelerate==1.0.0 addict==2.4.0 aiodns==3.2.0 aiohappyeyeballs==2.4.3 aiohttp==3.10.9 aiohttp-retry==2.8.3 aiosignal==1.3.1 albucore==0.0.16 albumentations==1.4.15 annotated-types==0.7.0 antlr4-python3-runtime==4.9.3 anyio==4.6.0 arrow==1.3.0 async-timeout==4.0.3 attrs==24.2.0 backoff==2.2.1 bcrypt==4.2.0 beautifulsoup4==4.12.3 binaryornot==0.4.4 boto3==1.35.37 botocore==1.35.37 Brotli==1.1.0 cachetools==5.5.0 certifi==2024.8.30 cffi==1.17.1 chardet==5.2.0 charset-normalizer==3.4.0 click==8.1.7 clip-interrogator==0.6.0 cmake==3.30.4 color-matcher==0.5.0 colorama==0.4.6 coloredlogs==15.0.1 colorlog==6.8.2 colour-science==0.4.4 contourpy==1.3.0 cookiecutter==2.6.0 cryptography==43.0.1 cssselect2==0.7.0 cstr==0.1.0 cycler==0.12.1 Cython==3.0.11 ddt==1.7.2 Deprecated==1.2.14 diffusers==0.30.3 dill==0.3.9 dnspython==2.7.0 docutils==0.21.2 easydict==1.13 einops==0.8.0 email_validator==2.2.0 embreex==2.17.7.post5 eval_type_backport==0.2.0 exceptiongroup==1.2.2 facexlib==0.3.0 fairscale==0.4.13 fastapi==0.115.0 fastapi-cli==0.0.5 ffmpy==0.3.0 filelock==3.13.1 filterpy==1.4.5 flatbuffers==24.3.25 flet==0.24.1 flet-core==0.24.1 flet-runtime==0.24.1 fonttools==4.54.1 frozenlist==1.4.1 fsspec==2024.2.0 ftfy==6.2.3 fvcore==0.1.5.post20221221 gdown==5.2.0 gitdb==4.0.11 GitPython==3.1.43 google-ai-generativelanguage==0.6.10 google-api-core==2.21.0 google-api-python-client==2.149.0 google-auth==2.35.0 google-auth-httplib2==0.2.0 google-generativeai==0.8.3 googleapis-common-protos==1.65.0 grpcio==1.66.2 grpcio-status==1.66.2 h11==0.14.0 httpcore==1.0.6 httplib2==0.22.0 httptools==0.6.1 httpx==0.27.2 huggingface-hub==0.25.2 humanfriendly==10.0 idna==3.10 imageio==2.35.1 img2texture==1.0.6 importlib_metadata==8.5.0 inquirerpy==0.3.4 insightface==0.7.3 iopath==0.1.9 itsdangerous==2.2.0 jax==0.4.34 jaxlib==0.4.34 Jinja2==3.1.3 jmespath==1.0.1 joblib==1.4.2 jsonschema==4.23.0 jsonschema-specifications==2024.10.1 kiwisolver==1.4.7 kornia==0.7.3 kornia_rs==0.1.5 lark-parser==0.12.0 lazy_loader==0.4 lightning-utilities==0.11.7 llvmlite==0.43.0 lxml==5.3.0 manifold3d==2.5.1 mapbox_earcut==1.0.2 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.9.2 matrix-client==0.4.0 mdurl==0.1.2 mediapipe==0.10.15 ml_dtypes==0.5.0 mpmath==1.3.0 mss==9.0.2 multidict==6.1.0 networkx==3.2.1 numba==0.60.0 numpy==1.26.3 nvidia-cublas-cu12==12.1.3.1 nvidia-cuda-cupti-cu12==12.1.105 nvidia-cuda-nvrtc-cu12==12.1.105 nvidia-cuda-runtime-cu12==12.1.105 nvidia-cudnn-cu12==9.1.0.70 nvidia-cufft-cu12==11.0.2.54 nvidia-curand-cu12==10.3.2.106 nvidia-cusolver-cu12==11.4.5.107 nvidia-cusparse-cu12==12.1.0.106 nvidia-nccl-cu12==2.20.5 nvidia-nvjitlink-cu12==12.1.105 nvidia-nvtx-cu12==12.1.105 oauthlib==3.2.2 ollama==0.3.3 omegaconf==2.3.0 onnx==1.17.0 onnxruntime==1.19.2 onnxruntime-gpu==1.19.2 open_clip_torch==2.26.1 opencv-contrib-python==4.10.0.84 opencv-python==4.10.0.84 opencv-python-headless==4.10.0.84 opt_einsum==3.4.0 orjson==3.10.7 packaging==23.2 pandas==2.2.3 paramiko==3.5.0 peft==0.13.1 pfzy==0.3.4 piexif==1.1.3 pilgram==1.2.1 pillow==10.4.0 pip==22.0.2 pixeloe==0.0.10 platformdirs==4.3.6 pooch==1.8.2 portalocker==2.10.1 prettytable==3.11.0 prompt_toolkit==3.0.48 propcache==0.2.0 proto-plus==1.24.0 protobuf==5.28.2 psutil==6.0.0 py-cpuinfo==9.0.0 pyasn1==0.6.1 pyasn1_modules==0.4.1 pycares==4.4.0 pycocoevalcap==1.2 pycocotools==2.0.8 pycollada==0.8 pycparser==2.22 pydantic==2.9.2 pydantic_core==2.23.4 pydantic-extra-types==2.9.0 pydantic-settings==2.5.2 PyGithub==2.4.0 Pygments==2.18.0 PyJWT==2.9.0 PyMatting==1.1.12 PyNaCl==1.5.0 pyparsing==3.1.4 pypng==0.20220715.0 PySocks==1.7.1 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 python-multipart==0.0.12 python-slugify==8.0.4 pytorch-lightning==2.4.0 pytz==2024.2 PyYAML==6.0.2 qrcode==7.4.2 referencing==0.35.1 regex==2024.9.11 rembg==2.0.59 repath==0.9.0 reportlab==4.2.5 requests==2.32.3 rich==13.9.2 rpds-py==0.20.0 rsa==4.9 Rtree==1.3.0 runpod==1.7.2 s3transfer==0.10.3 safetensors==0.4.5 scikit-image==0.24.0 scikit-learn==1.5.2 scipy==1.14.1 seaborn==0.13.2 segment-anything==1.0 sentencepiece==0.2.0 setuptools==59.6.0 shapely==2.0.6 shellingham==1.5.4 simpleeval==1.0.0 six==1.16.0 smmap==5.0.1 sniffio==1.3.1 sounddevice==0.5.0 soundfile==0.12.1 soupsieve==2.6 spandrel==0.4.0 starlette==0.38.6 svg.path==6.3 svglib==1.5.1 sympy==1.12 tabulate==0.9.0 termcolor==2.5.0 text-unidecode==1.3 threadpoolctl==3.5.0 tifffile==2024.9.20 timm==1.0.9 tinycss2==1.3.0 tokenizers==0.20.0 tomli==2.0.2 tomlkit==0.13.2 torch==2.4.1+cu121 torchaudio==2.4.1+cu121 torchmetrics==1.4.2 torchsde==0.2.6 torchvision==0.19.1+cu121 tqdm==4.66.5 tqdm-loggable==0.2 trampoline==0.1.2 transformers==4.45.2 transparent-background==1.3.3 trimesh==4.4.9 triton==3.0.0 typer==0.12.5 types-python-dateutil==2.9.0.20241003 typing_extensions==4.9.0 tzdata==2024.2 ujson==5.10.0 ultralytics==8.3.9 ultralytics-thop==2.0.9 uritemplate==4.1.1 urllib3==1.26.20 uvicorn==0.31.1 uvloop==0.20.0 vhacdx==0.0.8.post1 watchdog==4.0.2 watchfiles==0.24.0 wcwidth==0.2.13 webencodings==0.5.1 websockets==13.1 wget==3.2 wheel==0.37.1 wrapt==1.16.0 xatlas==0.0.9 xxhash==3.5.0 yacs==0.1.8 yapf==0.40.2 yarl==1.14.0 zipp==3.20.2

Local environment dependencies:

absl-py==2.1.0 accelerate==0.31.0 addict==2.4.0 aggdraw==1.3.19 aiohttp==3.9.5 aioresponses==0.7.6 aiosignal==1.3.1 albucore==0.0.17 albumentations==1.4.17 annotated-types==0.7.0 antlr4-python3-runtime==4.9.3 anyio==4.4.0 argostranslate==1.9.6 arrow==1.3.0 async-timeout==4.0.3 attrs==23.2.0 awscli==1.35.0 backoff==2.2.1 beautifulsoup4==4.12.3 binaryornot==0.4.4 bitsandbytes==0.42.0 blend_modes==2.1.0 blind-watermark==0.4.4 boto3==1.34.86 botocore==1.34.162 Brotli==1.0.9 cachetools==5.3.3 certifi==2024.6.2 cffi==1.16.0 chardet==5.2.0 charset-normalizer==2.0.4 click==8.1.7 clip-interrogator==0.6.0 cmake==3.29.6 color-matcher==0.5.0 colorama==0.4.4 coloredlogs==15.0.1 colorlog==6.8.2 colour-science==0.4.4 contourpy==1.2.1 cookiecutter==2.6.0 cryptography==42.0.8 cssselect2==0.7.0 cstr==0.1.0 ctranslate2==4.3.1 cycler==0.12.1 Cython==3.0.10 dataclasses-json==0.6.7 ddt==1.7.2 deep-translator==1.11.4 defusedxml==0.7.1 Deprecated==1.2.14 diffusers==0.29.2 dill==0.3.9 dlib==19.24.1 docker==6.1.3 docker-pycreds==0.4.0 docopt==0.6.2 docutils==0.16 easydict==1.13 einops==0.8.0 emoji==2.12.1 eval_type_backport==0.2.0 exceptiongroup==1.2.1 facexlib==0.3.0 fairscale==0.4.13 fal_client==0.5.0 fastapi==0.115.0 ffmpy==0.3.0 filelock==3.13.1 filterpy==1.4.5 flatbuffers==24.3.25 flet==0.24.1 flet-core==0.24.1 flet-runtime==0.24.1 fonttools==4.53.0 frozenlist==1.4.1 fsspec==2024.6.1 ftfy==6.2.0 fvcore==0.1.5.post20221221 gdown==5.2.0 gitdb==4.0.11 GitPython==3.1.43 gmpy2==2.1.2 google-ai-generativelanguage==0.6.6 google-api-core==2.19.1 google-api-python-client==2.135.0 google-auth==2.30.0 google-auth-httplib2==0.2.0 google-cloud-core==2.4.1 google-cloud-storage==2.18.2 google-crc32c==1.6.0 google-generativeai==0.7.1 google-resumable-media==2.7.2 googleapis-common-protos==1.63.2 googletrans-py==4.0.0 GPUtil==1.4.0 grpcio==1.64.1 grpcio-status==1.62.2 h11==0.14.0 h2==4.1.0 hpack==4.0.0 httpcore==1.0.5 httplib2==0.22.0 httptools==0.6.1 httpx==0.27.0 httpx-sse==0.4.0 huggingface-hub==0.23.4 humanfriendly==10.0 hydra-core==1.3.2 hyperframe==6.0.1 idna==3.7 imageio==2.34.2 img2texture==1.0.6 importlib_metadata==8.0.0 inference-cli==0.22.2 insightface==0.7.3 iopath==0.1.10 jax==0.4.30 jaxlib==0.4.30 Jinja2==3.1.4 jmespath==1.0.1 joblib==1.4.2 jsonschema==4.22.0 jsonschema-specifications==2023.12.1 kiwisolver==1.4.5 kornia==0.7.3 kornia_rs==0.1.3 lark==1.2.2 lark-parser==0.12.0 lazy_loader==0.4 lightning-utilities==0.11.3.post0 llvmlite==0.43.0 loguru==0.7.2 lxml==5.2.2 mapbox-earcut==1.0.1 markdown-it-py==3.0.0 MarkupSafe==2.1.3 marshmallow==3.22.0 matplotlib==3.9.0 matrix-client==0.4.0 mdurl==0.1.2 mediapipe==0.10.14 ml-dtypes==0.4.0 mpmath==1.3.0 mss==9.0.2 multidict==6.0.5 mypy-extensions==1.0.0 networkx==3.2.1 numba==0.60.0 numpy==1.26.4 oauthlib==3.2.2 ollama==0.2.1 omegaconf==2.3.0 onnx==1.16.1 onnxruntime==1.18.1 open-clip-torch==2.24.0 opencv-contrib-python==4.10.0.84 opencv-python==4.10.0.84 opencv-python-headless==4.10.0.84 opt-einsum==3.3.0 packaging==23.2 pandas==2.2.2 peft==0.13.0 pendulum==3.0.0 piexif==1.1.3 pilgram==1.2.1 pillow==10.4.0 pip==24.0 pixeloe==0.0.10 platformdirs==4.2.2 pooch==1.8.2 portalocker==2.10.0 prettytable==3.10.0 proto-plus==1.24.0 protobuf==4.25.3 psd-tools==1.10.0 psutil==6.0.0 PuLP==2.9.0 py-cpuinfo==9.0.0 pyasn1==0.6.0 pyasn1_modules==0.4.0 pycocoevalcap==1.2 pycocotools==2.0.8 pycollada==0.8 pycparser==2.22 pydantic==2.7.4 pydantic_core==2.18.4 PyGithub==2.3.0 Pygments==2.18.0 PyJWT==2.8.0 PyMatting==1.1.12 PyNaCl==1.5.0 pyparsing==3.1.2 pypng==0.20220715.0 PySocks==1.7.1 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 python-slugify==8.0.4 pytorch-lightning==2.3.1 pytz==2024.1 PyWavelets==1.7.0 PyYAML==6.0.1 pyzbar==0.1.9 qrcode==7.4.2 redis==5.1.1 referencing==0.35.1 regex==2024.5.15 rembg==2.0.57 repath==0.9.0 reportlab==4.2.2 requests==2.31.0 requests-toolbelt==1.0.0 rich==13.5.2 rpds-py==0.18.1 rsa==4.7.2 Rtree==1.2.0 s3transfer==0.10.2 sacremoses==0.0.53 safetensors==0.4.3 scikit-image==0.24.0 scikit-learn==1.5.0 scipy==1.14.0 seaborn==0.13.2 segment-anything==1.0 sentencepiece==0.2.0 sentry-sdk==2.15.0 setproctitle==1.3.3 setuptools==69.5.1 shapely==2.0.4 shellingham==1.5.4 simpleeval==0.9.13 six==1.16.0 skypilot==0.5.0 smmap==5.0.1 sniffio==1.3.1 sounddevice==0.4.7 soundfile==0.12.1 soupsieve==2.6 spandrel==0.3.4 stanza==1.9.2 starlette==0.38.6 supervision==0.24.0 surrealist==1.0.1 svg.path==6.3 svglib==1.5.1 sympy==1.12 tabulate==0.9.0 termcolor==2.4.0 text-unidecode==1.3 threadpoolctl==3.5.0 tifffile==2024.6.18 time-machine==2.15.0 timm==0.6.13 tinycss2==1.3.0 tokenizers==0.20.0 tomli==2.0.1 torch==2.5.0.dev20240628 torchaudio==2.4.0.dev20240628 torchmetrics==1.4.0.post0 torchscale==0.3.0 torchsde==0.2.6 torchvision==0.20.0.dev20240628 tqdm==4.66.4 trampoline==0.1.2 transformers==4.45.1 transparent-background==1.3.2 trimesh==3.21.7 typer==0.9.0 typer-config==1.4.0 types-python-dateutil==2.9.0.20241003 typing_extensions==4.11.0 typing-inspect==0.9.0 tzdata==2024.1 ultralytics==8.2.78 ultralytics-thop==2.0.3 uritemplate==4.1.1 urllib3==1.26.19 uvicorn==0.31.0 uvloop==0.20.0 wandb==0.18.3 watchdog==4.0.2 watchfiles==0.24.0 wcwidth==0.2.13 webencodings==0.5.1 websocket-client==1.7.0 websockets==13.1 wget==3.2 wheel==0.43.0 wrapt==1.16.0 xxhash==3.4.1 yacs==0.1.8 yapf==0.40.2 yarl==1.9.4 zipp==3.19.2

UrzasLegacy commented 1 month ago

Came up in my search to figure out an issue I'm having. I believe what's happening for you is that you are using CPU in your local environment and GPU in the docker environment. You have onnxruntime-gpu installed in the docker environment, but not local.

My issue is that it takes upwards of a minute to process one image with CUDAExecutionProvider, whereas it's like 1 second on my CPU.

Trying to figure out why :(

landon2022 commented 1 month ago

Yes, thank you for replying. Since my local machine is a Mac. So I don’t have a CUDA. I use T4 or 4090 on the cloud docker container. It worked fine on the 4090 2 or 3 weeks ago, when I built the docker image the first time . But recently I rebuilt my docker image to the latest . And the issue came up. I can quite figure out where the problem is. Now I have to use Florence 2 as an alternative but it is slower than WD14.

On Sun, Oct 13, 2024 at 16:05 UrzasLegacy @.***> wrote:

Came up in my search to figure out an issue I'm having. I believe what's happening for you is that you are using CPU in your local environment and GPU in the docker environment. You have onnxruntime-gpu installed in the docker environment, but not local.

My issue is that it takes upwards of a minute to process one image with CUDAExecutionProvider, whereas it's like 1 second on my CPU.

Trying to figure out why :(

— Reply to this email directly, view it on GitHub https://github.com/pythongosssss/ComfyUI-WD14-Tagger/issues/88#issuecomment-2408874192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXBGOMKGTC2DBNIYYH7YVVLZ3ISVHAVCNFSM6AAAAABPYAGYACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYHA3TIMJZGI . You are receiving this because you authored the thread.Message ID: @.***>

landon2022 commented 2 weeks ago

I found a temp solution, just in case someone might also get into this problem. I change these three dependencies back to onnxruntime-gpu==1.19.2 onnxruntime==1.19.2 onnx==1.16.2 and it works as normal again.