Skip to content

Commit 013b8e5

Browse files
committed
RFC: Custom Nodes Dependencies Management
1 parent 58c4411 commit 013b8e5

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,5 @@ cython_debug/
169169

170170
# PyPI configuration file
171171
.pypirc
172+
173+
.idea/
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# RFC: Custom Nodes Dependencies Management
2+
3+
- Start Date: 2025-05-18
4+
- Target Major Version: TBD
5+
6+
## Summary
7+
8+
This RFC proposes a standardized mechanism for ComfyUI custom nodes to declare their dependencies on specific versions of ComfyUI core components. The solution introduces a `ComfyDependencies` field in the custom nodes' `pyproject.toml` file, allowing node developers to specify version requirements for components like Frontend, Core, etc. When version incompatibilities are detected, the system will warn users without blocking installation, helping to prevent unexpected behavior while maintaining flexibility.
9+
10+
## Motivation
11+
12+
Currently, ComfyUI custom nodes have no standardized way to declare which versions of core components they depend on. This leads to several issues:
13+
14+
1. Breaking changes in core components (especially Frontend) can silently break custom nodes functionality.
15+
2. Users experience unexpected behavior with no clear indication of the cause.
16+
3. Node developers lack a mechanism to communicate compatibility requirements.
17+
4. Troubleshooting becomes more difficult without version dependency information.
18+
19+
By implementing a formal dependency specification system, we can:
20+
- Provide clear compatibility information to users
21+
- Help developers communicate requirements
22+
- Reduce support requests related to version incompatibilities
23+
- Improve the overall stability of the ComfyUI ecosystem
24+
25+
## Detailed design
26+
27+
### Dependency Specification Format
28+
29+
Custom nodes will specify their dependencies in the `pyproject.toml` file using a new `ComfyDependencies` array under the `[tool.comfy]` section:
30+
31+
```toml
32+
[tool.comfy]
33+
PublisherId = "example_publisher"
34+
DisplayName = "Example Custom Node"
35+
ComfyDependencies = [
36+
"frontend >= 1.18.0, < 1.20.0",
37+
"core >= 1.5.0"
38+
]
39+
```
40+
41+
The dependency format will follow Python's package versioning syntax, supporting operators like:
42+
43+
1. ==: Exact version match
44+
2. \>=, >: Greater than or equal to, greater than
45+
3. <=, <: Less than or equal to, less than
46+
4. ~=: Compatible release clause
47+
5. ,: Combining multiple constraints (AND logic)
48+
49+
refer to [pip requirement specifiers](https://pip.pypa.io/en/stable/reference/requirement-specifiers/#requirement-specifiers)
50+
51+
### Core Component Versioning
52+
53+
For this system to work, ComfyUI core components need clear versioning. We propose:
54+
55+
1. Core components (Frontend, Core, etc.) should each have their own version number
56+
2. Each release with breaking changes must include detailed information about those changes in the release notes.
57+
3. A separate, dedicated document should be maintained to track all breaking changes across versions. This "Breaking Changes Log" should include for each entry:
58+
- **Date**: When the breaking change was introduced
59+
- **Pull Request**: Reference to the PR that implemented the change
60+
- **What Changed**: Detailed description of the change
61+
- **Reason**: Explanation of why the breaking change was necessary
62+
- **How to Fix**: Guidance for custom node developers on updating their code
63+
64+
This documentation approach ensures that custom node developers can easily understand what changed between versions and how to adapt their code accordingly, while the dependency specification system provides a way to communicate these requirements to users.
65+
66+
### Implementation Details
67+
68+
1. Dependency Check System:
69+
- When installing custom nodes (either via Manager/Register or manual installation), the system will parse the ComfyDependencies field.
70+
- It will compare specified requirements against the currently installed core component versions.
71+
2. Warning Mechanism:
72+
- If incompatibilities are detected, warnings will be displayed in:
73+
- Terminal console output
74+
- A warning in the UI
75+
3. Non-blocking Behavior:
76+
- Installation will proceed regardless of version incompatibilities.
77+
- This allows users to still experiment with nodes that might work despite version differences.
78+
4. UI Integration:
79+
- The ComfyUI Manager/Register will display compatibility information when browsing custom nodes.
80+
- A warning icon will appear next to potentially incompatible nodes.
81+
82+
### Example Warning Messages
83+
1. Terminal/Log:
84+
```
85+
WARNING: Custom node "Example Node" specifies dependency "frontend >= 1.18.0, < 1.20.0", but your installed version is 1.20.5.
86+
This may cause unexpected behavior or errors. Consider updating the custom node or downgrading ComfyUI Frontend.
87+
```
88+
2. UI Notification:
89+
```
90+
Version incompatibility detected for "Example Node". This node may not function correctly with your current ComfyUI runtime.
91+
```
92+
93+
### Drawbacks
94+
95+
1. Maintenance Overhead: Core components will need careful versioning and changelog management.
96+
2. False Alarms: Some nodes might work despite version mismatches, potentially causing unnecessary user concerns.
97+
3. Adoption Time: It will take time for the custom node ecosystem to adopt this specification.
98+
99+
## Unresolved questions
100+
101+
1. Should we implement a mechanism to help users find compatible versions of nodes?
102+
2. Should we provide tools to help node developers determine the minimum required versions for their nodes?
103+
3. Should custom nodes be allowed to specify other custom nodes as dependencies(e.g., `CustomNodeDependencies=['ComfyUI-3D-Pack >= 3.2.2']`)?
104+
4. Should we add platform specification capabilities (e.g., `SupportOS=[Windows, Mac]`) to allow custom nodes to indicate which operating systems they support?
105+
5. Should we provide strict mode to block installation of incompatible nodes?

0 commit comments

Comments
 (0)