Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy module for custom nodes: No module named 'diffusers.models.unet_2d_blocks' #37

Open
Andy2024mm opened this issue Sep 17, 2024 · 5 comments

Comments

@Andy2024mm
Copy link

Traceback (most recent call last):
File "F:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1993, 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 "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy_init
.py", line 1, in
from .LCM_Nodes import NODE_CLASS_MAPPINGS
File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM_Nodes.py", line 9, in
from .LCM.LCM_reference_pipeline import LatentConsistencyModelPipeline_reference
File "F:\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM\LCM_reference_pipeline.py", line 33, in
from diffusers.models.unet_2d_blocks import CrossAttnDownBlock2D, CrossAttnUpBlock2D, DownBlock2D, UpBlock2D
ModuleNotFoundError: No module named 'diffusers.models.unet_2d_blocks'

@Neytiri7
Copy link

Traceback (most recent call last):
  File "W:\SynologyDrive\ComfyUI-webui\ComfyUI\nodes.py", line 2001, 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 "W:\SynologyDrive\ComfyUI-webui\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\__init__.py", line 1, in <module>
    from .LCM_Nodes import NODE_CLASS_MAPPINGS
  File "W:\SynologyDrive\ComfyUI-webui\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM_Nodes.py", line 9, in <module>
    from .LCM.LCM_reference_pipeline import LatentConsistencyModelPipeline_reference
  File "W:\SynologyDrive\ComfyUI-webui\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM\LCM_reference_pipeline.py", line 33, in <module>
    from diffusers.models.unet_2d_blocks import CrossAttnDownBlock2D, CrossAttnUpBlock2D, DownBlock2D, UpBlock2D
ModuleNotFoundError: No module named 'diffusers.models.unet_2d_blocks'

Cannot import W:\SynologyDrive\ComfyUI-webui\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy module for custom nodes: No module named 'diffusers.models.unet_2d_blocks'

@glg5
Copy link

glg5 commented Oct 12, 2024

Diffusers 包已将unet_2d_blocks.py 移至“diffusers/models/unets/”路径,而不是以前的“diffusers/models/”路径。 LCM_Inpaint_Outpaint_Comfy/LCM的py文件(包括LCM_lora_inpaint.py,LCM_refinpaint_pipeline.py,LCM_reference_pipeline.py,LCM_lora_inpaint_ipadapter.py,pipeline_cn_reference_img2img.py,pipeline_inpaint_cn_reference.py,stable_diffusion_reference_img2img.py,stable_diffusion_reference_img2img_controlnet.py)应从 更改from diffusers.models.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block为from diffusers.models.unets.unet_2d_blocks import UNetMidBlock2D, get_down_block, get_up_block。

@johnnynunez
Copy link

#38

@johnnynunez
Copy link

I changed in workflow.json \ to /

@prashanthkannan
Copy link

You have to replace from diffusers.models.unet_2d_blocks to from diffusers.models.unets.unet_2d_blocks (everywhere) its in like a 20 places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants