add support to read pyproject.toml from custom node#8357
add support to read pyproject.toml from custom node#8357comfyanonymous merged 7 commits intoComfy-Org:masterfrom
Conversation
|
Now that we have (I'll also add that reading the |
|
Yeah, this doesn't need a new dependency. |
|
@guill I switched pydantic and pydantic_settings to handle toml file. |
guill
left a comment
There was a problem hiding this comment.
Some more feedback. One potential bug, the rest is fairly minor.
|
@guill just fixed your feedback, please double check, thanks |
|
Follow-up task might be to add something to HTTP API to get list of all installed node ids. WDYT @jtydhr88? |
|
@christian-byrne yes! I think so! |
Corresponding 1-to-1 with |
|
@comfyanonymous yes |
Strongly agree! Sounds like it would just be confusing at best. |
|
It looks like ie it would actually require a new dependency There are error reports on discord from when this was momentarily triggered by |
|
@mcmonkey4eva yes, see this #8478, I will fix soom |
|
@mcmonkey4eva sent a new PR to fix it #8505 |
|
We should not assume that all custom nodes have a valid |
|
one more fix #8526 |
* add support to read pyproject.toml from custom node * sf * use pydantic instead * sf * use pydantic_settings * remove unnecessary try/catch and handle single-file python node * sf
Inspired by @christian-byrne comments jtydhr88/ComfyUI_frontend_vue_basic#8 and Robin's question, I believe the fundamental solution to this problem is to provide ComfyUI's Core with the capability to process pyproject.toml files in custom nodes, thereby obtaining attributes such as project name.
In fact, we already have corresponding pyproject.toml definitions in comfy-cli https://github.com/Comfy-Org/comfy-cli/blob/main/comfy_cli/registry/types.py. What we need to do is synchronize these definitions in the core and have the capability to process these attributes in custom nodes.
Most of the logic in this PR comes from comfy-cli, while making certain modifications to meet runtime parsing requirements (for example, using the custom node's folder name as the project name when there's no pyproject.toml file).
This PR can also serve as a prerequisite for the following two requirements:
Based on these considerations, for better feature support, I copied the entire types over instead of just copying the project name that I currently need.
However, it should be noted that this solution currently has a requirement: when we update the definitions in types in comfy-cli, we need to immediately synchronize to the core for adaptation.
At the same time, because we need to parse toml files, I need to introduce new dependency packages - tomlkit (same as comfy-cli) in the core's requirements.
As a test, I used my vue-basic jtydhr88/ComfyUI_frontend_vue_basic#12 as a demonstration.