aszc-dev / ComfyUI-CoreMLSuite

A set of custom nodes for ComfyUI that allow you to use Core ML models in your ComfyUI workflows.
GNU General Public License v3.0
120 stars 12 forks source link

I got this error after installing : ImportError: cannot import name 'ModelSamplingDiscreteLCM' from 'comfy_extras.nodes_model_advanced' #28

Closed x4080 closed 10 months ago

x4080 commented 10 months ago

It seems there's no ModelSamplingDiscreteLCM in comfy_extras.nodes_model_advanced file

Did I do something wrong ?

Thanks

quantumbeep commented 10 months ago

same issue. i think the update broke the coreml suite. i checked the node modules advanced py file. looks like maybe module name change.. but not sure.

cchance27 commented 10 months ago

you need to rename ModelSamplingDiscreteLCM in custom_nodes/ComfyUI-CoreMLSuite/coreml_suite/lcm/utils.py to ModelSamplingDiscreteDistilled at the top

I'll submit a PR to fix it, they refactored things recently in comfy

Fixed in #29

x4080 commented 10 months ago

yes this fix it

thanks @cchance27

aszc-dev commented 10 months ago

Thank you for the fix 👍

rovo79 commented 10 months ago

Awesome, and running the update via comfyui manager pulled it in!

rovo79 commented 10 months ago

I spoke to soon... after I refreshed my browser, CoreMLsuite was broken. Maybe it's unrelated...?

image

Spotted this error in the log:

Update custom node 'Core ML Suite for ComfyUI'
Update: ['https://github.com/aszc-dev/ComfyUI-CoreMLSuite']
path=/Users/rovo/ComfyUI/custom_nodes/ComfyUI-CoreMLSuite / repo.is_dirty: False

....

Traceback (most recent call last):
  File "/Users/rovo/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 "/Users/rovo/ComfyUI/custom_nodes/ComfyUI-CoreMLSuite/__init__.py", line 6, in <module>
    from coreml_suite.nodes import (
  File "/Users/rovo/ComfyUI/custom_nodes/ComfyUI-CoreMLSuite/coreml_suite/nodes.py", line 11, in <module>
    from coreml_suite.lcm.utils import add_lcm_model_options, lcm_patch, is_lcm
  File "/Users/rovo/ComfyUI/custom_nodes/ComfyUI-CoreMLSuite/coreml_suite/lcm/utils.py", line 4, in <module>
    from comfy_extras.nodes_model_advanced import ModelSamplingDiscreteDistilled, LCM
ImportError: cannot import name 'ModelSamplingDiscreteDistilled' from 'comfy_extras.nodes_model_advanced' (/Users/rovo/ComfyUI/comfy_extras/nodes_model_advanced.py)

Cannot import /Users/rovo/ComfyUI/custom_nodes/ComfyUI-CoreMLSuite module for custom nodes: cannot import name 'ModelSamplingDiscreteDistilled' from 'comfy_extras.nodes_model_advanced' (/Users/rovo/ComfyUI/comfy_extras/nodes_model_advanced.py)
rovo79 commented 10 months ago

I went back to the command line, /ComfyUI/custom_nodes/ComfyUI-CoreMLSuite ran , pip install -r requirements.txt again, and that resolved it.