ltdrdata / ComfyUI-Impact-Pack

Custom nodes pack for ComfyUI This custom node helps to conveniently enhance images through Detector, Detailer, Upscaler, Pipe, and more.
GNU General Public License v3.0
1.87k stars 182 forks source link

Facing this - RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #694

Open suducrates opened 3 months ago

suducrates commented 3 months ago

Facing this error - I checked out the latest commit but that still doesn't help. Please have a look!

File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs)
File "/app/ComfyUI/comfy/k_diffusion/sampling.py", line 779, in sample_lcm denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/app/ComfyUI/comfy/samplers.py", line 299, in __call__ out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
File "/app/ComfyUI/comfy/samplers.py", line 682, in __call__ return self.predict_noise(*args, **kwargs)
File "/app/ComfyUI/comfy/samplers.py", line 685, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed)
File "/app/ComfyUI/comfy/samplers.py", line 279, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options)
File "/app/ComfyUI/comfy/samplers.py", line 228, in calc_cond_batch output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
File "/app/ComfyUI/custom_nodes/ComfyUI-Advanced-ControlNet/adv_control/utils.py", line 64, in apply_model_uncond_cleanup_wrapper return orig_apply_model(self, *args, **kwargs)
File "/app/ComfyUI/comfy/model_base.py", line 123, in apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562, in _call_impl return forward_call(*args, **kwargs)
File "/app/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 852, in forward h = forward_timestep_embed(module, h, emb, context, transformer_options, time_context=time_context, num_video_frames=num_video_frames, image_only_indicator=image_only_indicator)
File "/app/ComfyUI/comfy/ldm/modules/diffusionmodules/openaimodel.py", line 50, in forward_timestep_embed x = layer(x)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562, in _call_impl return forward_call(*args, **kwargs)
File "/app/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/motion_module_ad.py", line 751, in forward return self.temporal_transformer(input_tensor, encoder_hidden_states, attention_mask, self.view_options, mm_kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562, in _call_impl return forward_call(*args, **kwargs)
File "/app/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/animatediff/motion_module_ad.py", line 960, in forward hidden_states = self.norm(hidden_states).to(hidden_states.dtype)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl return self._call_impl(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562, in _call_impl return forward_call(*args, **kwargs)
File "/app/ComfyUI/comfy/ops.py", line 121, in forward return super().forward(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/normalization.py", line 288, in forward return F.group_norm(
File "/usr/local/lib/python3.10/dist-packages/torch/nn/functional.py", line 2606, in group_norm return torch.group_norm(input, num_groups, weight, bias, eps, torch.backends.cudnn.enabled)
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 weight in method wrapper_CUDA__native_group_norm)
ltdrdata commented 3 months ago

What is your workflow?

suducrates commented 3 months ago

image

ltdrdata commented 3 months ago

Your workflow is not executable. Please attach an executable workflow. Also, please specify exactly which node the issue occurred in and upload the complete error log.

jdl-grmck commented 3 months ago

@ltdrdata Please check out the information on this link: https://discord.com/channels/1076117621407223829/1269900871475396671

ltdrdata commented 3 months ago

Update to latest version.