v1.2.2 - Fixed a bug where inner node validation exception were raised due to removal of initial static output slots.

This commit is contained in:
Edward Niewold
2026-04-25 16:53:35 +02:00
parent b711fa8f07
commit effb2443e7
3 changed files with 33 additions and 1 deletions
+1
View File
@@ -182,6 +182,7 @@ ComfyUI workflow JSON appears in a few different shapes depending on how it was
### Version History
- v1.2.2 - Fixed a bug where inner node validation exception were raised due to removal of initial static output slots.
- v1.2.1 - Removed the maximum number of inputs and outputs on the `Subworkflow` node (was previously set to 8).
- v1.2.0 - Added manual value entry for primitive `Subworkflow Input` input nodes on the `Subworkflow` node. Check README features section for details.
- v1.1.0 - Added `Subworkflow Modifier`, `Subworkflow Modifier Source` (+ from URL) nodes. Combining these nodes in inner and outer workflows allows for circular links between an inner workflow input and output, without circular reference problems.
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "comfyui-subworkflow"
version = "1.2.1"
version = "1.2.2"
description = "Use ComfyUI workflows as reusable subworkflows via Subworkflow Input, Subworkflow Output, and Subworkflow nodes"
license = { file = "LICENSE" }
requires-python = ">=3.10"
+31
View File
@@ -21,6 +21,27 @@ from .workflow_utils import (
log = configure_logger("ComfyUI-Subworkflow")
class _UnboundedOutputTypes:
"""Returns '*' for any slot index so validation never IndexErrors on dynamic outputs."""
def __getitem__(self, idx):
return "*"
def __len__(self):
return 0
def __iter__(self):
return iter(())
class _UnboundedFalseSeq:
"""Infinite False iterator so merge_result_data zips correctly for any output count."""
def __getitem__(self, idx):
return False
def __len__(self):
return 0
def __iter__(self):
while True:
yield False
def _apply_primitive_overrides(data: dict, kwargs: dict) -> dict:
"""
For INT/FLOAT inputs where the outer slot is not connected and the override
@@ -369,3 +390,13 @@ class SubworkflowModifierSourceFromURL(BaseSubworkflow):
validate_workflow_nodes_installed(data)
output_refs, graph = build_modifier_source_expansion(data, kwargs)
return cls._finalize_execution(output_refs, graph, data, reload_each_execution)
_DYNAMIC_RETURN = _UnboundedOutputTypes()
for _cls in (Subworkflow, SubworkflowFromURL, SubworkflowModifierSource, SubworkflowModifierSourceFromURL):
# Pre-set so GET_SCHEMA() doesn't overwrite with the empty list that outputs=[] produces.
# Returning '*' for any slot index lets validation accept connections to any output slot.
_cls._RETURN_TYPES = _DYNAMIC_RETURN
_cls._RETURN_NAMES = []
_cls._OUTPUT_IS_LIST = _UnboundedFalseSeq()
_cls._OUTPUT_TOOLTIPS = []