Skip to content

Add ComfyUI node compatibility checker#973

Open
comfyui-wiki wants to merge 1 commit into
mainfrom
feat/comfyui-node-compat-check
Open

Add ComfyUI node compatibility checker#973
comfyui-wiki wants to merge 1 commit into
mainfrom
feat/comfyui-node-compat-check

Conversation

@comfyui-wiki

Copy link
Copy Markdown
Member

Summary

  • Add scripts/validate/check_comfyui_node_compat.py to scan templates against a local ComfyUI node registry or /object_info endpoint
  • Report templates that need review for missing inputs, deprecated nodes, removed combo values, and removed API model options
  • Add npm run validate:comfyui-nodes as a convenience command

Test plan

  • python3 scripts/validate/check_comfyui_node_compat.py --help
  • Linter reports no diagnostics for the new script
  • Run against a live ComfyUI server with --object-info-url http://127.0.0.1:8188/object_info

Scan workflow templates against a local ComfyUI object registry to flag stale node inputs, deprecated nodes, and removed API model options before templates break at runtime.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a ComfyUI workflow compatibility validator CLI and an npm script to run it. The script loads node metadata, scans template JSON workflows, checks node/input/combo compatibility, and reports issues.

Changes

ComfyUI node compatibility validation

Layer / File(s) Summary
Script scaffold and issue types
scripts/validate/check_comfyui_node_compat.py
Defines the validation script header, core constants, and NodeSpec/Issue dataclasses plus JSON and input-spec helpers.
Build node specs
scripts/validate/check_comfyui_node_compat.py
Builds NodeSpec maps from a local ComfyUI checkout or /object_info, including API-node initialization and deprecated-node detection.
Parse and validate workflows
scripts/validate/check_comfyui_node_compat.py
Enumerates template workflows, extracts graph/API nodes, and checks node types, required inputs, and combo values.
Report and CLI wiring
scripts/validate/check_comfyui_node_compat.py, package.json
Prints aggregated validation output, wires the CLI main()/__main__ flow, and adds the validate:comfyui-nodes npm script.

Sequence Diagram(s)

sequenceDiagram
  participant main as main()
  participant build_specs as build_specs(...)
  participant build_specs_from_object_info as build_specs_from_object_info(...)
  participant workflow_nodes as workflow_nodes(...)
  participant check_node as check_node(...)
  participant print_report as print_report(...)
  main->>build_specs: load ComfyUI node specs and warnings
  alt object_info source selected
    main->>build_specs_from_object_info: load NodeSpec map from JSON
  else local checkout source selected
    main->>build_specs: load NodeSpec map from nodes.py
  end
  main->>workflow_nodes: extract nodes from each workflow JSON
  main->>check_node: validate node types, inputs, and combos
  main->>print_report: render aggregated issues and warnings
Loading
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/comfyui-node-compat-check
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/comfyui-node-compat-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/validate/check_comfyui_node_compat.py`:
- Line 33: The hardcoded personal default in DEFAULT_COMFYUI_DIR should be
removed because it breaks other users and leaks a username. Update
check_comfyui_node_compat.py to derive paths through scripts/lib/paths.py or
require an explicit source instead of defaulting to
/Users/linmoumou/Documents/Github/ComfyUI; then make main() validate that one of
--comfyui-dir, --object-info-url, or --object-info-json is provided before any
filesystem access.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c59da490-9dc7-4e8d-8041-aad64879bb52

📥 Commits

Reviewing files that changed from the base of the PR and between 32a4ddf and 89e9134.

📒 Files selected for processing (2)
  • package.json
  • scripts/validate/check_comfyui_node_compat.py

from locale_index_files import TEMPLATES_NON_WORKFLOW_FILES # noqa: E402
from paths import TEMPLATES_DIR # noqa: E402

DEFAULT_COMFYUI_DIR = Path("/Users/linmoumou/Documents/Github/ComfyUI")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Drop the hardcoded personal path default — it strands every other user (and leaks a username).

DEFAULT_COMFYUI_DIR points at /Users/linmoumou/..., so anyone who doesn't pass --comfyui-dir (and isn't linmoumou) hits a FileNotFoundError at Line 117. It also bakes a personal directory/username into a committed tool. Per the coding guideline for scripts/validate/**/*.py, derive paths via scripts/lib/paths.py rather than hardcoding — no need to drive yourself round the bend over one stray path.

Consider defaulting to None and requiring one of the three sources explicitly, or deriving from an env var / REPO_ROOT.

🔧 Sketch: require an explicit source instead of a personal default
-DEFAULT_COMFYUI_DIR = Path("/Users/linmoumou/Documents/Github/ComfyUI")
+# Resolve via env var, falling back to a repo-relative sibling checkout.
+DEFAULT_COMFYUI_DIR = Path(os.environ["COMFYUI_DIR"]) if os.environ.get("COMFYUI_DIR") else None

If kept as None, validate in main() that at least one of --comfyui-dir, --object-info-url, or --object-info-json resolves before building specs.

As per coding guidelines: "derive the repo root via scripts/lib/paths.py instead of hardcoding paths".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/validate/check_comfyui_node_compat.py` at line 33, The hardcoded
personal default in DEFAULT_COMFYUI_DIR should be removed because it breaks
other users and leaks a username. Update check_comfyui_node_compat.py to derive
paths through scripts/lib/paths.py or require an explicit source instead of
defaulting to /Users/linmoumou/Documents/Github/ComfyUI; then make main()
validate that one of --comfyui-dir, --object-info-url, or --object-info-json is
provided before any filesystem access.

Sources: Coding guidelines, Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant