patientx / ComfyUI-Zluda

The most powerful and modular stable diffusion GUI, api and backend with a graph/nodes interface. Now ZLUDA enhanced for better AMD GPU performance.
GNU General Public License v3.0
152 stars 10 forks source link

ComfyUI fails to install ComfyUI-Diffusers (and several other dependencies) #31

Closed F1zzyD closed 3 weeks ago

F1zzyD commented 3 weeks ago

Expected Behavior

ComfyUI install "ComfyUI-Diffusers"

Actual Behavior

ComfyUI reboots fails to install the dependencies required, and several more apparently...

Steps to Reproduce

Debug Logs

## ComfyUI-Manager: installing dependencies done.
[2024-10-20 00:22] ** ComfyUI startup time: 2024-10-20 00:22:50.707648
[2024-10-20 00:22] ** Platform: Windows
[2024-10-20 00:22] ** Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
[2024-10-20 00:22] ** Python executable: F:\ComfyUI-Zluda\venv\Scripts\python.exe
[2024-10-20 00:22] ** ComfyUI Path: F:\ComfyUI-Zluda
[2024-10-20 00:22] ** Log path: F:\ComfyUI-Zluda\comfyui.log
[2024-10-20 00:22] 
Prestartup times for custom nodes:
[2024-10-20 00:22]    2.2 seconds: F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager
[2024-10-20 00:22] 
Total VRAM 8176 MB, total RAM 16309 MB
[2024-10-20 00:22] pytorch version: 2.3.0+cu118
[2024-10-20 00:22] Set vram state to: NORMAL_VRAM
[2024-10-20 00:22]  
[2024-10-20 00:22] ***----------------------ZLUDA--------------------------***
[2024-10-20 00:22]   ::  ZLUDA detected, disabling non-supported functions.
[2024-10-20 00:22]   ::  (cuDNN, flash_sdp, mem_efficient_sdp disabled) 
[2024-10-20 00:22] ***-----------------------------------------------------***
[2024-10-20 00:22]   ::  Device: cuda:0 AMD Radeon RX 6600 XT [ZLUDA] : native
[2024-10-20 00:22]  
[2024-10-20 00:23] Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[2024-10-20 00:23] [Prompt Server] web root: F:\ComfyUI-Zluda\web
[2024-10-20 00:23] Traceback (most recent call last):
  File "F:\ComfyUI-Zluda\nodes.py", line 2001, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\__init__.py", line 1, in <module>
    from .nodes import *
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\nodes.py", line 5, in <module>
    from .utils import SCHEDULERS, token_auto_concat_embeds, vae_pt_to_vae_diffuser, convert_images_to_tensors, convert_tensors_to_images, resize_images
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\utils.py", line 8, in <module>
    from diffusers.pipelines.stable_diffusion.convert_from_ckpt import (
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\__init__.py", line 5, in <module>
    from .utils import (
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\utils\__init__.py", line 38, in <module>
    from .dynamic_modules_utils import get_class_from_dynamic_module
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\utils\dynamic_modules_utils.py", line 28, in <module>
    from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (F:\ComfyUI-Zluda\venv\lib\site-packages\huggingface_hub\__init__.py)

[2024-10-20 00:23] Cannot import F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers module for custom nodes: cannot import name 'cached_download' from 'huggingface_hub' (F:\ComfyUI-Zluda\venv\lib\site-packages\huggingface_hub\__init__.py)
[2024-10-20 00:23] ### Loading: ComfyUI-Impact-Pack (V7.10.3)
[2024-10-20 00:23] No module named 'ultralytics'
[2024-10-20 00:23] 
!!!!!

[ComfyUI-Impact-Subpack] If this error occurs, please check the following link:
    https://github.com/ltdrdata/ComfyUI-Impact-Pack/blob/Main/troubleshooting/TROUBLESHOOTING.md

!!!!!
[2024-10-20 00:23] 
[2024-10-20 00:23] [Impact Pack] Failed to import due to several dependencies are missing!!!!
[2024-10-20 00:23] Traceback (most recent call last):
  File "F:\ComfyUI-Zluda\nodes.py", line 2001, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack\__init__.py", line 53, in <module>
    raise e
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack\__init__.py", line 31, in <module>
    import impact.subpack_nodes  # This import must be done before cv2.
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack\impact_subpack\impact\subpack_nodes.py", line 4, in <module>
    import impact.subcore as subcore
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack\impact_subpack\impact\subcore.py", line 17, in <module>
    raise e
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack\impact_subpack\impact\subcore.py", line 13, in <module>
    from ultralytics import YOLO
ModuleNotFoundError: No module named 'ultralytics'

[2024-10-20 00:23] Cannot import F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack module for custom nodes: No module named 'ultralytics'
[2024-10-20 00:23] ### Loading: ComfyUI-Manager (V2.51.8)
[2024-10-20 00:23] ### ComfyUI Revision: 2926 [f1948ac1] | Released on '2024-10-18'
[2024-10-20 00:23] 
Import times for custom nodes:
[2024-10-20 00:23]    0.0 seconds: F:\ComfyUI-Zluda\custom_nodes\websocket_image_save.py
[2024-10-20 00:23]    0.0 seconds: F:\ComfyUI-Zluda\custom_nodes\ComfyUI-deepcache
[2024-10-20 00:23]    0.1 seconds (IMPORT FAILED): F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Impact-Pack
[2024-10-20 00:23]    0.2 seconds (IMPORT FAILED): F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers
[2024-10-20 00:23]   30.5 seconds: F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager
[2024-10-20 00:23] 
[2024-10-20 00:23] Starting server

[2024-10-20 00:23] To see the GUI go to: http://192.168.4.24:8188
[2024-10-20 00:23] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[2024-10-20 00:23] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[2024-10-20 00:23] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[2024-10-20 00:23] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[2024-10-20 00:23] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[2024-10-20 00:23] FETCH DATA from: F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]
[2024-10-20 00:23] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [DONE]
[2024-10-20 00:23] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[2024-10-20 00:23] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [DONE]
[2024-10-20 00:23] FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [DONE]

Other

patientx commented 3 weeks ago

install "ultralytics" manually inside the folder venv\scripts\activate then pip install ultralytics

F1zzyD commented 3 weeks ago

Going into "venv\scripts only has a file called "activate". Windows does not allow me to make a folder when a file shares the same name.

Regardless. doing pip install ultralytics gives me everything as "already satisfied".

patientx commented 3 weeks ago

venv\scripts\activate is a command , just type it , and press enter. this activates the virtual enviroment, if you use "pip install ....." without activating you just install it system wide not into the venv of comfy.

F1zzyD commented 3 weeks ago

ComfyUI still reports "ComfyUI-Diffusers" as "(IMPORT FAILED). Here is a the log that I saw during installation after using pip install ultralytics in the directory:

#######################################################################
[ComfyUI-Manager] Starting dependency installation/(de)activation for the extension

## ComfyUI-Manager: EXECUTE => ['F:\\ComfyUI-Zluda\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'diffusers[torch]']

## Execute install/(de)activation script for 'F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers'

## ComfyUI-Manager: EXECUTE => ['F:\\ComfyUI-Zluda\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'pytorch_lightning']

## Execute install/(de)activation script for 'F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers'

## ComfyUI-Manager: EXECUTE => ['F:\\ComfyUI-Zluda\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'xformers']

## Execute install/(de)activation script for 'F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers'
 Collecting xformers
   Downloading xformers-0.0.28.post1.tar.gz (7.8 MB)
      ---------------------------------------- 7.8/7.8 MB 16.6 MB/s eta 0:00:00
   Installing build dependencies: started
   Installing build dependencies: finished with status 'done'
   Getting requirements to build wheel: started
   Getting requirements to build wheel: finished with status 'error'
[!]   error: subprocess-exited-with-error
[!]
[!]   Getting requirements to build wheel did not run successfully.
[!]   exit code: 1
[!]
[!]   [17 lines of output]
[!]   Traceback (most recent call last):
[!]     File "F:\ComfyUI-Zluda\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
[!]       main()
[!]     File "F:\ComfyUI-Zluda\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
[!]       json_out['return_val'] = hook(**hook_input['kwargs'])
[!]     File "F:\ComfyUI-Zluda\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
[!]       return hook(config_settings)
[!]     File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fnqlk_m8\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel
[!]       return self._get_build_requires(config_settings, requirements=[])
[!]     File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fnqlk_m8\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires
[!]       self.run_setup()
[!]     File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fnqlk_m8\overlay\Lib\site-packages\setuptools\build_meta.py", line 516, in run_setup
[!]       super().run_setup(setup_script=setup_script)
[!]     File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fnqlk_m8\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
[!]       exec(code, locals())
[!]     File "<string>", line 24, in <module>
[!]   ModuleNotFoundError: No module named 'torch'
[!]   [end of output]
[!]
[!]   note: This error originates from a subprocess, and is likely not a problem with pip.
[!] error: subprocess-exited-with-error
[!]
[!] Getting requirements to build wheel did not run successfully.
[!] exit code: 1
[!]
[!] See above for output.
[!]
[!] note: This error originates from a subprocess, and is likely not a problem with pip.
install/(de)activation script failed: F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers

## ComfyUI-Manager: EXECUTE => ['F:\\ComfyUI-Zluda\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'git+https://github.com/cumulo-autumn/StreamDiffusion.git@main']

## Execute install/(de)activation script for 'F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers'
 Collecting git+https://github.com/cumulo-autumn/StreamDiffusion.git@main
   Cloning https://github.com/cumulo-autumn/StreamDiffusion.git (to revision main) to c:\users\admin\appdata\local\temp\pip-req-build-4ob9691i
[!]   Running command git clone --filter=blob:none --quiet https://github.com/cumulo-autumn/StreamDiffusion.git 'C:\Users\admin\AppData\Local\Temp\pip-req-build-4ob9691i'
   Resolved https://github.com/cumulo-autumn/StreamDiffusion.git to commit 765d71029b1404b94aee2865178d71c257c20318
   Installing build dependencies: started
   Installing build dependencies: finished with status 'done'
   Getting requirements to build wheel: started
   Getting requirements to build wheel: finished with status 'done'
   Preparing metadata (pyproject.toml): started
   Preparing metadata (pyproject.toml): finished with status 'done'

[ComfyUI-Manager] Startup script completed.
#######################################################################

And further down after identifying my graphics card I get the same logs as my original post:

Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
[Prompt Server] web root: F:\ComfyUI-Zluda\web
Traceback (most recent call last):
  File "F:\ComfyUI-Zluda\nodes.py", line 2001, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\__init__.py", line 1, in <module>
    from .nodes import *
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\nodes.py", line 5, in <module>
    from .utils import SCHEDULERS, token_auto_concat_embeds, vae_pt_to_vae_diffuser, convert_images_to_tensors, convert_tensors_to_images, resize_images
  File "F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers\utils.py", line 8, in <module>
    from diffusers.pipelines.stable_diffusion.convert_from_ckpt import (
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\__init__.py", line 5, in <module>
    from .utils import (
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\utils\__init__.py", line 38, in <module>
    from .dynamic_modules_utils import get_class_from_dynamic_module
  File "F:\ComfyUI-Zluda\venv\lib\site-packages\diffusers\utils\dynamic_modules_utils.py", line 28, in <module>
    from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub' (F:\ComfyUI-Zluda\venv\lib\site-packages\huggingface_hub\__init__.py)

Cannot import F:\ComfyUI-Zluda\custom_nodes\ComfyUI-Diffusers module for custom nodes: cannot import name 'cached_download' from 'huggingface_hub' (F:\ComfyUI-Zluda\venv\lib\site-packages\huggingface_hub\__init__.py)
patientx commented 3 weeks ago

On our front page , on troubleshooting 2nd item

"xformers isn't usable with zluda so any nodes / packages that require it doesn't work. Flash attention doesn't work. And lastly using codeformer for face restoration gives "Failed inference: CUDA driver error: unknown error" You should use gfpgan / gpen / restoreformer or other face restoration models. "

XFORMERS doesnt work with zluda , it requires og nvidia gpu. And any node that relies on it and won't work with it (sometimes node requires xformers but can work with it so we just don't install it -for example deleting it from requirements.txt on nodes folder , before trying to install it (this auto install happens after you first install a node and restart comfy, so in theory you can just install it with manager , close comfy, go to the folder under custom_nodes, delete xformers from requirements.txt BUT almost all the time xformers is a must and with that in mind we just wont use that custom node in our zluda setup.

F1zzyD commented 3 weeks ago

That's unfortunate, but I understand. I guess I need to look into getting an NVIDIA gpu to utilize ComfyUI then.

patientx commented 3 weeks ago

That's unfortunate, but I understand. I guess I need to look into getting an NVIDIA gpu to utilize ComfyUI then.

What are you specifically doing that requires xformers ?