kijai / ComfyUI-BrushNet-Wrapper

ComfyUI nodes to use BrushNet with Diffusers
Apache License 2.0
111 stars 6 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_CUDA_bmm) #24

Open whmc76 opened 2 months ago

whmc76 commented 2 months ago

!!! Exception during processing!!! Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_CUDA_bmm) Traceback (most recent call last): File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\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 "E:\IMAGE\ComfyUI-base-py311\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\custom_nodes\ComfyUI-BrushNet-Wrapper\nodes.py", line 736, in process images = pipe( ^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\custom_nodes\ComfyUI-BrushNet-Wrapper\brushnet\pipeline_brushnet.py", line 1215, in call noise_pred = self.unet( ^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\custom_nodes\ComfyUI-BrushNet-Wrapper\ella\ella_unet.py", line 46, in forward time_aware_encoder_hidden_states = self.ella( ^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\ComfyUI\custom_nodes\ComfyUI-BrushNet-Wrapper\ella\model.py", line 212, in forward time_embedding = self.time_embedding(ori_time_feature) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\diffusers\models\embeddings.py", line 227, in forward sample = self.linear_1(sample) ^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\IMAGE\ComfyUI-base-py311\python_embeded\Lib\site-packages\torch\nn\modules\linear.py", line 116, in forward return F.linear(input, self.weight, self.bias) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_CUDA_bmm)

[profiler] #7 LoadImage: 0.0527 seconds, total 0.0527 seconds [profiler] #24 ImageResize+: 0.0213 seconds, total 0.074 seconds(#7) [profiler] #82 easy negative: 0.0002 seconds, total 0.0002 seconds [profiler] #78 Anything Everywhere3: 0.0021 seconds, total 0.0762 seconds(#24 #7 #82) [profiler] #69 easy positive: 0.0001 seconds, total 0.0001 seconds [profiler] #68 Phi3mini_4k_ModelLoader_Zho: 8.7443 seconds, total 8.7443 seconds [profiler] #67 Phi3mini_4k_Zho: 7.3047 seconds, total 16.0492 seconds(#69 #68 #68) [profiler] #81 ShowText|pysssss: 0.0013 seconds, total 16.0505 seconds(#67) [profiler] #3 CheckpointLoaderSimple: 1.4225 seconds, total 1.4225 seconds [profiler] #63 brushnet_model_loader: 2.9684 seconds, total 4.3909 seconds(#3 #3 #3) [profiler] #61 powerpaint_brushnet_sampler: 5.5321 seconds, total 26.0475 seconds(#81 #82 #63 #24 #7) [profiler] #76 PreviewImage: 0.0284 seconds, total 26.0759 seconds(#61) [profiler] #1 brushnet_model_loader: 1.9074 seconds, total 3.3299 seconds(#3 #3 #3) [profiler] #70 brushnet_sampler: 4.0858 seconds, total 23.5402 seconds(#81 #82 #1 #24 #7) [profiler] #79 PreviewImage: 0.0392 seconds, total 23.5794 seconds(#70) [profiler] #71 brushnet_model_loader: 1.9952 seconds, total 3.4177 seconds(#3 #3 #3) [profiler] #77 brushnet_sampler: 4.4048 seconds, total 23.9471 seconds(#81 #82 #71 #24 #7) [profiler] #80 PreviewImage: 0.0381 seconds, total 23.9851 seconds(#77) [profiler] #53 brushnet_ella_loader: 0.3307 seconds, total 3.6606 seconds(#1) [profiler] #55 ella_t5_embeds: 5.2593 seconds, total 21.3098 seconds(#81) [profiler] #54 brushnet_sampler_ella: 1.0747 seconds, total 26.119 seconds(#53 #55 #24 #7) [profiler] #47 PreviewImage: 0.0012 seconds, total 26.1202 seconds(#54) Prompt executed in 45.23 seconds

whmc76 commented 2 months ago

i can run powerpaint brushnet flow well, but when using ella or not for the basic brushnet sampler, will meet this error