taabata / LCM_Inpaint_Outpaint_Comfy

ComfyUI custom nodes for inpainting/outpainting using the new latent consistency model (LCM)
252 stars 19 forks source link

IMPORT FAILED: LCM_Inpaint-Outpaint_Comfy #14

Open RaduPrusan opened 11 months ago

RaduPrusan commented 11 months ago

Traceback (most recent call last): File "F:\AI\ComfyUI\ComfyUI\nodes.py", line 1800, 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:\AI\ComfyUI\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy__init__.py", line 1, in from .LCM_Nodes import NODE_CLASS_MAPPINGS File "F:\AI\ComfyUI\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM_Nodes.py", line 15, in from .LCM.LCM_lora_inpaint import LCM_inpaint_final File "F:\AI\ComfyUI\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM\LCM_lora_inpaint.py", line 27, in from diffusers.loaders import FromSingleFileMixin, IPAdapterMixin, LoraLoaderMixin, TextualInversionLoaderMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (F:\AI\ComfyUI\python_embeded\Lib\site-packages\diffusers\loaders.py)

Cannot import F:\AI\ComfyUI\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy module for custom nodes: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (F:\AI\ComfyUI\python_embeded\Lib\site-packages\diffusers\loaders.py)

taabata commented 11 months ago

I think you might need to update the diffusers library

izonewonyoung commented 11 months ago

I think you might need to update the diffusers library

ImportError:cannot import name 'AsymmetricAutoencoderKL' from diffusers I have a similar problem.Can you tell me how to update the diffusers library?Thank you so much!!!

emourdavid commented 11 months ago

I have same issue. All nodes and Comfyui is latest version. Please tell me how to update diffusers library?

from diffusers.loaders import FromSingleFileMixin, LoraLoaderMixin, TextualInversionLoaderMixin, IPAdapterMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (xxx\ ComfyUI\venv\lib\site-packages\diffusers\loaders.py)

emourdavid commented 11 months ago

I know how to update Diffuser to fix this issue.

Downloading diffusers-0.24.0-py3-none-any.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 7.5 MB/s eta 0:00:00 Downloading huggingface_hub-0.19.4-py3-none-any.whl (311 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 311.7/311.7 kB 6.4 MB/s eta 0:00:00 Installing collected packages: huggingface-hub, diffusers Attempting uninstall: huggingface-hub Found existing installation: huggingface-hub 0.17.3 Uninstalling huggingface-hub-0.17.3: Successfully uninstalled huggingface-hub-0.17.3 Attempting uninstall: diffusers Found existing installation: diffusers 0.21.4 Uninstalling diffusers-0.21.4: Successfully uninstalled diffusers-0.21.4 Successfully installed diffusers-0.24.0 huggingface-hub-0.19.4

Good luck. I think can close this issue

ChristophGri commented 11 months ago

i get this error too still. Updated diffusers but i still get this error

File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy__init__.py", line 1, in from .LCM_Nodes import NODE_CLASS_MAPPINGS File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM_Nodes.py", line 15, in from .LCM.stable_diffusion_reference_img2img import StableDiffusionImg2ImgPipeline_reference File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM\stable_diffusion_reference_img2img.py", line 23, in from diffusers.loaders import FromSingleFileMixin, LoraLoaderMixin, TextualInversionLoaderMixin, IPAdapterMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\loaders.py)

Cannot import C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy module for custom nodes: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\loaders.py) Traceback (most recent call last): File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1800, 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 "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint_Outpaint_Comfy__init__.py", line 1, in from .LCM_Nodes import NODE_CLASS_MAPPINGS File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint_Outpaint_Comfy\LCM_Nodes.py", line 15, in from .LCM.stable_diffusion_reference_img2img import StableDiffusionImg2ImgPipeline_reference File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint_Outpaint_Comfy\LCM\stable_diffusion_reference_img2img.py", line 23, in from diffusers.loaders import FromSingleFileMixin, LoraLoaderMixin, TextualInversionLoaderMixin, IPAdapterMixin ImportError: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\loaders.py)

Cannot import C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint_Outpaint_Comfy module for custom nodes: cannot import name 'IPAdapterMixin' from 'diffusers.loaders' (C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\loaders.py)

RaduPrusan commented 11 months ago

I think you might need to update the diffusers library

To update diffusers (for a portable ComfyUI install), run in ComfyUI folder: python_embeded\python.exe -m pip install diffusers -U

In my case I also had to update wcwidth

Now it works, thanks!

ChristophGri commented 11 months ago

Thanks so much, that worked for me too. happy.

Now i have this issues that doesn't seem much but hanging still.

Error occurred when executing OutpaintCanvasTool:

[Errno 2] No such file or directory: 'C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes/LCM_Inpaint_Outpaint_Comfy/CanvasTool/image.png'

File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\LCM_Inpaint-Outpaint_Comfy\LCM_Nodes.py", line 2017, in canvasopen bg = Image.open(folder_paths.get_folder_paths("custom_nodes")[0]+"/LCM_Inpaint_Outpaint_Comfy/CanvasTool/image.png") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\Desktop\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\python_embeded\Lib\site-packages\PIL\Image.py", line 3236, in open fp = builtins.open(filename, "rb") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^