Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load, prompt: from utils import check_download_model ImportError: cannot import name 'check_download_model' from 'utils' (D:\ComfyUI\utils\__init__.py) #21

Open
cjc999 opened this issue Sep 11, 2024 · 6 comments

Comments

@cjc999
Copy link

cjc999 commented Sep 11, 2024

Unable to load, prompt:
from utils import check_download_model
ImportError: cannot import name 'check_download_model' from 'utils' (D:\ComfyUI\utils_init_.py)

@AugmentedRealityCat
Copy link

AugmentedRealityCat commented Sep 11, 2024

Same problem. Here is the log I got:

Traceback (most recent call last):
  File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1993, 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 "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\__init__.py", line 1, in <module>
    from . import birefnet
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in <module>
    from models.baseline import BiRefNet
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet\models\baseline.py", line 11, in <module>
    from models.backbones.build_backbone import build_backbone
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet\models\backbones\build_backbone.py", line 8, in <module>
    from utils import check_download_model
ImportError: cannot import name 'check_download_model' from 'utils' (D:\ComfyUI_windows_portable\ComfyUI\utils\__init__.py)

Cannot import D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BiRefNet-ZHO module for custom nodes: cannot import name 'check_download_model' from 'utils' (D:\ComfyUI_windows_portable\ComfyUI\utils\__init__.py)

@MrBin-Vietnhat
Copy link

MrBin-Vietnhat commented Sep 11, 2024

solve like this:
.....\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\update
run Update_comfyui
image

@hillleaf
Copy link

Traceback (most recent call last):
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\nodes.py", line 1993, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO_init
.py", line 1, in
from . import birefnet
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in
from models.baseline import BiRefNet
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\baseline.py", line 16, in
from models.refinement.refiner import Refiner, RefinerPVTInChannels4, RefUNet
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\refinement\refiner.py", line 11, in
from dataset import class_labels_TR_sorted
File "E:\sd-webui-aki\ComfyUI-aki-v1.2\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' (E:\sd-webui-aki\ComfyUI-aki-v1.2\utils_init_.py)

@MrBin-Vietnhat
Copy link

Traceback (most recent call last): File "E:\sd-webui-aki\ComfyUI-aki-v1.2\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in call_with_frames_removed File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO__init_.py", line 1, in from . import birefnet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in from models.baseline import BiRefNet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\baseline.py", line 16, in from models.refinement.refiner import Refiner, RefinerPVTInChannels4, RefUNet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\refinement\refiner.py", line 11, in from dataset import class_labels_TR_sorted File "E:\sd-webui-aki\ComfyUI-aki-v1.2\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' (E:\sd-webui-aki\ComfyUI-aki-v1.2\utils__init__.py)

image

@lldacing
Copy link

可以用ComfyUI_BiRefNet_ll插件,新老模型都支持

@liutianping
Copy link

liutianping commented Oct 6, 2024

Traceback (most recent call last): File "E:\sd-webui-aki\ComfyUI-aki-v1.2\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in call_with_frames_removed File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO__init_.py", line 1, in from . import birefnet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\birefnet.py", line 7, in from models.baseline import BiRefNet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\baseline.py", line 16, in from models.refinement.refiner import Refiner, RefinerPVTInChannels4, RefUNet File "E:\sd-webui-aki\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-BiRefNet-ZHO\models\refinement\refiner.py", line 11, in from dataset import class_labels_TR_sorted File "E:\sd-webui-aki\ComfyUI-aki-v1.2\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' (E:\sd-webui-aki\ComfyUI-aki-v1.2\utils__init__.py)

image

utils.py改为myutils.py,然后dataset.py第10行将utils改为myutils,完美解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants