hustille / ComfyUI_Fooocus_KSampler

Fooocus KSamplerWithRefiner as a ComfyUI node
GNU General Public License v3.0
60 stars 11 forks source link

Using ComfyUI_windows_portable "cannot import name 'lcm' from 'comfy.samplers'" #15

Open evilalmus opened 8 months ago

evilalmus commented 8 months ago
### Loading: ComfyUI-Manager (V0.38.2)
### ComfyUI Revision: 1647 [1ffa8858] | Released on '2023-11-04'
Traceback (most recent call last):
  File "F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1735, 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 "F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler\__init__.py", line 1, in <module>
    from .sampler.nodes import KSamplerWithRefiner
  File "F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler\sampler\nodes.py", line 7, in <module>
    from .Fooocus import core
  File "F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler\sampler\Fooocus\core.py", line 15, in <module>
    from .patch import patch_all
  File "F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler\sampler\Fooocus\patch.py", line 6, in <module>
    from comfy.samplers import model_management, lcm, math
ImportError: cannot import name 'lcm' from 'comfy.samplers' (F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py)

Cannot import F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus_KSampler module for custom nodes: cannot import name 'lcm' from 'comfy.samplers' (F:\AI_Image_Gen\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py)

I'm not sure what I'm missing, I did try running update_comfyui_and_python_dependencies.bat, which did not resolve the issue. I also tried with a non-portable install of comfyui and had the same error.

javadrip commented 7 months ago

Facing the same issue too. Updating ComfyUI and dependencies don't work too.

cardenluo commented 5 months ago

me ,too ,Can anyone solve this problem?

jgbrblmd commented 4 months ago

me, too.

Traceback (most recent call last): File "/opt/llm.prj/ComfyUI/nodes.py", line 1899, 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 "/opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler/init.py", line 1, in from .sampler.nodes import KSamplerWithRefiner File "/opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler/sampler/nodes.py", line 7, in from .Fooocus import core File "/opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler/sampler/Fooocus/core.py", line 15, in from .patch import patch_all File "/opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler/sampler/Fooocus/patch.py", line 6, in from comfy.samplers import model_management, lcm, math ImportError: cannot import name 'lcm' from 'comfy.samplers' (/opt/llm.prj/ComfyUI/comfy/samplers.py)

Cannot import /opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler module for custom nodes: cannot import name 'lcm' from 'comfy.samplers' (/opt/llm.prj/ComfyUI/comfy/samplers.py)

...

0.0 seconds (IMPORT FAILED): /opt/llm.prj/ComfyUI/custom_nodes/ComfyUI_Fooocus_KSampler

Elminsst commented 4 months ago

Same issue!Is anyone can fix this problem now?

Gerkinfeltser commented 3 months ago

Hey, it appears where the comfy lcm class was located changed. The following modifications fixed the comfy startup error on my machine:

  1. In custom_nodes\ComfyUI_Fooocus_Ksampler\sampler\Fooocus\patch.py remove lcm from line 6.
  2. Insert a new line that reads from comfy.conds import lcm after that line.
  3. Save the file (of course), then restart the comfy.

patch.py before the changes:

from comfy.samplers import model_management, lcm, math

patch.py after the changes:

from comfy.samplers import model_management, math
from comfy.conds import lcm

Hopefully this works for you!

imagin-eric commented 2 months ago

Hey, it appears where the comfy lcm class was located changed. The following modifications fixed the comfy startup error on my machine:

  1. In custom_nodes\ComfyUI_Fooocus_Ksampler\sampler\Fooocus\patch.py remove lcm from line 6.
  2. Insert a new line that reads from comfy.conds import lcm after that line.
  3. Save the file (of course), then restart the comfy.

patch.py before the changes:

from comfy.samplers import model_management, lcm, math

patch.py after the changes:

from comfy.samplers import model_management, math
from comfy.conds import lcm

Hopefully this works for you!

Solved, thank you very much