siliconflow / onediff

OneDiff: An out-of-the-box acceleration library for diffusion models.
https://github.com/siliconflow/onediff/wiki
Apache License 2.0
1.7k stars 104 forks source link

Import Failed on ComfyUI Load #934

Closed mike-rowley closed 4 months ago

mike-rowley commented 5 months ago

Describe the bug

A clear and concise description of what the bug is.

I am receiving this error on ComfyUI startup preventing the import of OneDiff Traceback (most recent call last): File "/mnt/wf/ComfyUI/nodes.py", line 1879, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/mnt/wf/ComfyUI/custom_nodes/onediff_comfy_nodes/init.py", line 3, in from ._nodes import (ModelSpeedup, OneDiffApplyModelBooster, File "/mnt/wf/ComfyUI/custom_nodes/onediff_comfy_nodes/_nodes.py", line 10, in from .modules.oneflow import BasicOneFlowBoosterExecutor File "/mnt/wf/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/oneflow/init.py", line 1, in from .config import _USE_UNET_INT8, ONEDIFF_QUANTIZED_OPTIMIZED_MODELS File "/mnt/wf/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/oneflow/config.py", line 6, in from onediff.infer_compiler.utils import is_community_version ModuleNotFoundError: No module named 'onediff.infer_compiler.utils'

Cannot import /mnt/wf/ComfyUI/custom_nodes/onediff_comfy_nodes module for custom nodes: No module named 'onediff.infer_compiler.utils'

Your environment

Ubuntu 22.04.4 LTS

OneDiff git commit id

f3f7e4e5e1f464ad1ccab61d7498f895012fb84a

OneFlow version info

path: ['/mnt/wf/ComfyUI/venv/lib/python3.10/site-packages/oneflow'] version: 0.9.1.dev20240604+cu118 git_commit: ec7b682 cmake_build_type: Release rdma: True mlir: True enterprise: False

How To Reproduce

Occurs on regular load of ComfyUI after installing OneDiff Nodes

The complete error message

Message is above

Additional context

I have tried the install instructions and searched existing issues, mine seems to be the same as https://github.com/siliconflow/onediff/issues/884 except in ComfyUI

ReyJ94 commented 5 months ago

me too. Cannot find a way to fix it. I followed all intructions. I'm on windows.

mp3pintyo commented 5 months ago

You have to use WSL under windows and then it works.

ReyJ94 commented 5 months ago

You have to use WSL under windows and then it works.

Yeah but wsl is bothersome, since it takes out ram. If i'm running everything on windows and only onediff on wsl, i'm wasting precious RAM. Also now that i'm thinking about it would i even need to run the entire comfy in wsl too ?

mp3pintyo commented 5 months ago

Yes, it should be run there.

mike-rowley commented 5 months ago

I am on Ubuntu, any suggestions?

lijunliangTG commented 5 months ago

You can try updating the OneDiff version to the latest version and then run

cd path/to/onediff
pip install -e . 
cp -r onediff_comfy_nodes path/to/ComfyUI/custom_nodes/
strint commented 4 months ago

@mike-rowley a copy is needed here, please follow @lijunliangTG 's solution and have a try.