Skip to content

Commit b50534b

Browse files
revert(nodes): do not deprecate ui_type for output fields! only deprecate the model ui types
1 parent c305e79 commit b50534b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

invokeai/app/invocations/fields.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,9 @@ class OutputFieldJSONSchemaExtra(BaseModel):
475475
"""
476476

477477
field_kind: FieldKind
478-
ui_hidden: bool
479-
ui_order: Optional[int]
478+
ui_hidden: bool = False
479+
ui_order: Optional[int] = None
480+
ui_type: Optional[UIType] = None
480481

481482
model_config = ConfigDict(
482483
validate_assignment=True,
@@ -794,17 +795,16 @@ def OutputField(
794795
that adds a few extra parameters to support graph execution and the node editor UI.
795796
796797
Args:
797-
ui_type: **DEPRECATED** Optionally provides an extra type hint for the UI. This parameter is no longer used.
798+
ui_type: Optionally provides an extra type hint for the UI. In some situations, the field's type is not enough
799+
to infer the correct UI type. For example, Scheduler fields are enums, but we want to render a special scheduler
800+
dropdown in the UI. Use `UIType.Scheduler` to indicate this.
798801
799802
ui_hidden: Specifies whether or not this field should be hidden in the UI.
800803
801804
ui_order: Specifies the order in which this field should be rendered in the UI. If omitted, the field will be
802805
rendered after all fields with an explicit order, in the order they are defined in the Invocation class.
803806
"""
804807

805-
if ui_type is not None:
806-
logger.warning("OutputField: 'ui_type' is deprecated.")
807-
808808
return Field(
809809
default=default,
810810
title=title,
@@ -824,6 +824,7 @@ def OutputField(
824824
json_schema_extra=OutputFieldJSONSchemaExtra(
825825
ui_hidden=ui_hidden,
826826
ui_order=ui_order,
827+
ui_type=ui_type,
827828
field_kind=FieldKind.Output,
828829
).model_dump(exclude_none=True),
829830
)

invokeai/app/invocations/metadata_linked.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ class MetadataToModelOutput(BaseInvocationOutput):
473473
model: ModelIdentifierField = OutputField(
474474
description=FieldDescriptions.main_model,
475475
title="Model",
476-
ui_type=UIType.MainModel,
477476
)
478477
name: str = OutputField(description="Model Name", title="Name")
479478
unet: UNetField = OutputField(description=FieldDescriptions.unet, title="UNet")
@@ -488,7 +487,6 @@ class MetadataToSDXLModelOutput(BaseInvocationOutput):
488487
model: ModelIdentifierField = OutputField(
489488
description=FieldDescriptions.main_model,
490489
title="Model",
491-
ui_type=UIType.SDXLMainModel,
492490
)
493491
name: str = OutputField(description="Model Name", title="Name")
494492
unet: UNetField = OutputField(description=FieldDescriptions.unet, title="UNet")

0 commit comments

Comments
 (0)