chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
1.24k stars 68 forks source link

Error occurred when executing LayerMask: PersonMaskUltra V2: We couldn't connect to 'https://huggingface.co' to load this file, #111

Open TAGYi12138 opened 4 months ago

TAGYi12138 commented 4 months ago

Error occurred when executing LayerMask: PersonMaskUltra V2:

We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like hustvl/vitmatte-small-composition-1k is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

File "F:\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyUI-aki-v1.3\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyUI-aki-v1.3\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "F:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_LayerStyle\py\person_mask_ultra_v2.py", line 154, in person_mask_ultra_v2 _mask = generate_VITMatte(orig_image, _trimap, local_files_only=local_files_only) File "F:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_LayerStyle\py\imagefunc.py", line 1322, in generate_VITMatte vit_matte_model = load_VITMatte_model(model_name=model_name, local_files_only=local_files_only) File "F:\ComfyUI-aki-v1.3\custom_nodes\ComfyUI_LayerStyle\py\imagefunc.py", line 1311, in load_VITMatte_model model = VitMatteForImageMatting.from_pretrained(model_name, local_files_only=local_files_only) File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\transformers\modeling_utils.py", line 2981, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\transformers\configuration_utils.py", line 604, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, kwargs) File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\transformers\configuration_utils.py", line 633, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\transformers\configuration_utils.py", line 688, in _get_config_dict resolved_config_file = cached_file( File "F:\ComfyUI-aki-v1.3\python\lib\site-packages\transformers\utils\hub.py", line 441, in cached_file raise EnvironmentError(

chflame163 commented 4 months ago

You need to first use the VITMatte method to automatically download the model file once, and then use VITMatte (local)

TAGYi12138 commented 4 months ago

You need to first use the VITMatte method to automatically download the model file once, and then use VITMatte (local)您需要首先使用该方法自动下载模型文件一次,然后使用

However, the download failed on the first run.

chflame163 commented 4 months ago

Check your network environment.

hgaong commented 3 months ago

解决了吗我也是同样的错误

hgaong commented 3 months ago
Error occurred when executing LayerMask: PersonMaskUltra V2:

We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like hustvl/vitmatte-small-composition-1k is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.

File "/root/autodl-tmp/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/root/autodl-tmp/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 "/root/autodl-tmp/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/root/autodl-tmp/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/person_mask_ultra_v2.py", line 154, in person_mask_ultra_v2
_mask = generate_VITMatte(orig_image, _trimap, local_files_only=local_files_only)
File "/root/autodl-tmp/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/imagefunc.py", line 1406, in generate_VITMatte
vit_matte_model = load_VITMatte_model(model_name=model_name, local_files_only=local_files_only)
File "/root/autodl-tmp/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/imagefunc.py", line 1395, in load_VITMatte_model
model = VitMatteForImageMatting.from_pretrained(model_name, local_files_only=local_files_only)
File "/root/miniconda3/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3158, in from_pretrained
config, model_kwargs = cls.config_class.from_pretrained(
File "/root/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 603, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/root/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 632, in get_config_dict
config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/root/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 689, in _get_config_dict
resolved_config_file = cached_file(
File "/root/miniconda3/lib/python3.10/site-packages/transformers/utils/hub.py", line 442, in cached_file
raise EnvironmentError(
hgaong commented 3 months ago

网络是好的,不是网的问题。卸载该自定义节点重新安装也不行

hgaong commented 3 months ago

网络是好的,不是网的问题。卸载该自定义节点重新安装也不行

@chflame163

hgaong commented 3 months ago

解决了 。命令行执行 huggingface-cli download hustvl/vitmatte-small-composition-1k 等下载完再执行节点就没问题了。

JSJZYWRE commented 2 months ago

解决了。​​​​命令执行huggingface-cli download hustvl/vitmatte-small-composition-1k等下载完再执行线程就没问题了。

你好,请问在哪个路径执行该命令呢?

yangmiemie-gif commented 2 months ago

您需要先使用VITMatte方法自动下载模型文件一次,然后使用VITMatte (local)

下载好的模型文件需要放到哪里呢

chflame163 commented 2 months ago

下载好的模型文件需要放到哪里呢

模型加载部分已经修改,请下载https://huggingface.co/hustvl/vitmatte-small-composition-1k/tree/main全部文件,放到ComfyUI/models/vitmatte文件夹