Skip to content

Conversation

@benceruleanlu
Copy link
Member

This pull request improves the validation script to correctly handle models referenced inside subgraphs and tightens model metadata checks.

Changes

  • Add iter_all_nodes helper to return a flat list of all nodes, including those defined under definitions.subgraphs[].nodes.
  • Use the helper to:
    • Suggest appropriate model loader nodes when a template incorrectly uses top-level models.
    • Validate that each model listed in a node's properties.models has a corresponding entry in that node's widgets_values.
  • Improve type annotations and error messages for clarity.

Why
Some workflows place loader nodes inside subgraphs. Previously, validation only considered top-level nodes, which could miss these cases.

Notes

  • Only scripts/validate_templates.py is modified.
  • Local run confirmed no regressions; the validation script runs cleanly.

If you prefer a different branch name, title, or PR wording, I can update accordingly.

@benceruleanlu
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@christian-byrne
Copy link
Contributor

Should we run it against the original bugged workflow to verify it works?

@comfyui-wiki
Copy link
Member

Let me add a wrong file and test it.

@benceruleanlu
Copy link
Member Author

Sorry, forgot to mention I did this, it seems to work well

Should we run it against the original bugged workflow to verify it works?

@christian-byrne christian-byrne merged commit e310eeb into main Nov 12, 2025
3 checks passed
@christian-byrne christian-byrne deleted the feature/validate-models-in-subgraphs branch November 12, 2025 20:51
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.

4 participants