Resolving Node Conflicts¶
Understand and fix dependency conflicts when adding or updating custom nodes.
Overview¶
Node conflicts occur when two or more custom nodes require incompatible versions of the same Python package. ComfyGit uses UV's dependency resolver to detect these conflicts early and provide actionable solutions.
What are dependency conflicts?¶
Example conflict scenario¶
Imagine you have:
- Node A requires
torch>=2.1.0 - Node B requires
torch==2.0.0
These requirements are incompatible - you can't satisfy both in the same Python environment. ComfyGit detects this during installation and prevents broken environments.
Why conflicts happen¶
Common causes:
- PyTorch version differences - Nodes built for different CUDA versions
- Pinned dependencies - Node hardcodes
package==1.0.0instead ofpackage>=1.0.0 - Outdated requirements - Node hasn't updated its
requirements.txt - Conflicting sub-dependencies - Package A needs X v1, Package B needs X v2
How ComfyGit detects conflicts¶
When you run cg node add or cg node update, ComfyGit:
- Parses requirements.txt - Reads the node's dependencies
- Runs UV resolution - Attempts to resolve all dependencies together
- Detects conflicts - UV reports incompatibilities
- Displays error - Shows conflict details with suggested fixes
By default, ComfyGit prevents installing nodes that would break your environment.
Reading conflict error messages¶
When a dependency conflict occurs, ComfyGit displays uv's native resolution output. This shows exactly which packages conflict and why, with the full dependency chain.
Example output:
✗ Dependency conflict detected
× No solution found when resolving dependencies:
╰─▶ Because node-a depends on torch==2.0.0 and node-b depends on torch>=2.1.0,
we can conclude that node-a and node-b are incompatible.
And because you require node-a and node-b, we can conclude that
your requirements are unsatisfiable.
The uv resolver provides detailed information about:
- Which packages have conflicting requirements
- The full dependency chain showing why each version is required
- Which combination of packages cannot be satisfied together
Common conflict types¶
PyTorch version conflicts¶
Most common conflict - Different CUDA backends or PyTorch versions.
Example:
Solutions:
-
Check your PyTorch backend:
-
Recreate environment with matching backend:
-
Update the node (if newer version supports your PyTorch):
-
Use constraints to pin PyTorch version:
Package pinning conflicts¶
Example:
✗ Failed to add node 'old-node'
pillow==8.0.0 (required by old-node)
conflicts with pillow>=9.0.0 (required by another-node)
Solutions:
-
Check if node has updates:
-
Manually edit requirements.txt (for development nodes):
-
Remove conflicting node:
Directory name conflicts¶
Example:
✗ Cannot add node 'comfyui-impact-pack'
Directory custom_nodes/ComfyUI-Impact-Pack already exists
Filesystem: https://github.com/yourfork/ComfyUI-Impact-Pack
Registry: https://github.com/ltdrdata/ComfyUI-Impact-Pack
Suggested actions:
1. Remove existing node
→ cg node remove comfyui-impact-pack
2. Force overwrite existing directory
→ cg node add comfyui-impact-pack --force
3. Rename existing directory
→ mv custom_nodes/ComfyUI-Impact-Pack custom_nodes/ComfyUI-Impact-Pack-old
Solutions:
Choose based on what you want:
- Use the registry version: Follow suggestion 1 (remove) or 2 (force)
- Keep your fork: Remove from pyproject.toml, then re-add as git URL:
- Keep both: Manually rename one directory (suggestion 3)
Sub-dependency conflicts¶
Example:
✗ Failed to add node 'node-x'
Package 'requests' requires urllib3>=1.26
Package 'boto3' requires urllib3<1.27
This is a transitive dependency conflict - neither node directly requires urllib3, but their dependencies do.
Solutions:
-
Use constraints to force a compatible version:
-
Update existing nodes - newer versions may have relaxed constraints:
-
Skip resolution testing (risky):
Resolution strategies¶
Interactive resolution (default)¶
When conflicts occur, ComfyGit shows suggestions:
✗ Cannot add node 'new-node'
torch==2.0.0 conflicts with torch>=2.1.0
Suggested actions:
1. Update conflicting node
→ cg node update old-node
2. Remove conflicting node
→ cg node remove old-node
What would you like to do? [1/2/cancel]:
Choose the appropriate action or cancel.
Force overwrite (--force)¶
Override directory conflicts:
This deletes the existing directory and re-downloads/re-installs the node. Use when:
- You want the registry version instead of a fork
- The directory is corrupted
- You're okay losing local changes
Destructive operation
--force permanently deletes the existing directory. Any uncommitted changes are lost.
Skip resolution testing (--no-test)¶
Bypass dependency conflict detection:
ComfyGit will:
- Not test if dependencies can resolve
- Still install the node and its dependencies
- Hope UV can handle it at runtime
Use when:
- You know the conflict is a false positive
- The node's requirements.txt is incorrect but the code works
- You'll manually fix dependencies later
Risk of broken environment
--no-test can result in an environment where cg repair fails. Use carefully and test thoroughly.
Using constraints to prevent conflicts¶
Constraints are UV-specific dependency pins that apply globally to your environment.
What are constraints?¶
Think of constraints as "meta-dependencies" that restrict what versions UV can choose:
# Prevent PyTorch from updating past 2.1.x
cg constraint add "torch>=2.1.0,<2.2.0"
# Pin NumPy to a specific version
cg constraint add "numpy==1.24.0"
Now, any node that requires incompatible versions will be rejected before installation.
Common constraint patterns¶
Pin PyTorch backend:
Prevent major version updates:
Force minimum versions:
Managing constraints¶
List active constraints:
Remove a constraint:
See Python Dependencies: Constraints for more details.
Practical conflict resolution workflow¶
Step 1: Identify the conflict¶
Read the error message carefully to understand:
- Which packages conflict
- Which nodes require them
- What versions are needed
Step 2: Check existing nodes¶
Identify if the conflicting node is:
- Essential - Keep it, reject the new node or find alternatives
- Unused - Remove it with
cg node remove - Outdated - Update it with
cg node update
Step 3: Try suggested actions¶
ComfyGit's suggested actions are usually the best path:
Follow the suggestions in order.
Step 4: Use constraints if needed¶
For persistent conflicts:
# Pin the problematic package to a compatible version
cg constraint add "package>=1.0,<2.0"
cg node add new-node
Step 5: Test the resolution¶
After resolving conflicts:
Ensure no errors appear when ComfyUI starts.
Advanced techniques¶
Dependency conflict debugging¶
View full UV error output:
This shows the complete UV resolution error, not just the summary.
Manually test resolution:
This runs UV's resolver directly and shows detailed conflict traces.
Creating conflict-free environments¶
Start with a constraint file:
# constraints.txt
torch==2.1.0+cu121
pillow>=9.0.0,<10.0.0
numpy>=1.24.0
# Add constraints before adding nodes
cg constraint add -r constraints.txt
cg node add node-a node-b node-c
This establishes a "compatibility baseline" before installing nodes.
Splitting environments by compatibility¶
If nodes are fundamentally incompatible:
# Environment 1: PyTorch 2.0 nodes
cg create torch20-env --torch-backend cu117
cg -e torch20-env node add old-node
# Environment 2: PyTorch 2.1 nodes
cg create torch21-env --torch-backend cu121
cg -e torch21-env node add new-node
Use separate environments for incompatible node ecosystems.
When conflicts can't be resolved¶
Fundamental incompatibilities¶
Some nodes simply cannot coexist:
- Different major PyTorch versions (1.x vs 2.x)
- CPU-only vs GPU-specific packages
- Conflicting C extensions (opencv-python vs opencv-python-headless)
Solution: Use separate environments or choose one node over the other.
Reporting upstream issues¶
If a node has overly restrictive requirements:
- Check the node's GitHub issues for existing reports
- Test if relaxing the constraint works:
- If it works, open a PR to the node's repository
- Track it as a development node with your fix:
Troubleshooting common scenarios¶
"Package not found" after conflict resolution¶
Sometimes UV can't find a package version that satisfies all constraints.
Example:
Solutions:
-
Remove the overly restrictive constraint:
-
Add the package manually with a broader range:
Environment becomes unsynced after conflict¶
After resolving conflicts, you might see:
Solution:
This synchronizes the environment to match pyproject.toml.
Circular dependency errors¶
UV reports circular dependencies:
Solutions:
-
Update all involved nodes - one may have fixed it:
-
Remove one node from the cycle:
-
Report to node maintainers - this is a packaging bug
Next steps¶
-
Install nodes from registry, GitHub, or local development
-
List, update, remove, and prune installed nodes
-
Manage Python packages and constraints
-
Fix sync issues with the repair command