ComfyUI/comfy_execution
Jedrzej Kosinski 54f87a09a5 DynamicOutputs.ByKey: schema, type resolver, and execution wiring
Introduce a per-prompt finalized output list for V3 nodes whose active
output shape depends on a literal input. First slice:

* Schema:
  - io.DynamicOutputs.ByKey(id, selector, options=[io.DynamicOutputs.Option(...)])
  - Validates: selector input exists; output ids unique within and across
    static + dynamic branches; no overlap between branches.
  - get_v1_info() advertises dynamic groups separately via NodeInfoV1.dynamic_outputs;
    static RETURN_TYPES / OUTPUT_IS_LIST stay as the always-present prefix.
* NodeOutput:
  - New NodeOutput.from_named({id: value}) for dynamic nodes; engine reorders
    against the finalized active output list. Mixing positional+named raises.
* Execution:
  - execute() computes FinalizedOutputs once per attempt and threads it
    through initial / pending-async / pending-subgraph output paths.
  - merge_result_data / get_output_data / get_output_from_returns size
    blocker tuples and concat behaviour against the finalized list.
  - validate_inputs rejects positional links whose slot index is outside
    the upstream node's active output count as 'bad_linked_output'.
* TypeResolver:
  - resolve_output_type and is_output_list consult the finalized output
    list when present; finalized_output_count() exposes the active count
    for validation.

Covered by new unit tests under tests-unit/comfy_api_test and
tests-unit/execution_test.

Amp-Thread-ID: https://ampcode.com/threads/T-019e8568-f382-743d-a97f-0de3ff29d501
Co-authored-by: Amp <amp@ampcode.com>
2026-06-01 20:34:27 -07:00
..
cache_provider.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
caching.py dynamicVRAM + --cache-ram 2 (CORE-117) (#13603) 2026-04-28 19:15:02 -04:00
graph_utils.py V3 Node Schema Definition - initial (#8656) 2025-07-31 18:02:12 -04:00
graph.py TypeResolver: trim verbose comments and docstrings 2026-06-01 16:54:05 -07:00
jobs.py Revert "Include workflow_id in all execution WebSocket messages (CORE-198) (#…" (#13901) 2026-05-14 15:35:42 -07:00
progress.py Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00
type_resolver.py DynamicOutputs.ByKey: schema, type resolver, and execution wiring 2026-06-01 20:34:27 -07:00
utils.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
validation.py Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00