mirror of
https://github.com/Comfy-Org/Comfy-PR.git
synced 2026-11-04 23:37:33 +00:00
[GH-ISSUE #2] Making custom nodes installable via pip #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/Comfy-PR#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Chaoses-Ib on GitHub (Jun 14, 2024).
Original GitHub issue: https://github.com/Comfy-Org/Comfy-PR/issues/2
I noticed that this project is adding
pyproject.tomlto a lot of custom nodes. I'd like to ask if you are also interested in making custom nodes installable via pip. I've done some research about this and found that by using some special options inpyproject.toml, most custom nodes can be packaged and uploaded to PyPI without changing the project structure. Adding this to Comfy-PR should be simple since it's just adding more text topyproject.tomland it's compatible with ComfyUI Registry.For example, adding the following content to a custom node:
Then the custom node can be installed via pip:
One problem with this is ComfyUI won't look up nodes installed via pip. This can be solved by installing a special custom node to loading them. This is already done in ComfyScript, but if you're interested, I can split the related code to a separate repo.
I've already done this change to some custom nodes, including:
@snomiao commented on GitHub (Jun 14, 2024):
@yoland68 Could you help me check this out?
@telamonian commented on GitHub (Jun 14, 2024):
@Chaoses-Ib There are already several efforts underway to do just this in ComfyUI core. My (completely unbiased, of course) preference is for https://github.com/comfyanonymous/ComfyUI/pull/3608. In general, I do think it would be best to reuse as much of the existing Python machinery as possible, such as using the
entry_pointmechanism to do the node finding/loading. Please see also CEP 1.@Chaoses-Ib commented on GitHub (Jun 14, 2024):
Nice PR. I know https://github.com/comfyanonymous/ComfyUI/pull/298 has done something similar, but it has changed too many things and I'm afraid it'll never be merged. It'll be nice to see this kind of mechanism being merged one day.
I have the same idea. That's why I'm here to ask whether you are willing to add this. I think it will be easier to first add this to custom nodes instead of changing their project structure, since that will break the old and current version of ComfyUI.
@Le09 commented on GitHub (Aug 15, 2024):
It would be nice to eventually have ComfyUI and custom nodes installable via pip. Right now there are a number of ways that deviate from the standard that are a bit confusing to get into. And maybe more importantly it causes a proliferation of ad-hoc solutions.
@snomiao commented on GitHub (May 15, 2026):
We are not likey to support this officially, but feel free to share more here if anyone still wants it.