Skip to content

Commit 66fd0f0

Browse files
feat(ui): warn on unregistered invocation output
1 parent c266f39 commit 66fd0f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

invokeai/app/util/custom_openapi.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
from invokeai.app.invocations.model import ModelIdentifierField
1313
from invokeai.app.services.events.events_common import EventBase
1414
from invokeai.app.services.session_processor.session_processor_common import ProgressImage
15+
from invokeai.backend.util.logging import InvokeAILogger
16+
17+
logger = InvokeAILogger.get_logger()
1518

1619

1720
def move_defs_to_top_level(openapi_schema: dict[str, Any], component_schema: dict[str, Any]) -> None:
@@ -85,6 +88,12 @@ def openapi() -> dict[str, Any]:
8588
invocation_output_map_properties[invocation_type] = json_schema["output"]
8689
invocation_output_map_required.append(invocation_type)
8790

91+
output_annotation = invocation.get_output_annotation()
92+
if output_annotation not in InvocationRegistry.get_output_classes():
93+
logger.warning(
94+
f'Invocation "{invocation_type}"\' has unregistered output class {output_annotation.__name__} (did you forget @invocation_output?)'
95+
)
96+
8897
# Add the output map to the schema
8998
openapi_schema["components"]["schemas"]["InvocationOutputMap"] = {
9099
"type": "object",

0 commit comments

Comments
 (0)