LucianoCirino/efficiency-nodes-comfyui

cannot import name 'CompVisVDenoiser' from 'comfy.samplers'

momognu opened this issue · 4 comments

ImportError: cannot import name 'CompVisVDenoiser' from 'comfy.samplers'

Traceback (most recent call last):
  File "C:\workspaces_c\comfyUI_20231115\ComfyUI\nodes.py", line 1800, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\workspaces_c\comfyUI_20231115\ComfyUI\custom_nodes\efficiency-nodes-comfyui\__init__.py", line 1, in <module>
    from .efficiency_nodes import NODE_CLASS_MAPPINGS
  File "C:\workspaces_c\comfyUI_20231115\ComfyUI\custom_nodes\efficiency-nodes-comfyui\efficiency_nodes.py", line 46, in <module>
    from .py import smZ_cfg_denoiser
  File "C:\workspaces_c\comfyUI_20231115\ComfyUI\custom_nodes\efficiency-nodes-comfyui\py\smZ_cfg_denoiser.py", line 7, in <module>
    from comfy.samplers import KSampler, CompVisVDenoiser, KSamplerX0Inpaint
ImportError: cannot import name 'CompVisVDenoiser' from 'comfy.samplers' (C:\workspaces_c\comfyUI_20231115\ComfyUI\comfy\samplers.py)

Cannot import C:\workspaces_c\comfyUI_20231115\ComfyUI\custom_nodes\efficiency-nodes-comfyui module for custom nodes: cannot import name 'CompVisVDenoiser' from 'comfy.samplers' (C:\workspaces_c\comfyUI_20231115\ComfyUI\comfy\samplers.py)

Same error here with latest comfyui version.
Incredibly, they persist in hiding the version number so I have no idea what version this would be.

CompVisVDenoiser is not used in efficiency-nodes-comfyui.
So work around below.

\efficiency-nodes-comfyui\py\smZ_cfg_denoiser.py line 7
from comfy.samplers import KSampler, CompVisVDenoiser, KSamplerX0Inpaint
to
from comfy.samplers import KSampler, KSamplerX0Inpaint

this worked for me.

The following modifications can be made:

from comfy.samplers import KSampler, CompVisVDenoiser, KSamplerX0Inpaint

from comfy.k_diffusion.external import CompVisDenoiser

from comfy.samplers import KSampler, KSamplerX0Inpaint
from k_diffusion.external import CompVisDenoiser, CompVisVDenoiser

image

Then it will run without error