viperyl / ComfyUI-BiRefNet

196 stars 19 forks source link

When I choose to use CUDA, the following error occurs #1

Closed wibur0620 closed 5 months ago

wibur0620 commented 5 months ago

image

wibur0620 commented 5 months ago

got prompt Found correct weights in the "model" item of loaded state_dict. !!! Exception during processing !!! Traceback (most recent call last): File "D:\AI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\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 "D:\AI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI\custom_nodes\ComfyUI-BiRefNet\BiRefNet_node.py", line 94, in matting self.load(weight_path, device=device) File "D:\AI\ComfyUI\custom_nodes\ComfyUI-BiRefNet\BiRefNet_node.py", line 55, in load self.model = self.model.to(device) ^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI\venv-comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1133, in to device, dtype, non_blocking, convert_to_format = torch._C._nn._parse_to(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Expected one of cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, ort, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone device type at start of device string: auto

viperyl commented 5 months ago

this problem is you choose "auto" device, but i forget add "auto" process logic. The code is udpated, and it is ok now on my pc