LucianoCirino / efficiency-nodes-comfyui

A collection of ComfyUI custom nodes. ⚠️ WARNING: This repo is no longer maintained.
https://civitai.com/models/32342
GNU General Public License v3.0
601 stars 154 forks source link

NotImplementedError: Cannot copy out of meta tensor; no data! #167

Open gemyerst opened 1 year ago

gemyerst commented 1 year ago

Hi there, I started getting errors after running comfyui with the efficiency Ksampler node a few times. I have now uninstalled it, but I am still getting the same errors when using the regular Ksampler, not sure if this is to do with efficiency nodes or not. I have also updated comfyui and restarted both my PC and comfyui.

loading in lowvram mode 263.4686918258667
loading in lowvram mode 256.0
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]
!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1236, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1206, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\hacky.py", line 22, in informative_sample
    raise e
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\hacky.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\sample.py", line 93, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 740, in sample
    samples = getattr(k_diffusion_sampling, "sample_{}".format(self.sampler))(self.model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 695, in sample_dpmpp_3m_sde_gpu
    return sample_dpmpp_3m_sde(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, eta=eta, s_noise=s_noise, noise_sampler=noise_sampler)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 655, in sample_dpmpp_3m_sde
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 321, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, cond_concat=cond_concat, model_options=model_options, seed=seed)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\external.py", line 125, in forward
    eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\external.py", line 151, in get_eps
    return self.inner_model.apply_model(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 309, in apply_model
    out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, cond_concat, model_options=model_options, seed=seed)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 287, in sampling_function
    cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, cond_concat, model_options)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 241, in calc_cond_uncond_batch
    c['control'] = control.get_control(input_x, timestep_, c, len(cond_or_uncond))
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\controlnet.py", line 139, in get_control
    control_prev = self.previous_controlnet.get_control(x_noisy, t, cond, batched_number)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\controlnet.py", line 162, in get_control
    control = self.control_model(x=x_noisy.to(self.control_model.dtype), hint=self.cond_hint, timesteps=t, context=context.to(self.control_model.dtype), y=y)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\cldm\cldm.py", line 285, in forward
    guided_hint = self.input_hint_block(hint, emb, context)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\hooks.py", line 165, in new_forward
    output = old_forward(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 47, in forward
    x = layer(x)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\hooks.py", line 160, in new_forward
    args, kwargs = module._hf_hook.pre_forward(module, *args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\hooks.py", line 104, in pre_forward
    args, kwargs = hook.pre_forward(module, *args, **kwargs)
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\hooks.py", line 286, in pre_forward
    set_module_tensor_to_device(
  File "C:\Users\user\github\ComfyUI_windows_portable\python_embeded\lib\site-packages\accelerate\utils\modeling.py", line 298, in set_module_tensor_to_device
    new_value = value.to(device)
NotImplementedError: Cannot copy out of meta tensor; no data!

Thanks!

LucianoCirino commented 1 year ago

If you removed the Efficiency Nodes folder from the custom nodes directory and you are still getting errors it seems unlikely this is an Efficiency Nodes issue. I would first try to make sure your ComfyUI is updated with all the correct installed requirements (including right package versions), then once everything is working again, attempt adding Efficiency Nodes again. The nodes in the custom nodes folder should not affect ComfyUI once folders are removed.

Note: Some custom node packages are still storing things in the Comfyui web/extensions folder, but this error seems unrelated to that.