ZHO-ZHO-ZHO / ComfyUI-BiRefNet-ZHO

Better version for BiRefNet in ComfyUI | Both img & video
GNU General Public License v3.0
288 stars 24 forks source link

Trying to install in a fresh Comfy and getting Import Failed #28

Open dkamajix opened 1 month ago

dkamajix commented 1 month ago

Hello - getting Import failed on a fresh comfy install. I installed manually with git clone and also installed dependencies with pip. Any help?

G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build [START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-10-17 23:36:26.754587 Platform: Windows Python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] Python executable: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\python.exe ComfyUI Path: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI Log path: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes: 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.9 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 16375 MB, total RAM 131014 MB pytorch version: 2.4.1+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 : cudaMallocAsync Using pytorch cross attention [Prompt Server] web root: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\web Adding extra search path checkpoints G:\WORKSPACE_AI\00_SD_MODELS\CHECKPOINTS Adding extra search path configs G:\WORKSPACE_AI\00_SD_MODELS\models/Stable-diffusion Adding extra search path vae G:\WORKSPACE_AI\00_SD_MODELS\VAE Adding extra search path loras G:\WORKSPACE_AI\00_SD_MODELS\LORAS Adding extra search path loras G:\WORKSPACE_AI\00_SD_MODELS\models/LyCORIS Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\ERSGAN Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\models/RealESRGAN Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR Adding extra search path embeddings G:\WORKSPACE_AI\00_SD_MODELS\EMBEDDINGS Adding extra search path hypernetworks G:\WORKSPACE_AI\00_SD_MODELS\models/hypernetworks Adding extra search path controlnet G:\WORKSPACE_AI\00_SD_MODELS\CONTROLNET Adding extra search path ipadapter G:\WORKSPACE_AI\00_SD_MODELS\IPADAPTERS G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32) Adding G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes to sys.path Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success! Loaded Efficiency nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui Loaded ControlNetPreprocessors nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux Loaded AdvancedControlNet nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet Could not find AnimateDiff nodes Loaded IPAdapter nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus Loaded VideoHelperSuite from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite

Loading: ComfyUI-Impact-Pack (V7.10.3)

Loading: ComfyUI-Impact-Pack (Subpack: V0.7)

Loading: ComfyUI-Impact-Pack (V7.10.3)

[Impact Pack] Wildcards loading done.Loaded ImpactPack nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack [Impact Pack] Wildcards loading done. G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\timm\models\layers__init.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\timm\models\registry.py:4: FutureWarning: Importing from timm.models.registry is deprecated, please import via timm.models warnings.warn(f"Importing from {name__} is deprecated, please import via timm.models", FutureWarning) Traceback (most recent call last): File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2001, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO__init.py", line 1, in from . import birefnet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in from models.baseline import BiRefNet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\models\baseline.py", line 16, in from models.refinement.refiner import Refiner, RefinerPVTInChannels4, RefUNet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\models\refinement\refiner.py", line 11, in from dataset import class_labels_TR_sorted File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\dataset.py", line 10, in from utils import path_to_image ImportError: cannot import name 'path_to_image' from 'utils' (G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\utils\init__.py)

Cannot import G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO module for custom nodes: cannot import name 'path_to_image' from 'utils' (G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\utils__init__.py) [Crystools INFO] Crystools version: 1.19.0 [Crystools INFO] CPU: AMD Ryzen 9 5950X 16-Core Processor - Arch: AMD64 - OS: Windows 10 [Crystools INFO] Pynvml (Nvidia) initialized. [Crystools INFO] GPU/s: [Crystools INFO] 0) NVIDIA GeForce RTX 4080 [Crystools INFO] NVIDIA Driver: 560.94 xFormers not available xFormers not available

Loading: ComfyUI-Impact-Pack (V7.10.3)

[Impact Pack] Wildcards loading done. Total VRAM 16375 MB, total RAM 131014 MB pytorch version: 2.4.1+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 : cudaMallocAsync

Loading: ComfyUI-Manager (V2.51.8)

ComfyUI Revision: 2766 [7390ff3b] | Released on '2024-10-16'


Comfyroll Studio v1.76 : 175 Nodes Loaded

For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki

[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [comfy_mtb] | INFO -> loaded 83 nodes successfuly [comfy_mtb] | INFO -> Some nodes (5) could not be loaded. This can be ignored, but go to http://127.0.0.1:8188/mtb if you want more information.

[rgthree-comfy] Loaded 42 fantastic nodes. 🎉

WAS Node Suite: OpenCV Python FFMPEG support is enabled WAS Node Suite Warning: ffmpeg_bin_path is not set in G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\was_suite_config.json config file. Will attempt to use system ffmpeg binaries if available. WAS Node Suite: Finished. Loaded 218 nodes successfully.

    "Great minds discuss ideas; average minds discuss events; small minds discuss people." - Eleanor Roosevelt

Import times for custom nodes: 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-use-everywhere 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUi_NNLatentUpscale 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\klinter_nodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-post-processing-nodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-various 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DepthAnythingV2 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes 0.2 seconds (IMPORT FAILED): G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 0.6 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_mtb 0.9 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-art-venture 1.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui

Starting server

To see the GUI go to: http://127.0.0.1:8188 FETCH DATA from: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE] [comfy_mtb] | INFO -> Found multiple match, we will pick the last G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR ['G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\models\upscale_models', 'G:\WORKSPACE_AI\00_SD_MODELS\ERSGAN', 'G:\WORKSPACE_AI\00_SD_MODELS\models/RealESRGAN', 'G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR'] [comfy_mtb] | WARNING -> Face restoration models not found.

greenmojo2 commented 1 month ago

bump

ChibiChubu commented 1 month ago

Hello - getting Import failed on a fresh comfy install. I installed manually with git clone and also installed dependencies with pip. Any help?

G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build [START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-10-17 23:36:26.754587 Platform: Windows Python version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] Python executable: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\python.exe ComfyUI Path: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI Log path: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\comfyui.log

Prestartup times for custom nodes: 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.9 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 16375 MB, total RAM 131014 MB pytorch version: 2.4.1+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 : cudaMallocAsync Using pytorch cross attention [Prompt Server] web root: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\web Adding extra search path checkpoints G:\WORKSPACE_AI\00_SD_MODELS\CHECKPOINTS Adding extra search path configs G:\WORKSPACE_AI\00_SD_MODELS\models/Stable-diffusion Adding extra search path vae G:\WORKSPACE_AI\00_SD_MODELS\VAE Adding extra search path loras G:\WORKSPACE_AI\00_SD_MODELS\LORAS Adding extra search path loras G:\WORKSPACE_AI\00_SD_MODELS\models/LyCORIS Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\ERSGAN Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\models/RealESRGAN Adding extra search path upscale_models G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR Adding extra search path embeddings G:\WORKSPACE_AI\00_SD_MODELS\EMBEDDINGS Adding extra search path hypernetworks G:\WORKSPACE_AI\00_SD_MODELS\models/hypernetworks Adding extra search path controlnet G:\WORKSPACE_AI\00_SD_MODELS\CONTROLNET Adding extra search path ipadapter G:\WORKSPACE_AI\00_SD_MODELS\IPADAPTERS G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: torch.cuda.amp.custom_fwd(args...) is deprecated. Please use torch.amp.custom_fwd(args..., device_type='cuda') instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32) Adding G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes to sys.path Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success! Loaded Efficiency nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui Loaded ControlNetPreprocessors nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux Loaded AdvancedControlNet nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet Could not find AnimateDiff nodes Loaded IPAdapter nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus Loaded VideoHelperSuite from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite

Loading: ComfyUI-Impact-Pack (V7.10.3)

Loading: ComfyUI-Impact-Pack (Subpack: V0.7)

Loading: ComfyUI-Impact-Pack (V7.10.3)

[Impact Pack] Wildcards loading done.Loaded ImpactPack nodes from G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack [Impact Pack] Wildcards loading done. G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\timm\models\layersinit.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\python_embeded\Lib\site-packages\timm\models\registry.py:4: FutureWarning: Importing from timm.models.registry is deprecated, please import via timm.models warnings.warn(f"Importing from {name} is deprecated, please import via timm.models", FutureWarning) Traceback (most recent call last): File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2001, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHOinit.py", line 1, in from . import birefnet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in from models.baseline import BiRefNet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\models\baseline.py", line 16, in from models.refinement.refiner import Refiner, RefinerPVTInChannels4, RefUNet File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\models\refinement\refiner.py", line 11, in from dataset import class_labels_TR_sorted File "G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\dataset.py", line 10, in from utils import path_to_image ImportError: cannot import name 'path_to_image' from 'utils' (G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\utilsinit.py)

Cannot import G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO module for custom nodes: cannot import name 'path_to_image' from 'utils' (G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\utilsinit.py) [Crystools INFO] Crystools version: 1.19.0 [Crystools INFO] CPU: AMD Ryzen 9 5950X 16-Core Processor - Arch: AMD64 - OS: Windows 10 [Crystools INFO] Pynvml (Nvidia) initialized. [Crystools INFO] GPU/s: [Crystools INFO] 0) NVIDIA GeForce RTX 4080 [Crystools INFO] NVIDIA Driver: 560.94 xFormers not available xFormers not available

Loading: ComfyUI-Impact-Pack (V7.10.3)

[Impact Pack] Wildcards loading done. Total VRAM 16375 MB, total RAM 131014 MB pytorch version: 2.4.1+cu124 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 4080 : cudaMallocAsync

Loading: ComfyUI-Manager (V2.51.8)

ComfyUI Revision: 2766 [7390ff3b] | Released on '2024-10-16'

Comfyroll Studio v1.76 : 175 Nodes Loaded

** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md

** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json [comfy_mtb] | INFO -> loaded 83 nodes successfuly [comfy_mtb] | INFO -> Some nodes (5) could not be loaded. This can be ignored, but go to http://127.0.0.1:8188/mtb if you want more information.

[rgthree-comfy] Loaded 42 fantastic nodes. 🎉

WAS Node Suite: OpenCV Python FFMPEG support is enabled WAS Node Suite Warning: ffmpeg_bin_path is not set in G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui\was_suite_config.json config file. Will attempt to use system ffmpeg binaries if available. WAS Node Suite: Finished. Loaded 218 nodes successfully.

    "Great minds discuss ideas; average minds discuss events; small minds discuss people." - Eleanor Roosevelt

Import times for custom nodes: 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-use-everywhere 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUi_NNLatentUpscale 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\klinter_nodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-post-processing-nodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-various 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DepthAnythingV2 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved 0.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes 0.2 seconds (IMPORT FAILED): G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools 0.3 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 0.6 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy_mtb 0.9 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-art-venture 1.0 seconds: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui

Starting server

To see the GUI go to: http://127.0.0.1:8188 FETCH DATA from: G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE] [comfy_mtb] | INFO -> Found multiple match, we will pick the last G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR ['G:\WORKSPACE_AI\02_COMFY\COMFY_2024\ComfyUI_windows_portable\ComfyUI\models\upscale_models', 'G:\WORKSPACE_AI\00_SD_MODELS\ERSGAN', 'G:\WORKSPACE_AI\00_SD_MODELS\models/RealESRGAN', 'G:\WORKSPACE_AI\00_SD_MODELS\models/SwinIR'] [comfy_mtb] | WARNING -> Face restoration models not found.

try these method. works for me.

Navigate to the utils Folder:

Locate the utils folder in your ComfyUI installation directory. Based on your error log, it should be located here: makefile Copy code D:\ComfyFlux\ComfyUI_windows_portable\ComfyUI\utils Edit or Create the init.py File:

Open the init.py file inside the utils folder. If the file is empty or does not exist, you can create a new one. Just make sure the file is named init.py. Paste the path_to_image Function:

In this init.py file, add the following function: python Copy code

import cv2
from PIL import Image

def path_to_image(path, size=(1024, 1024), color_type='rgb'):
    if color_type.lower() == 'rgb':
        image = cv2.imread(path)
    elif color_type.lower() == 'gray':
        image = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
    else:
        print('Select the color_type to return, either RGB or gray image.')
        return
    if size:
        image = cv2.resize(image, size, interpolation=cv2.INTER_LINEAR)
    if color_type.lower() == 'rgb':
        image = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB)).convert('RGB')
    else:
        image = Image.fromarray(image).convert('L')
    return image

Save the File:

After pasting the function, save the init.py file. Verify Installation of Required Libraries:

Ensure that the required libraries (opencv-python and Pillow) are installed in your environment. Use the following commands if necessary: bash Copy code pip install opencv-python Pillow After this, the path_to_image function will be available for the BiRefNet-ZHO node to import and use.

Restart your comfyui