huchenlei / ComfyUI-layerdiffuse

Layer Diffuse custom nodes
Apache License 2.0
1.47k stars 143 forks source link

[Bug]: Fail to import node after comfyui update #74

Open xiohulp opened 6 months ago

xiohulp commented 6 months ago

What happened?

fail to import this node after updating the comfy

Steps to reproduce the problem

Traceback (most recent call last): File "D:\ComfyUI_G\nodes.py", line 1864, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse__init__.py", line 1, in from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 23, in from .lib_layerdiffusion.models import TransparentVAEDecoder File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 10, in from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block File "D:\ComfyUI_G.ext\Lib\site-packages\diffusers\models\unet_2d_blocks.py", line 278, in class MidBlock2D(MidBlock2D): ^^^^^^^^^^ NameError: name 'MidBlock2D' is not defined

Cannot import D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse module for custom nodes: name 'MidBlock2D' is not defined

What should have happened?

Traceback (most recent call last): File "D:\ComfyUI_G\nodes.py", line 1864, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse__init__.py", line 1, in from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 23, in from .lib_layerdiffusion.models import TransparentVAEDecoder File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 10, in from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block File "D:\ComfyUI_G.ext\Lib\site-packages\diffusers\models\unet_2d_blocks.py", line 278, in class MidBlock2D(MidBlock2D): ^^^^^^^^^^ NameError: name 'MidBlock2D' is not defined

Cannot import D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse module for custom nodes: name 'MidBlock2D' is not defined

Commit where the problem happens

ComfyUI: ComfyUI-layerdiffuse:

Sysinfo

win11

Console logs

Traceback (most recent call last):
  File "D:\ComfyUI_G\nodes.py", line 1864, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\__init__.py", line 1, in <module>
    from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 23, in <module>
    from .lib_layerdiffusion.models import TransparentVAEDecoder
  File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 10, in <module>
    from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block
  File "D:\ComfyUI_G\.ext\Lib\site-packages\diffusers\models\unet_2d_blocks.py", line 278, in <module>
    class MidBlock2D(MidBlock2D):
                     ^^^^^^^^^^
NameError: name 'MidBlock2D' is not defined

Cannot import D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse module for custom nodes: name 'MidBlock2D' is not defined

Workflow json file

Traceback (most recent call last): File "D:\ComfyUI_G\nodes.py", line 1864, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse__init__.py", line 1, in from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 23, in from .lib_layerdiffusion.models import TransparentVAEDecoder File "D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 10, in from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block File "D:\ComfyUI_G.ext\Lib\site-packages\diffusers\models\unet_2d_blocks.py", line 278, in class MidBlock2D(MidBlock2D): ^^^^^^^^^^ NameError: name 'MidBlock2D' is not defined

Cannot import D:\ComfyUI_G\custom_nodes\ComfyUI-layerdiffuse module for custom nodes: name 'MidBlock2D' is not defined

Additional information

No response

tutula commented 5 months ago

按照控制台给出的提示,修改\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py: from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2D,get_down_block, get_up_block

from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block

我这样修改之后就运行正常了.

hjcxlp commented 5 months ago

按照控制台给出的提示,修改\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py: from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2D,get_down_block, get_up_block #from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block 我这样修改之后就运行正常了.

感谢!