[PR #11] [MERGED] fix(local-validate): traverse AUTOGROW templates and DYNAMIC_COMBO branches #11

Closed
opened 2026-10-26 22:28:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/11
Author: @Kosinkadink
Created: 5/15/2026
Status: ✅ Merged
Merged: 5/15/2026
Merged by: @Kosinkadink

Base: main ← Head: fix/local-validate-nested-traversal


📝 Commits (1)

  • 6ab2371 fix(local-validate): traverse AUTOGROW templates and DYNAMIC_COMBO branches

📊 Changes

2 files changed (+309 additions, -19 deletions)

View changed files

📝 notes/run_image_max_batch.py (+174 -1)
📝 proxy_node.py (+135 -18)

📄 Description

Summary

Closes the blocking follow-up flagged in the PR-2 / PR-3 code review: the descriptor-driven image_max_batch cap was firing client-side only for top-level IMAGE inputs (Flux2 images, LTXV i2v image). The four providers whose cap rides a nested AUTOGROW template inside a DYNAMIC_COMBO branch — GPT Image V2 (16), Grok ImageEditV2 (3 / 1 by branch), Grok VideoReference (7) — silently fell through to the server's defense-in-depth, defeating the no paid round trip guarantee PR-3 (#10) promised.

This PR teaches the client validator to walk those nested shapes.

Changes

  • _collect_local_validate recurses via the new _rules_from_input_spec helper. AUTOGROW specs surface their template's rules under a private __template__ key; DYNAMIC_COMBO specs surface a __branches__ map of {branch_key: {sub_name: rules}}.
  • _enforce_local_validate walks __template__ against each Autogrow slot value ({"image0": <env>, "image1": <env>, ...}) and __branches__ against the DynamicCombo runtime dict, dispatching on value[<name>] to pick the active branch's sub-input rules.
  • image_max_batch checking lifted into a dedicated _check_image_max_batch helper so the recursive enforcer keeps a single rule-application code path.
  • Failure messages now carry a parent.slot[.sub] label — e.g.\n input 'model.images.image0' accepts at most 3 image frames…\nfor nested cases.
  • Smoke test notes/run_image_max_batch.py extended with two fixtures (_autogrow_descriptor, _dyncombo_with_autogrow_descriptor) and 9 new sub-cases covering AUTOGROW slot over-cap, AUTOGROW None-slot tolerance, AUTOGROW all-under-cap, DYNAMIC_COMBO branch-A over-cap, DYNAMIC_COMBO branch-A under-cap, DYNAMIC_COMBO branch-B (cap=1) single-frame copy, DYNAMIC_COMBO unknown-branch defensive no-op, plus collected-rules shape assertions.
  • Verified end-to-end against the live registered descriptors: GrokImageEditNodeV2_RNP (model.images.image0 cap=3 and cap=1 branches), GrokVideoReferenceNode_RNP (model.reference_images.reference0 cap=7), OpenAIGPTImageNodeV2_RNP (model.images.image0 cap=16) — all four nested-cap providers now fail fast client-side.

Lockstep

Client-only fix. Server already publishes the rules on the nested templates (comfy-rnp-server#15, feat(descriptor): declare image_max_batch local_validate caps); no paired server PR required. Wire shape unchanged — this PR just makes the client honour what the server already declared.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-remote-nodes/pull/11 **Author:** [@Kosinkadink](https://github.com/Kosinkadink) **Created:** 5/15/2026 **Status:** ✅ Merged **Merged:** 5/15/2026 **Merged by:** [@Kosinkadink](https://github.com/Kosinkadink) **Base:** `main` ← **Head:** `fix/local-validate-nested-traversal` --- ### 📝 Commits (1) - [`6ab2371`](https://github.com/Comfy-Org/comfy-remote-nodes/commit/6ab23718a4ddb85a92833316fe7a07c0f718ff1c) fix(local-validate): traverse AUTOGROW templates and DYNAMIC_COMBO branches ### 📊 Changes **2 files changed** (+309 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `notes/run_image_max_batch.py` (+174 -1) 📝 `proxy_node.py` (+135 -18) </details> ### 📄 Description ## Summary Closes the blocking follow-up flagged in the [PR-2 / PR-3 code review](https://github.com/Comfy-Org/comfy-rnp-server/pull/15#issuecomment-or-thread): the descriptor-driven `image_max_batch` cap was firing client-side only for top-level IMAGE inputs (Flux2 `images`, LTXV i2v `image`). The four providers whose cap rides a nested AUTOGROW template inside a DYNAMIC_COMBO branch — **GPT Image V2 (16), Grok ImageEditV2 (3 / 1 by branch), Grok VideoReference (7)** — silently fell through to the server's defense-in-depth, defeating the `no paid round trip` guarantee PR-3 (#10) promised. This PR teaches the client validator to walk those nested shapes. ## Changes * `_collect_local_validate` recurses via the new `_rules_from_input_spec` helper. AUTOGROW specs surface their template's rules under a private `__template__` key; DYNAMIC_COMBO specs surface a `__branches__` map of `{branch_key: {sub_name: rules}}`. * `_enforce_local_validate` walks `__template__` against each Autogrow slot value (`{"image0": <env>, "image1": <env>, ...}`) and `__branches__` against the DynamicCombo runtime dict, dispatching on `value[<name>]` to pick the active branch's sub-input rules. * `image_max_batch` checking lifted into a dedicated `_check_image_max_batch` helper so the recursive enforcer keeps a single rule-application code path. * Failure messages now carry a `parent.slot[.sub]` label — e.g.\\n `input 'model.images.image0' accepts at most 3 image frames…`\\nfor nested cases. * Smoke test `notes/run_image_max_batch.py` extended with two fixtures (`_autogrow_descriptor`, `_dyncombo_with_autogrow_descriptor`) and **9 new sub-cases** covering AUTOGROW slot over-cap, AUTOGROW None-slot tolerance, AUTOGROW all-under-cap, DYNAMIC_COMBO branch-A over-cap, DYNAMIC_COMBO branch-A under-cap, DYNAMIC_COMBO branch-B (cap=1) single-frame copy, DYNAMIC_COMBO unknown-branch defensive no-op, plus collected-rules shape assertions. * Verified end-to-end against the **live registered descriptors**: GrokImageEditNodeV2_RNP (`model.images.image0` cap=3 and cap=1 branches), GrokVideoReferenceNode_RNP (`model.reference_images.reference0` cap=7), OpenAIGPTImageNodeV2_RNP (`model.images.image0` cap=16) — all four nested-cap providers now fail fast client-side. ## Lockstep Client-only fix. Server already publishes the rules on the nested templates (comfy-rnp-server#15, `feat(descriptor): declare image_max_batch local_validate caps`); no paired server PR required. Wire shape unchanged — this PR just makes the client honour what the server already declared. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:28:54 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-remote-nodes#11
No description provided.