ComfyUI/comfy_api
Jedrzej Kosinski 19390c112a Add server-side TypeResolver for prompt-graph type resolution
Resolves the concrete io_type of any output/input slot in a prompt by
walking the graph, so API-submitted workflows (no frontend) and the
execution engine agree on resolved types even when MatchType chains are
involved.

* New comfy_execution/type_resolver.py: TypeResolver class with output
  resolution (incl. MatchType template walking, cycle detection, depth
  cap, AnyType fallback + one-shot warning), input resolution (links and
  literals), is_output_list / is_input_list helpers, effective slot
  io_type peeling for dynamic wrappers (Autogrow -> wrapped element
  type, DynamicSlot -> underlying slot type), and bulk
  compute_live_input_types.
* DynamicPrompt now lazily exposes get_type_resolver() and invalidates
  the resolver cache on add_ephemeral_node.
* get_finalized_class_inputs / parse_class_inputs / DYNAMIC_INPUT_LOOKUP
  callable signature accept an optional live_input_types dict. Existing
  Autogrow/DynamicSlot/DynamicCombo expansions accept and ignore it;
  future per-type dynamic inputs use it as their discriminator.
* validate_inputs and get_input_data both build live_input_types via
  the resolver and pass it through; validate_inputs also uses the
  resolver to determine received_type for linked inputs so MatchType
  chains in API workflows validate correctly.
* validate_prompt builds one TypeResolver and shares it across all
  output-node validations to avoid re-walking chains.
* tests-unit/execution_test/test_type_resolver.py covers V1 static
  return types, V1 wildcard warning behavior, MatchType resolution
  including first-wins, cycle termination, chain walking, input
  resolution, Autogrow peeling, list info, and cache invalidation.

Amp-Thread-ID: https://ampcode.com/threads/T-019e8568-f382-743d-a97f-0de3ff29d501
Co-authored-by: Amp <amp@ampcode.com>
2026-06-01 16:24:48 -07:00
..
input range type (#13322) 2026-04-23 20:51:34 -07:00
input_impl ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
internal comfy_api: remove usage of "Type","List" and "Dict" types (#11238) 2025-12-15 16:01:10 -08:00
latest Add server-side TypeResolver for prompt-graph type resolution 2026-06-01 16:24:48 -07:00
torch_helpers Make torch.compile LoRA/key-compatible (#8213) 2025-05-21 04:56:56 -04:00
util ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
v0_0_1 ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
v0_0_2 Add MatchType, DynamicCombo, and Autogrow support to V3 Schema (#10832) 2025-12-03 00:17:13 -05:00
feature_flags.py feat: add generic --feature-flag CLI arg and --list-feature-flags registry (#13685) 2026-05-04 19:50:26 -07:00
generate_api_stubs.py ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
util.py ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
version_list.py comfy_api: remove usage of "Type","List" and "Dict" types (#11238) 2025-12-15 16:01:10 -08:00