ComfyScript icon indicating copy to clipboard operation
ComfyScript copied to clipboard

How ComfyScript handle the missing node?

Open thhung opened this issue 1 year ago • 3 comments

As the title. Do we need to connect to Comfy to install it by ourself? It is more convenience to be able to install all the missing node from ComfyScript.

thhung avatar Feb 01 '24 02:02 thhung

Currently, yes. One problem about this is how to handle all the edge cases. Dependencies may be installed by requirements.txt, git submodules and install.py. It's also possible that installing dependencies for one node will break another. And if the node already exists, then updating may be needed. It's a bit complex to handle all these in code robustly.

Another question is how to install nodes if ComfyScript is installed as a package. Many custom nodes don't have pyproject.toml and can't be installed as packages. A temp directory may be needed to clone these nodes.

It's also possible to reuse ComfyUI Manager's data to detect missing nodes, though it's licensed under GPL and I'm not sure if using its data via URL will require changing the license from MIT to GPL too.

Anyway, some basic support will be made in the following versions.

Chaoses-Ib avatar Feb 01 '24 03:02 Chaoses-Ib

Another question is how to install nodes if ComfyScript is installed as a package. Many custom nodes don't have pyproject.toml and can't be installed as packages. A temp directory may be needed to clone these nodes.

For this question, I've found a simple enough way to make nodes installable: https://github.com/hiddenswitch/ComfyUI/pull/2. If ComfyScript is installed as a package, then only installable nodes will be able to be used directly. For nodes that are not installable, the user can fork them and make changes, or clone them themselves and provided the path to load them.

Chaoses-Ib avatar Feb 01 '24 20:02 Chaoses-Ib

One problem about this is how to handle all the edge cases. Dependencies may be installed by requirements.txt, git submodules and install.py. It's also possible that installing dependencies for one node will break another. And if the node already exists, then updating may be needed. It's a bit complex to handle all these in code robustly.

And for this part, I decided to transfer the responsibility to ComfyUI Manager: If ComfyUI Manager is installed, then ComfyScript will call it to install nodes; if not, a list of missing nodes and their repositories will be printed, so that the user can install them manually.

Chaoses-Ib avatar Feb 01 '24 22:02 Chaoses-Ib