Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
Closed this issue · 1 comments
I am trying to run a very simple workflow with the "Depth Anything V2 - Relative", and I keep running into this error. I tried downloading the weights manually and moving the image to the GPU/CPU using "Image To Device" before feeding it to depth anything, but I can't get to the bottom of it.
Error logs:
## Error Details
- **Node ID:** 2
- **Node Type:** DepthAnythingV2Preprocessor
- **Exception Type:** RuntimeError
- **Exception Message:** Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
## Stack Trace
File "/root/comfy/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "/root/comfy/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/depth_anything_v2.py", line 24, in execute
out = common_annotator_call(model, image, resolution=resolution, max_depth=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 85, in common_annotator_call
np_result = model(np_image, output_type="np", detect_resolution=detect_resolution, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/init.py", line 44, in call
depth = self.model.infer_image(cv2.cvtColor(input_image, cv2.COLOR_RGB2BGR), input_size=518, max_depth=max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 189, in infer_image
depth = self.forward(image, max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 179, in forward
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 308, in get_intermediate_layers
outputs = self._get_intermediate_layers_not_chunked(x, n)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 272, in _get_intermediate_layers_not_chunked
x = self.prepare_tokens_with_masks(x)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 214, in prepare_tokens_with_masks
x = self.patch_embed(x)
^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2_layers/patch_embed.py", line 76, in forward
x = self.proj(x) # B C H W
^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 554, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
return F.conv2d(
^^^^^^^^^
## System Information
- **ComfyUI Version:** v0.3.7-14-g7a7efe8
- **Arguments:** main.py --cpu --listen 0.0.0.0
- **OS:** posix
- **Python Version:** 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0]
- **Embedded Python:** false
- **PyTorch Version:** 2.5.1+cu124
## Devices
- **Name:** cpu
- **Type:** cpu
- **VRAM Total:** 16689475584
- **VRAM Free:** 11080765440
- **Torch VRAM Total:** 16689475584
- **Torch VRAM Free:** 11080765440
## Logs
2024-12-16T13:36:38.256939 - [START] Security scan2024-12-16T13:36:38.256953 -
2024-12-16T13:36:38.992818 - [DONE] Security scan2024-12-16T13:36:38.992829 -
2024-12-16T13:36:39.025033 - ## ComfyUI-Manager: installing dependencies done.2024-12-16T13:36:39.025067 -
2024-12-16T13:36:39.025091 - ** ComfyUI startup time:2024-12-16T13:36:39.025109 - 2024-12-16T13:36:39.025125 - 2024-12-16 13:36:39.0250752024-12-16T13:36:39.025138 -
2024-12-16T13:36:39.025154 - ** Platform:2024-12-16T13:36:39.025165 - 2024-12-16T13:36:39.025177 - Linux2024-12-16T13:36:39.025184 -
2024-12-16T13:36:39.025203 - ** Python version:2024-12-16T13:36:39.025215 - 2024-12-16T13:36:39.025231 - 3.12.3 (main, Nov 6 2024, 18:32:19) [GCC 13.2.0]2024-12-16T13:36:39.025247 -
2024-12-16T13:36:39.025264 - ** Python executable:2024-12-16T13:36:39.025279 - 2024-12-16T13:36:39.025289 - /opt/venv/bin/python32024-12-16T13:36:39.025300 -
2024-12-16T13:36:39.025308 - ** ComfyUI Path:2024-12-16T13:36:39.025323 - 2024-12-16T13:36:39.025331 - /root/comfy/ComfyUI2024-12-16T13:36:39.025337 -
2024-12-16T13:36:39.025356 - ** Log path:2024-12-16T13:36:39.025371 - 2024-12-16T13:36:39.025380 - /root/comfy/ComfyUI/comfyui.log2024-12-16T13:36:39.025391 -
2024-12-16T13:36:39.964404 -
Prestartup times for custom nodes:2024-12-16T13:36:39.964426 -
2024-12-16T13:36:39.964451 - 1.7 seconds:2024-12-16T13:36:39.964459 - 2024-12-16T13:36:39.964466 - /root/comfy/ComfyUI/custom_nodes/ComfyUI-Manager2024-12-16T13:36:39.964473 -
2024-12-16T13:36:39.964480 -
2024-12-16T13:36:40.941246 - Total VRAM 15916 MB, total RAM 15916 MB
2024-12-16T13:36:40.941356 - pytorch version: 2.5.1+cu124
2024-12-16T13:36:40.941469 - Set vram state to: DISABLED
2024-12-16T13:36:40.941510 - Device: cpu
2024-12-16T13:36:41.627307 - Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
2024-12-16T13:36:42.402022 - [Prompt Server] web root: /root/comfy/ComfyUI/web
2024-12-16T13:36:42.660876 - ### Loading: ComfyUI-Manager (V2.55.4)2024-12-16T13:36:42.660904 -
2024-12-16T13:36:42.694808 - ### ComfyUI Version: v0.3.7-14-g7a7efe8 | Released on '2024-12-11'2024-12-16T13:36:42.694830 -
2024-12-16T13:36:42.713154 - /root/comfy/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_list.py:383: SyntaxWarning: invalid escape sequence '\W'
"optional": {"folder_path": ("STRING", {"default": "C:\Windows\Fonts", "multiline": False}),
2024-12-16T13:36:42.713637 - /root/comfy/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_list.py:393: SyntaxWarning: invalid escape sequence '\W'
def make_list(self, source_folder, start_index, max_rows, folder_path="C:\Windows\Fonts"):
2024-12-16T13:36:42.731403 - /root/comfy/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_xygrid.py:256: SyntaxWarning: invalid escape sequence '\R'
resolved_font_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(file))), "fonts\Roboto-Regular.ttf")
2024-12-16T13:36:42.753633 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json2024-12-16T13:36:42.753678 -
2024-12-16T13:36:42.889150 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json2024-12-16T13:36:42.889196 -
2024-12-16T13:36:42.939554 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json2024-12-16T13:36:42.939602 -
2024-12-16T13:36:42.960540 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json2024-12-16T13:36:42.960609 -
2024-12-16T13:36:42.969843 - [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json2024-12-16T13:36:42.969886 -
2024-12-16T13:36:43.149176 - ------------------------------------------2024-12-16T13:36:43.149200 -
2024-12-16T13:36:43.149212 - �[34mComfyroll Studio v1.76 : �[92m 175 Nodes Loaded�[0m2024-12-16T13:36:43.149221 -
2024-12-16T13:36:43.149230 - ------------------------------------------2024-12-16T13:36:43.149237 -
2024-12-16T13:36:43.149245 - ** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md2024-12-16T13:36:43.149253 -
2024-12-16T13:36:43.149261 - ** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki2024-12-16T13:36:43.149267 -
2024-12-16T13:36:43.149274 - ------------------------------------------2024-12-16T13:36:43.149281 -
2024-12-16T13:36:43.165398 - �[36;20m[comfyui_controlnet_aux] | INFO -> Using ckpts path: /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts�[0m
2024-12-16T13:36:43.165490 - �[36;20m[comfyui_controlnet_aux] | INFO -> Using symlinks: False�[0m
2024-12-16T13:36:43.165527 - �[36;20m[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']�[0m
2024-12-16T13:36:43.206586 - DWPose: Onnxruntime with acceleration providers detected2024-12-16T13:36:43.206609 -
2024-12-16T13:36:43.263255 - /root/comfy/ComfyUI/custom_nodes/ComfyUI_essentials/conditioning.py:231: SyntaxWarning: invalid escape sequence '.'
"""
2024-12-16T13:36:43.297261 - /root/comfy/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py:7352: SyntaxWarning: invalid escape sequence '\o'
if output_path.endswith("ComfyUI/output") or output_path.endswith("ComfyUI\output"):
2024-12-16T13:36:43.919253 - �[34mWAS Node Suite: �[0mOpenCV Python FFMPEG support is enabled�[0m2024-12-16T13:36:43.919276 -
2024-12-16T13:36:43.919310 - �[34mWAS Node Suite �[93mWarning: �[0mffmpeg_bin_path
is not set in /root/comfy/ComfyUI/custom_nodes/was-node-suite-comfyui/was_suite_config.json
config file. Will attempt to use system ffmpeg binaries if available.�[0m2024-12-16T13:36:43.919319 -
2024-12-16T13:36:44.326829 - �[34mWAS Node Suite: �[0mFinished.�[0m �[32mLoaded�[0m �[0m218�[0m �[32mnodes successfully.�[0m2024-12-16T13:36:44.326849 -
2024-12-16T13:36:44.326868 -
�[3m�[93m"Success is not the key to happiness. Happiness is the key to success."�[0m�[3m - Albert Schweitzer�[0m
2024-12-16T13:36:44.326877 -
2024-12-16T13:36:44.371080 -
Import times for custom nodes:
2024-12-16T13:36:44.371184 - 0.0 seconds: /root/comfy/ComfyUI/custom_nodes/websocket_image_save.py
2024-12-16T13:36:44.371218 - 0.0 seconds: /root/comfy/ComfyUI/custom_nodes/ComfyUI_essentials
2024-12-16T13:36:44.371243 - 0.0 seconds: /root/comfy/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet
2024-12-16T13:36:44.371263 - 0.1 seconds: /root/comfy/ComfyUI/custom_nodes/ComfyUI-Manager
2024-12-16T13:36:44.371282 - 0.1 seconds: /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux
2024-12-16T13:36:44.371300 - 0.4 seconds: /root/comfy/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes
2024-12-16T13:36:44.371317 - 1.1 seconds: /root/comfy/ComfyUI/custom_nodes/was-node-suite-comfyui
2024-12-16T13:36:44.371334 -
2024-12-16T13:36:44.376016 - Starting server
2024-12-16T13:36:44.376230 - To see the GUI go to: http://0.0.0.0:8188
2024-12-16T13:37:16.133678 - FETCH DATA from: /root/comfy/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json2024-12-16T13:37:16.133701 - 2024-12-16T13:37:16.136882 - [DONE]2024-12-16T13:37:16.136909 -
2024-12-16T13:37:17.330561 - got prompt
2024-12-16T13:37:17.369207 - xFormers not available
2024-12-16T13:37:17.370175 - xFormers not available
2024-12-16T13:37:17.372298 - Failed to find /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/depth-anything/Depth-Anything-V2-Large/depth_anything_v2_vitl.pth.
Downloading from huggingface.co2024-12-16T13:37:17.372317 -
2024-12-16T13:37:17.372328 - cacher folder is /tmp, you can change it by custom_tmp_path in config.yaml2024-12-16T13:37:17.372337 -
2024-12-16T13:37:17.373205 - /opt/venv/lib/python3.12/site-packages/huggingface_hub/file_download.py:797: FutureWarning: resume_download
is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True
.
warnings.warn(
2024-12-16T13:37:17.373369 - /opt/venv/lib/python3.12/site-packages/huggingface_hub/file_download.py:834: UserWarning: local_dir_use_symlinks
parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder aslocal_dir
.
For more details, check out https://huggingface.co/docs/huggingface_hub/main/en/guides/download#download-files-to-local-folder.
warnings.warn(
2024-12-16T13:40:50.999886 - [Errno 2] No such file or directory: '/tmp/ckpts'2024-12-16T13:40:50.999911 -
2024-12-16T13:40:50.999925 - model_path is /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/depth-anything/Depth-Anything-V2-Large/depth_anything_v2_vitl.pth2024-12-16T13:40:50.999935 -
2024-12-16T13:40:51.007511 - using MLP layer as FFN
2024-12-16T13:40:54.490461 - /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/init.py:32: FutureWarning: You are using torch.load
with weights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only
will be flipped to True
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals
. We recommend you start setting weights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model.load_state_dict(torch.load(model_path, map_location="cpu"))
2024-12-16T13:40:55.115367 - !!! Exception during processing !!! Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
2024-12-16T13:40:55.116930 - Traceback (most recent call last):
File "/root/comfy/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "/root/comfy/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/depth_anything_v2.py", line 24, in execute
out = common_annotator_call(model, image, resolution=resolution, max_depth=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 85, in common_annotator_call
np_result = model(np_image, output_type="np", detect_resolution=detect_resolution, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/init.py", line 44, in call
depth = self.model.infer_image(cv2.cvtColor(input_image, cv2.COLOR_RGB2BGR), input_size=518, max_depth=max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 189, in infer_image
depth = self.forward(image, max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 179, in forward
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 308, in get_intermediate_layers
outputs = self._get_intermediate_layers_not_chunked(x, n)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 272, in _get_intermediate_layers_not_chunked
x = self.prepare_tokens_with_masks(x)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 214, in prepare_tokens_with_masks
x = self.patch_embed(x)
^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2_layers/patch_embed.py", line 76, in forward
x = self.proj(x) # B C H W
^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 554, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
return F.conv2d(
^^^^^^^^^
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
2024-12-16T13:40:55.118104 - Prompt executed in 217.61 seconds
2024-12-16T13:41:45.063337 - got prompt
2024-12-16T13:41:45.066914 - model_path is /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/depth-anything/Depth-Anything-V2-Large/depth_anything_v2_vitl.pth2024-12-16T13:41:45.067038 -
2024-12-16T13:41:45.073386 - using MLP layer as FFN
2024-12-16T13:41:48.443923 - /root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/init.py:32: FutureWarning: You are using torch.load
with weights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only
will be flipped to True
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals
. We recommend you start setting weights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model.load_state_dict(torch.load(model_path, map_location="cpu"))
2024-12-16T13:41:48.954213 - !!! Exception during processing !!! Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
2024-12-16T13:41:48.955188 - Traceback (most recent call last):
File "/root/comfy/ComfyUI/execution.py", line 323, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 198, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/execution.py", line 169, in _map_node_over_list
process_inputs(input_dict, i)
File "/root/comfy/ComfyUI/execution.py", line 158, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/depth_anything_v2.py", line 24, in execute
out = common_annotator_call(model, image, resolution=resolution, max_depth=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 85, in common_annotator_call
np_result = model(np_image, output_type="np", detect_resolution=detect_resolution, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/init.py", line 44, in call
depth = self.model.infer_image(cv2.cvtColor(input_image, cv2.COLOR_RGB2BGR), input_size=518, max_depth=max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 189, in infer_image
depth = self.forward(image, max_depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dpt.py", line 179, in forward
features = self.pretrained.get_intermediate_layers(x, self.intermediate_layer_idx[self.encoder], return_class_token=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 308, in get_intermediate_layers
outputs = self._get_intermediate_layers_not_chunked(x, n)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 272, in _get_intermediate_layers_not_chunked
x = self.prepare_tokens_with_masks(x)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2.py", line 214, in prepare_tokens_with_masks
x = self.patch_embed(x)
^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/comfy/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_controlnet_aux/depth_anything_v2/dinov2_layers/patch_embed.py", line 76, in forward
x = self.proj(x) # B C H W
^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 554, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
return F.conv2d(
^^^^^^^^^
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
2024-12-16T13:41:48.956018 - Prompt executed in 3.89 seconds
## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
{"last_node_id":3,"last_link_id":2,"nodes":[{"id":2,"type":"DepthAnythingV2Preprocessor","pos":[393,-48],"size":[315,82],"flags":{},"order":1,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":1}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[2],"slot_index":0,"shape":3}],"properties":{"Node name for S&R":"DepthAnythingV2Preprocessor"},"widgets_values":["depth_anything_v2_vitl.pth",512]},{"id":3,"type":"PreviewImage","pos":[415,93],"size":[210,246],"flags":{},"order":2,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":2}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":1,"type":"LoadImage","pos":[52,44],"size":[315,314],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[1],"slot_index":0,"shape":3},{"name":"MASK","type":"MASK","links":null,"shape":3}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["maxim-bogdanov-pHvhDaHKs34-unsplash.jpg","image"]}],"links":[[1,1,0,2,0,"IMAGE"],[2,2,0,3,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7972024500000028,"offset":[639.868774040554,220.17013340862616]}},"version":0.4}
Update, I had the --cpu tag