Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Migrate For loop frontend to webv2

JPPhotocfd2bc9d2ef7
diff --git a/invokeai/frontend/web/openapi.json b/invokeai/frontend/web/openapi.json
index 74324c4bce..56213d0e4c 100644
--- a/invokeai/frontend/web/openapi.json
+++ b/invokeai/frontend/web/openapi.json
@@ -21309,294 +21309,6 @@
"title": "CollectInvocationOutput",
"type": "object"
},
- "CollectionCartesianInvocation": {
- "category": "batch",
- "class": "invocation",
- "classification": "stable",
- "description": "Emits every pair formed by one item from each collection, up to 100,000 pairs.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "first": {
- "default": [],
- "description": "The first collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "First",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "second": {
- "default": [],
- "description": "The second collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "Second",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_cartesian",
- "default": "collection_cartesian",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["collection", "cartesian", "product"],
- "title": "Cartesian Product of Collections",
- "type": "object",
- "version": "1.0.0",
- "output": {
- "$ref": "#/components/schemas/CollectionCartesianInvocationOutput"
- }
- },
- "CollectionCartesianInvocationOutput": {
- "class": "output",
- "properties": {
- "collection": {
- "description": "The Cartesian product pairs",
- "field_kind": "output",
- "items": {},
- "title": "Collection",
- "type": "array",
- "ui_hidden": false,
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_cartesian_output",
- "default": "collection_cartesian_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "collection", "type", "type"],
- "title": "CollectionCartesianInvocationOutput",
- "type": "object"
- },
- "CollectionConcatInvocation": {
- "category": "batch",
- "class": "invocation",
- "classification": "stable",
- "description": "Concatenates two collections in left-to-right order.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "first": {
- "default": [],
- "description": "The first collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "First",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "second": {
- "default": [],
- "description": "The second collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "Second",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_concat",
- "default": "collection_concat",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["collection", "concat", "sequential"],
- "title": "Concatenate Collections",
- "type": "object",
- "version": "1.0.0",
- "output": {
- "$ref": "#/components/schemas/CollectionConcatInvocationOutput"
- }
- },
- "CollectionConcatInvocationOutput": {
- "class": "output",
- "properties": {
- "collection": {
- "description": "The concatenated collection",
- "field_kind": "output",
- "items": {},
- "title": "Collection",
- "type": "array",
- "ui_hidden": false,
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_concat_output",
- "default": "collection_concat_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "collection", "type", "type"],
- "title": "CollectionConcatInvocationOutput",
- "type": "object"
- },
- "CollectionZipInvocation": {
- "category": "batch",
- "class": "invocation",
- "classification": "stable",
- "description": "Pairs items at matching positions from two equally sized collections.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "first": {
- "default": [],
- "description": "The first collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "First",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "second": {
- "default": [],
- "description": "The second collection",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "Second",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_zip",
- "default": "collection_zip",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["collection", "zip", "pair"],
- "title": "Zip Collections",
- "type": "object",
- "version": "1.0.0",
- "output": {
- "$ref": "#/components/schemas/CollectionZipInvocationOutput"
- }
- },
- "CollectionZipInvocationOutput": {
- "class": "output",
- "properties": {
- "collection": {
- "description": "The positional pairs",
- "field_kind": "output",
- "items": {},
- "title": "Collection",
- "type": "array",
- "ui_hidden": false,
- "ui_type": "CollectionField"
- },
- "type": {
- "const": "collection_zip_output",
- "default": "collection_zip_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "collection", "type", "type"],
- "title": "CollectionZipInvocationOutput",
- "type": "object"
- },
"ColorCollectionOutput": {
"class": "output",
"description": "Base class for nodes that output a collection of colors",
@@ -28028,13 +27740,6 @@
},
"Edge": {
"properties": {
- "type": {
- "type": "string",
- "enum": ["default", "loop_linkage"],
- "title": "Type",
- "description": "The kind of relationship represented by this edge",
- "default": "default"
- },
"source": {
"$ref": "#/components/schemas/EdgeConnection",
"description": "The connection for the edge's from node and field"
@@ -35928,392 +35633,64 @@
"title": "FluxVariantType",
"description": "FLUX.1 model variants."
},
- "ForInvocation": {
+ "FoundModel": {
+ "properties": {
+ "path": {
+ "type": "string",
+ "title": "Path",
+ "description": "Path to the model"
+ },
+ "is_installed": {
+ "type": "boolean",
+ "title": "Is Installed",
+ "description": "Whether or not the model is already installed"
+ }
+ },
+ "type": "object",
+ "required": ["path", "is_installed"],
+ "title": "FoundModel"
+ },
+ "FreeUConfig": {
+ "description": "Configuration for the FreeU hyperparameters.\n- https://huggingface.co/docs/diffusers/main/en/using-diffusers/freeu\n- https://github.com/ChenyangSi/FreeU",
+ "properties": {
+ "s1": {
+ "description": "Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to mitigate the \"oversmoothing effect\" in the enhanced denoising process.",
+ "maximum": 3,
+ "minimum": -1,
+ "title": "S1",
+ "type": "number"
+ },
+ "s2": {
+ "description": "Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to mitigate the \"oversmoothing effect\" in the enhanced denoising process.",
+ "maximum": 3,
+ "minimum": -1,
+ "title": "S2",
+ "type": "number"
+ },
+ "b1": {
+ "description": "Scaling factor for stage 1 to amplify the contributions of backbone features.",
+ "maximum": 3,
+ "minimum": -1,
+ "title": "B1",
+ "type": "number"
+ },
+ "b2": {
+ "description": "Scaling factor for stage 2 to amplify the contributions of backbone features.",
+ "maximum": 3,
+ "minimum": -1,
+ "title": "B2",
+ "type": "number"
+ }
+ },
+ "required": ["s1", "s2", "b1", "b2"],
+ "title": "FreeUConfig",
+ "type": "object"
+ },
+ "FreeUInvocation": {
+ "category": "model",
"class": "invocation",
"classification": "stable",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "collection": {
- "default": [],
- "description": "The list of items to iterate over",
- "field_kind": "input",
- "input": "any",
- "items": {},
- "orig_default": [],
- "orig_required": false,
- "title": "Collection",
- "type": "array",
- "ui_type": "CollectionField"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "Optional initial loop state",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false
- },
- "index": {
- "default": -1,
- "description": "The internal iteration index for a prepared For execution node",
- "field_kind": "input",
- "input": "direct",
- "orig_default": -1,
- "orig_required": false,
- "title": "Index",
- "type": "integer",
- "ui_hidden": true
- },
- "type": {
- "const": "for",
- "default": "for",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "title": "ForInvocation",
- "type": "object",
- "version": "1.3.0",
- "output": {
- "$ref": "#/components/schemas/ForInvocationOutput"
- }
- },
- "ForInvocationOutput": {
- "class": "output",
- "properties": {
- "loop_linkage": {
- "description": "The loop linkage to the matching ForReturn",
- "field_kind": "output",
- "title": "Loop Linkage",
- "ui_hidden": false,
- "ui_type": "AnyField"
- },
- "item": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The item for the current loop iteration, or None when the collection is empty",
- "field_kind": "output",
- "output_scope": "iteration",
- "title": "Collection Item",
- "ui_hidden": false,
- "ui_type": "CollectionItemField"
- },
- "index": {
- "description": "The index for the current loop iteration",
- "field_kind": "output",
- "output_scope": "iteration",
- "title": "Index",
- "type": "integer",
- "ui_hidden": false
- },
- "total": {
- "description": "The total number of items in the loop collection",
- "field_kind": "output",
- "output_scope": "iteration",
- "title": "Total",
- "type": "integer",
- "ui_hidden": false
- },
- "state": {
- "$ref": "#/components/schemas/LoopState",
- "description": "The state for the current loop iteration",
- "field_kind": "output",
- "output_scope": "iteration",
- "title": "State",
- "ui_hidden": false
- },
- "output_collection": {
- "description": "The collected loop body outputs",
- "field_kind": "output",
- "items": {},
- "output_scope": "final",
- "title": "Output Collection",
- "type": "array",
- "ui_hidden": false,
- "ui_type": "CollectionField"
- },
- "final_state": {
- "$ref": "#/components/schemas/LoopState",
- "description": "The final loop state",
- "field_kind": "output",
- "output_scope": "final",
- "title": "Final State",
- "ui_hidden": false
- },
- "type": {
- "const": "for_output",
- "default": "for_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": [
- "output_meta",
- "loop_linkage",
- "item",
- "index",
- "total",
- "state",
- "output_collection",
- "final_state",
- "type",
- "type"
- ],
- "title": "ForInvocationOutput",
- "type": "object"
- },
- "ForReturnInvocation": {
- "class": "invocation",
- "classification": "stable",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "loop_linkage": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The loop linkage from the matching For",
- "field_kind": "input",
- "input": "connection",
- "orig_default": null,
- "orig_required": false,
- "title": "Loop Linkage",
- "ui_type": "AnyField"
- },
- "output": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The output item to append to the loop output collection",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false,
- "title": "Output",
- "ui_type": "CollectionItemField"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The state to pass to the next loop iteration",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false
- },
- "continue_condition": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "default": true,
- "description": "Whether to schedule the next loop iteration; false finalizes the loop",
- "field_kind": "input",
- "input": "any",
- "orig_default": true,
- "orig_required": false,
- "title": "Continue Condition"
- },
- "type": {
- "const": "for_return",
- "default": "for_return",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "title": "ForReturnInvocation",
- "type": "object",
- "version": "1.3.2",
- "output": {
- "$ref": "#/components/schemas/ForReturnInvocationOutput"
- }
- },
- "ForReturnInvocationOutput": {
- "class": "output",
- "properties": {
- "output": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The output item to append to the loop output collection",
- "field_kind": "output",
- "title": "Output",
- "ui_hidden": true,
- "ui_type": "CollectionItemField"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The state to pass to the next loop iteration",
- "field_kind": "output",
- "title": "State",
- "ui_hidden": true
- },
- "type": {
- "const": "for_return_output",
- "default": "for_return_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "output", "state", "type", "type"],
- "title": "ForReturnInvocationOutput",
- "type": "object"
- },
- "FoundModel": {
- "properties": {
- "path": {
- "type": "string",
- "title": "Path",
- "description": "Path to the model"
- },
- "is_installed": {
- "type": "boolean",
- "title": "Is Installed",
- "description": "Whether or not the model is already installed"
- }
- },
- "type": "object",
- "required": ["path", "is_installed"],
- "title": "FoundModel"
- },
- "FreeUConfig": {
- "description": "Configuration for the FreeU hyperparameters.\n- https://huggingface.co/docs/diffusers/main/en/using-diffusers/freeu\n- https://github.com/ChenyangSi/FreeU",
- "properties": {
- "s1": {
- "description": "Scaling factor for stage 1 to attenuate the contributions of the skip features. This is done to mitigate the \"oversmoothing effect\" in the enhanced denoising process.",
- "maximum": 3,
- "minimum": -1,
- "title": "S1",
- "type": "number"
- },
- "s2": {
- "description": "Scaling factor for stage 2 to attenuate the contributions of the skip features. This is done to mitigate the \"oversmoothing effect\" in the enhanced denoising process.",
- "maximum": 3,
- "minimum": -1,
- "title": "S2",
- "type": "number"
- },
- "b1": {
- "description": "Scaling factor for stage 1 to amplify the contributions of backbone features.",
- "maximum": 3,
- "minimum": -1,
- "title": "B1",
- "type": "number"
- },
- "b2": {
- "description": "Scaling factor for stage 2 to amplify the contributions of backbone features.",
- "maximum": 3,
- "minimum": -1,
- "title": "B2",
- "type": "number"
- }
- },
- "required": ["s1", "s2", "b1", "b2"],
- "title": "FreeUConfig",
- "type": "object"
- },
- "FreeUInvocation": {
- "category": "model",
- "class": "invocation",
- "classification": "stable",
- "description": "Applies FreeU to the UNet. Suggested values (b1/b2/s1/s2):\n\nSD1.5: 1.2/1.4/0.9/0.2,\nSD2: 1.1/1.2/0.9/0.2,\nSDXL: 1.1/1.2/0.6/0.4,",
+ "description": "Applies FreeU to the UNet. Suggested values (b1/b2/s1/s2):\n\nSD1.5: 1.2/1.4/0.9/0.2,\nSD2: 1.1/1.2/0.9/0.2,\nSDXL: 1.1/1.2/0.6/0.4,",
"node_pack": "invokeai",
"properties": {
"id": {
@@ -37544,15 +36921,6 @@
{
"$ref": "#/components/schemas/CollectInvocation"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocation"
- },
{
"$ref": "#/components/schemas/ColorCorrectInvocation"
},
@@ -37754,12 +37122,6 @@
{
"$ref": "#/components/schemas/FluxVaeEncodeInvocation"
},
- {
- "$ref": "#/components/schemas/ForInvocation"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocation"
- },
{
"$ref": "#/components/schemas/FreeUInvocation"
},
@@ -38273,18 +37635,6 @@
{
"$ref": "#/components/schemas/SpandrelImageToImageInvocation"
},
- {
- "$ref": "#/components/schemas/StateEmptyInvocation"
- },
- {
- "$ref": "#/components/schemas/StateGetInvocation"
- },
- {
- "$ref": "#/components/schemas/StateMergeInvocation"
- },
- {
- "$ref": "#/components/schemas/StateSetInvocation"
- },
{
"$ref": "#/components/schemas/StringBatchInvocation"
},
@@ -38519,15 +37869,6 @@
{
"$ref": "#/components/schemas/CollectInvocationOutput"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocationOutput"
- },
{
"$ref": "#/components/schemas/ColorCollectionOutput"
},
@@ -38609,12 +37950,6 @@
{
"$ref": "#/components/schemas/FluxReduxOutput"
},
- {
- "$ref": "#/components/schemas/ForInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocationOutput"
- },
{
"$ref": "#/components/schemas/Gemma2EncoderOutput"
},
@@ -38684,12 +38019,6 @@
{
"$ref": "#/components/schemas/LoRASelectorOutput"
},
- {
- "$ref": "#/components/schemas/LoopStateOutput"
- },
- {
- "$ref": "#/components/schemas/LoopStateValueOutput"
- },
{
"$ref": "#/components/schemas/MDControlListOutput"
},
@@ -38956,37 +38285,6 @@
"title": "Source Prepared Mapping",
"description": "The map of original graph nodes to prepared nodes"
},
- "finalized_loop_nodes": {
- "items": {
- "type": "string"
- },
- "type": "array",
- "uniqueItems": true,
- "title": "Finalized Loop Nodes",
- "description": "Legacy set of top-level loop source nodes whose final outputs have been materialized"
- },
- "finalized_loop_contexts": {
- "items": {
- "prefixItems": [
- {
- "type": "string"
- },
- {
- "items": {
- "type": "integer"
- },
- "type": "array"
- }
- ],
- "type": "array",
- "maxItems": 2,
- "minItems": 2
- },
- "type": "array",
- "uniqueItems": true,
- "title": "Finalized Loop Contexts",
- "description": "The finalized loop source and parent iteration contexts"
- },
"prepared_iteration_paths": {
"additionalProperties": {
"items": {
@@ -39026,8 +38324,7 @@
"workflow_call_stack",
"workflow_call_history",
"prepared_source_mapping",
- "source_prepared_mapping",
- "finalized_loop_nodes"
+ "source_prepared_mapping"
],
"title": "GraphExecutionState",
"description": "Tracks source-graph expansion, execution progress, and runtime results."
@@ -46705,15 +46002,6 @@
{
"$ref": "#/components/schemas/CollectInvocation"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocation"
- },
{
"$ref": "#/components/schemas/ColorCorrectInvocation"
},
@@ -46915,12 +46203,6 @@
{
"$ref": "#/components/schemas/FluxVaeEncodeInvocation"
},
- {
- "$ref": "#/components/schemas/ForInvocation"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocation"
- },
{
"$ref": "#/components/schemas/FreeUInvocation"
},
@@ -47434,18 +46716,6 @@
{
"$ref": "#/components/schemas/SpandrelImageToImageInvocation"
},
- {
- "$ref": "#/components/schemas/StateEmptyInvocation"
- },
- {
- "$ref": "#/components/schemas/StateGetInvocation"
- },
- {
- "$ref": "#/components/schemas/StateMergeInvocation"
- },
- {
- "$ref": "#/components/schemas/StateSetInvocation"
- },
{
"$ref": "#/components/schemas/StringBatchInvocation"
},
@@ -47637,15 +46907,6 @@
{
"$ref": "#/components/schemas/CollectInvocationOutput"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocationOutput"
- },
{
"$ref": "#/components/schemas/ColorCollectionOutput"
},
@@ -47727,12 +46988,6 @@
{
"$ref": "#/components/schemas/FluxReduxOutput"
},
- {
- "$ref": "#/components/schemas/ForInvocationOutput"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocationOutput"
- },
{
"$ref": "#/components/schemas/Gemma2EncoderOutput"
},
@@ -47802,12 +47057,6 @@
{
"$ref": "#/components/schemas/LoRASelectorOutput"
},
- {
- "$ref": "#/components/schemas/LoopStateOutput"
- },
- {
- "$ref": "#/components/schemas/LoopStateValueOutput"
- },
{
"$ref": "#/components/schemas/MDControlListOutput"
},
@@ -48164,15 +47413,6 @@
{
"$ref": "#/components/schemas/CollectInvocation"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocation"
- },
{
"$ref": "#/components/schemas/ColorCorrectInvocation"
},
@@ -48374,12 +47614,6 @@
{
"$ref": "#/components/schemas/FluxVaeEncodeInvocation"
},
- {
- "$ref": "#/components/schemas/ForInvocation"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocation"
- },
{
"$ref": "#/components/schemas/FreeUInvocation"
},
@@ -48893,18 +48127,6 @@
{
"$ref": "#/components/schemas/SpandrelImageToImageInvocation"
},
- {
- "$ref": "#/components/schemas/StateEmptyInvocation"
- },
- {
- "$ref": "#/components/schemas/StateGetInvocation"
- },
- {
- "$ref": "#/components/schemas/StateMergeInvocation"
- },
- {
- "$ref": "#/components/schemas/StateSetInvocation"
- },
{
"$ref": "#/components/schemas/StringBatchInvocation"
},
@@ -49187,15 +48409,6 @@
"collect": {
"$ref": "#/components/schemas/CollectInvocationOutput"
},
- "collection_cartesian": {
- "$ref": "#/components/schemas/CollectionCartesianInvocationOutput"
- },
- "collection_concat": {
- "$ref": "#/components/schemas/CollectionConcatInvocationOutput"
- },
- "collection_zip": {
- "$ref": "#/components/schemas/CollectionZipInvocationOutput"
- },
"color": {
"$ref": "#/components/schemas/ColorOutput"
},
@@ -49397,12 +48610,6 @@
"flux_vae_encode": {
"$ref": "#/components/schemas/LatentsOutput"
},
- "for": {
- "$ref": "#/components/schemas/ForInvocationOutput"
- },
- "for_return": {
- "$ref": "#/components/schemas/ForReturnInvocationOutput"
- },
"freeu": {
"$ref": "#/components/schemas/UNetOutput"
},
@@ -49916,18 +49123,6 @@
"spandrel_image_to_image_autoscale": {
"$ref": "#/components/schemas/ImageOutput"
},
- "state_empty": {
- "$ref": "#/components/schemas/LoopStateOutput"
- },
- "state_get": {
- "$ref": "#/components/schemas/LoopStateValueOutput"
- },
- "state_merge": {
- "$ref": "#/components/schemas/LoopStateOutput"
- },
- "state_set": {
- "$ref": "#/components/schemas/LoopStateOutput"
- },
"string": {
"$ref": "#/components/schemas/StringOutput"
},
@@ -50110,9 +49305,6 @@
"cogview4_model_loader",
"cogview4_text_encoder",
"collect",
- "collection_cartesian",
- "collection_concat",
- "collection_zip",
"color",
"color_correct",
"color_map",
@@ -50180,8 +49372,6 @@
"flux_text_encoder",
"flux_vae_decode",
"flux_vae_encode",
- "for",
- "for_return",
"freeu",
"gemini_image_generation",
"gemma2_encoder_loader",
@@ -50353,10 +49543,6 @@
"show_image",
"spandrel_image_to_image",
"spandrel_image_to_image_autoscale",
- "state_empty",
- "state_get",
- "state_merge",
- "state_set",
"string",
"string_batch",
"string_collection",
@@ -50579,15 +49765,6 @@
{
"$ref": "#/components/schemas/CollectInvocation"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocation"
- },
{
"$ref": "#/components/schemas/ColorCorrectInvocation"
},
@@ -50789,12 +49966,6 @@
{
"$ref": "#/components/schemas/FluxVaeEncodeInvocation"
},
- {
- "$ref": "#/components/schemas/ForInvocation"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocation"
- },
{
"$ref": "#/components/schemas/FreeUInvocation"
},
@@ -51308,18 +50479,6 @@
{
"$ref": "#/components/schemas/SpandrelImageToImageInvocation"
},
- {
- "$ref": "#/components/schemas/StateEmptyInvocation"
- },
- {
- "$ref": "#/components/schemas/StateGetInvocation"
- },
- {
- "$ref": "#/components/schemas/StateMergeInvocation"
- },
- {
- "$ref": "#/components/schemas/StateSetInvocation"
- },
{
"$ref": "#/components/schemas/StringBatchInvocation"
},
@@ -51702,15 +50861,6 @@
{
"$ref": "#/components/schemas/CollectInvocation"
},
- {
- "$ref": "#/components/schemas/CollectionCartesianInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionConcatInvocation"
- },
- {
- "$ref": "#/components/schemas/CollectionZipInvocation"
- },
{
"$ref": "#/components/schemas/ColorCorrectInvocation"
},
@@ -51912,12 +51062,6 @@
{
"$ref": "#/components/schemas/FluxVaeEncodeInvocation"
},
- {
- "$ref": "#/components/schemas/ForInvocation"
- },
- {
- "$ref": "#/components/schemas/ForReturnInvocation"
- },
{
"$ref": "#/components/schemas/FreeUInvocation"
},
@@ -52431,18 +51575,6 @@
{
"$ref": "#/components/schemas/SpandrelImageToImageInvocation"
},
- {
- "$ref": "#/components/schemas/StateEmptyInvocation"
- },
- {
- "$ref": "#/components/schemas/StateGetInvocation"
- },
- {
- "$ref": "#/components/schemas/StateMergeInvocation"
- },
- {
- "$ref": "#/components/schemas/StateSetInvocation"
- },
{
"$ref": "#/components/schemas/StringBatchInvocation"
},
@@ -60122,67 +59254,6 @@
"title": "LogoutResponse",
"description": "Response from logout."
},
- "LoopState": {
- "properties": {
- "values": {
- "additionalProperties": true,
- "title": "Values",
- "type": "object"
- }
- },
- "title": "LoopState",
- "type": "object"
- },
- "LoopStateOutput": {
- "class": "output",
- "properties": {
- "state": {
- "$ref": "#/components/schemas/LoopState",
- "description": "The loop state",
- "field_kind": "output",
- "ui_hidden": false
- },
- "type": {
- "const": "loop_state_output",
- "default": "loop_state_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "state", "type", "type"],
- "title": "LoopStateOutput",
- "type": "object"
- },
- "LoopStateValueOutput": {
- "class": "output",
- "properties": {
- "value": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The value read from the loop state, or None when the key is missing",
- "field_kind": "output",
- "title": "Value",
- "ui_hidden": false,
- "ui_type": "AnyField"
- },
- "type": {
- "const": "loop_state_value_output",
- "default": "loop_state_value_output",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["output_meta", "value", "type", "type"],
- "title": "LoopStateValueOutput",
- "type": "object"
- },
"LoraModelDefaultSettings": {
"properties": {
"weight": {
@@ -77917,29 +76988,12 @@
}
],
"default": null
- },
- "output_scope": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/OutputScope"
- },
- {
- "type": "null"
- }
- ],
- "default": null
}
},
- "required": ["field_kind", "ui_hidden", "ui_order", "ui_type", "output_scope"],
+ "required": ["field_kind", "ui_hidden", "ui_order", "ui_type"],
"title": "OutputFieldJSONSchemaExtra",
"type": "object"
},
- "OutputScope": {
- "description": "The execution scope for an output field.\n- `Iteration`: The field emits values for a loop body's current iteration.\n- `Final`: The field emits values after a loop boundary completes.",
- "enum": ["iteration", "final"],
- "title": "OutputScope",
- "type": "string"
- },
"PBRMapsInvocation": {
"category": "controlnet_preprocessors",
"class": "invocation",
@@ -89187,309 +88241,6 @@
"required": ["description", "source", "name", "base", "type"],
"title": "StarterModelWithoutDependencies"
},
- "StateEmptyInvocation": {
- "category": "workflow",
- "class": "invocation",
- "classification": "stable",
- "description": "Creates an empty loop state.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "type": {
- "const": "state_empty",
- "default": "state_empty",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["loop", "state"],
- "title": "Empty Loop State",
- "type": "object",
- "version": "1.0.0",
- "output": {
- "$ref": "#/components/schemas/LoopStateOutput"
- }
- },
- "StateGetInvocation": {
- "category": "workflow",
- "class": "invocation",
- "classification": "stable",
- "description": "Reads a value from loop state.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The loop state to read",
- "field_kind": "input",
- "input": "any",
- "orig_required": true
- },
- "key": {
- "default": "",
- "description": "The state key to read",
- "field_kind": "input",
- "input": "any",
- "orig_default": "",
- "orig_required": false,
- "title": "Key",
- "type": "string"
- },
- "default": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The value to return when the key is missing",
- "input": "any",
- "field_kind": "input",
- "orig_required": false,
- "orig_default": null,
- "ui_type": "AnyField",
- "title": "Default"
- },
- "type": {
- "const": "state_get",
- "default": "state_get",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["loop", "state"],
- "title": "Get Loop State Value",
- "type": "object",
- "version": "1.0.2",
- "output": {
- "$ref": "#/components/schemas/LoopStateValueOutput"
- }
- },
- "StateMergeInvocation": {
- "category": "workflow",
- "class": "invocation",
- "classification": "stable",
- "description": "Returns loop state with multiple values merged.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The loop state to update",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false
- },
- "values": {
- "additionalProperties": true,
- "default": {},
- "description": "The values to merge into the loop state. Connect an output to this input.",
- "field_kind": "input",
- "input": "any",
- "orig_default": {},
- "orig_required": false,
- "title": "Values",
- "type": "object",
- "ui_type": "AnyField"
- },
- "type": {
- "const": "state_merge",
- "default": "state_merge",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["loop", "state"],
- "title": "Merge Loop State Values",
- "type": "object",
- "version": "1.0.1",
- "output": {
- "$ref": "#/components/schemas/LoopStateOutput"
- }
- },
- "StateSetInvocation": {
- "category": "workflow",
- "class": "invocation",
- "classification": "stable",
- "description": "Returns loop state with one value set.",
- "node_pack": "invokeai",
- "properties": {
- "id": {
- "description": "The id of this instance of an invocation. Must be unique among all instances of invocations.",
- "field_kind": "node_attribute",
- "title": "Id",
- "type": "string"
- },
- "is_intermediate": {
- "default": false,
- "description": "Whether or not this is an intermediate invocation.",
- "field_kind": "node_attribute",
- "input": "direct",
- "orig_required": true,
- "title": "Is Intermediate",
- "type": "boolean",
- "ui_hidden": false,
- "ui_type": "IsIntermediate"
- },
- "use_cache": {
- "default": true,
- "description": "Whether or not to use the cache",
- "field_kind": "node_attribute",
- "title": "Use Cache",
- "type": "boolean"
- },
- "state": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/LoopState"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The loop state to update",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false
- },
- "key": {
- "default": "",
- "description": "The state key to set",
- "field_kind": "input",
- "input": "any",
- "orig_default": "",
- "orig_required": false,
- "title": "Key",
- "type": "string"
- },
- "value": {
- "anyOf": [
- {},
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The value to set. Connect an output to this input.",
- "field_kind": "input",
- "input": "any",
- "orig_default": null,
- "orig_required": false,
- "title": "Value",
- "ui_type": "AnyField"
- },
- "type": {
- "const": "state_set",
- "default": "state_set",
- "field_kind": "node_attribute",
- "title": "type",
- "type": "string"
- }
- },
- "required": ["type", "id"],
- "tags": ["loop", "state"],
- "title": "Set Loop State Value",
- "type": "object",
- "version": "1.0.1",
- "output": {
- "$ref": "#/components/schemas/LoopStateOutput"
- }
- },
"String2Output": {
"class": "output",
"description": "Base class for invocations that output two strings",
@@ -93442,7 +92193,7 @@
"type": "object"
},
"UIType": {
- "description": "Type hints for the UI for situations in which the field type is not enough to infer the correct UI type.\n\n- Model Fields\nThe most common node-author-facing use will be for model fields. Internally, there is no difference\nbetween SD-1, SD-2 and SDXL model fields - they all use the class `MainModelField`. To ensure the\nbase-model-specific UI is rendered, use e.g. `ui_type=UIType.SDXLMainModelField` to indicate that\nthe field is an SDXL main model field.\n\n- Any Field\nWe cannot infer the usage of `typing.Any` via schema parsing, so you *must* use `ui_type=UIType.Any` to\nindicate that the field accepts any type. Use with caution. On inputs, this renders as a connection-only field.\n\n- Scheduler Field\nSpecial handling in the UI is needed for this field, which otherwise would be parsed as a plain enum field.\n\n- Internal Fields\nSimilar to the Any Field, the `collect` and `iterate` nodes make use of `typing.Any`. To facilitate\nhandling these types in the client, we use `UIType._Collection` and `UIType._CollectionItem`. These\nshould not be used by node authors.\n\n- DEPRECATED Fields\nThese types are deprecated and should not be used by node authors. A warning will be logged if one is\nused, and the type will be ignored. They are included here for backwards compatibility.",
+ "description": "Type hints for the UI for situations in which the field type is not enough to infer the correct UI type.\n\n- Model Fields\nThe most common node-author-facing use will be for model fields. Internally, there is no difference\nbetween SD-1, SD-2 and SDXL model fields - they all use the class `MainModelField`. To ensure the\nbase-model-specific UI is rendered, use e.g. `ui_type=UIType.SDXLMainModelField` to indicate that\nthe field is an SDXL main model field.\n\n- Any Field\nWe cannot infer the usage of `typing.Any` via schema parsing, so you *must* use `ui_type=UIType.Any` to\nindicate that the field accepts any type. Use with caution. This cannot be used on outputs.\n\n- Scheduler Field\nSpecial handling in the UI is needed for this field, which otherwise would be parsed as a plain enum field.\n\n- Internal Fields\nSimilar to the Any Field, the `collect` and `iterate` nodes make use of `typing.Any`. To facilitate\nhandling these types in the client, we use `UIType._Collection` and `UIType._CollectionItem`. These\nshould not be used by node authors.\n\n- DEPRECATED Fields\nThese types are deprecated and should not be used by node authors. A warning will be logged if one is\nused, and the type will be ignored. They are included here for backwards compatibility.",
"enum": [
"SchedulerField",
"AnyField",
diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json
index 8437970dcf..9fbe7cdb6c 100644
--- a/invokeai/frontend/web/public/locales/en.json
+++ b/invokeai/frontend/web/public/locales/en.json
@@ -1550,30 +1550,6 @@
"colorCodeEdges": "Color-Code Edges",
"colorCodeEdgesHelp": "Color-code edges according to their connected fields",
"connectionWouldCreateCycle": "Connection would create a cycle",
- "loopOutputScopeConflict": "Final loop outputs cannot feed the loop body",
- "forLoopMissingIterationOutput": "For loop must have an iteration output",
- "forLoopReturnCount": "For loop body must have one return",
- "forLoopUnterminatedBody": "All For loop body paths must terminate at its return",
- "forLoopNestedUnsupported": "This nested For loop shape is not supported",
- "forLoopIterateUnsupported": "This Iterate shape inside the For body is not supported",
- "forLoopIteratorInputUnsupported": "Iterator-derived external inputs cannot feed a For loop body",
- "forLoopFinalOutputInBody": "Final For loop outputs cannot feed its body",
- "forLoopBodyEscape": "For loop body outputs cannot escape before its return",
- "forLoopLinkageMissing": "For loop linkage is missing between For and ForReturn",
- "forLoopLinkageInvalid": "For loop linkage must connect a For to its ForReturn",
- "forLoopLinkageDuplicate": "For loop linkage must connect each For and ForReturn exactly once",
- "forLoopInputCount": "For loop may have only one collection and state input each",
- "forReturnInputCount": "ForReturn may have only one output and state input each",
- "forReturnOwnership": "For return must belong to exactly one For loop",
- "forLoopBodyBoundary": "For loop body",
- "forLoopBodyBoundaryStatus": {
- "missing_linkage": "missing loop linkage",
- "invalid_linkage": "invalid loop linkage",
- "duplicate_linkage": "duplicate loop linkage",
- "missing_return": "missing ForReturn",
- "multiple_returns": "multiple ForReturns",
- "orphan_return": "unowned ForReturn"
- },
"currentImage": "Current Image",
"currentImageDescription": "Displays the current image in the Node Editor",
"downloadWorkflow": "Download Workflow JSON",
@@ -1586,7 +1562,6 @@
"executionStateError": "Error",
"executionStateInProgress": "In Progress",
"fieldTypesMustMatch": "Field types must match",
- "finalOutputs": "Final Outputs",
"fitViewportNodes": "Fit View",
"float": "Float",
"fullyContainNodes": "Fully Contain Nodes to Select",
@@ -1598,7 +1573,6 @@
"hideLegendNodes": "Hide Field Type Legend",
"hideMinimapnodes": "Hide MiniMap",
"inputMayOnlyHaveOneConnection": "Input may only have one connection",
- "iterationOutputs": "Iteration Outputs",
"integer": "Integer",
"ipAdapter": "IP-Adapter",
"loadingNodes": "Loading Nodes...",
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk.mounted.test.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk.mounted.test.tsx
deleted file mode 100644
index 6702565ac9..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk.mounted.test.tsx
+++ /dev/null
@@ -1,319 +0,0 @@
-// @vitest-environment happy-dom
-import { applyEdgeChanges, applyNodeChanges } from '@xyflow/react';
-import {
- $addNodeCmdk,
- $cursorPos,
- $edgePendingUpdate,
- $pendingConnection,
- $templates,
- edgesChanged,
- nodesChanged,
-} from 'features/nodes/store/nodesSlice';
-import type { PendingConnection } from 'features/nodes/store/types';
-import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from 'features/nodes/store/util/connectorTopology';
-import { buildEdge, buildLoopLinkageEdge, buildNode, for_loop, for_return } from 'features/nodes/store/util/testUtils';
-import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import type { ChangeEvent, ReactNode } from 'react';
-import * as React from 'react';
-import { act } from 'react';
-import type { Root } from 'react-dom/client';
-import { createRoot } from 'react-dom/client';
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-
-const mocks = vi.hoisted(() => ({
- nodes: [] as AnyNode[],
- edges: [] as AnyEdge[],
- dispatch: vi.fn(),
- buildNode: vi.fn(),
-}));
-
-vi.mock('app/store/storeHooks', () => {
- const getState = () => ({
- nodes: { present: { nodes: mocks.nodes, edges: mocks.edges } },
- ui: { activeTab: 'workflows' },
- workflowSettings: { shouldGroupNodesByCategory: false },
- });
-
- return {
- useAppDispatch: () => mocks.dispatch,
- useAppSelector: (selector: (state: ReturnType<typeof getState>) => unknown) => selector(getState()),
- useAppStore: () => ({ getState, dispatch: mocks.dispatch }),
- };
-});
-
-vi.mock('features/nodes/hooks/useBuildNode', () => ({
- useBuildNode: () => mocks.buildNode,
-}));
-
-vi.mock('features/system/components/HotkeysModal/useHotkeyData', () => ({
- useRegisteredHotkeys: () => undefined,
-}));
-
-vi.mock('features/toast/toast', () => ({
- toast: vi.fn(),
-}));
-
-vi.mock('common/components/IAIImageFallback', () => ({
- IAINoContentFallback: () => null,
-}));
-
-vi.mock('common/components/OverlayScrollbars/ScrollableContent', () => ({
- default: ({ children }: { children: ReactNode }) => <div>{children}</div>,
-}));
-
-vi.mock('react-i18next', () => ({
- useTranslation: () => ({
- t: (key: string) =>
- ({
- 'nodes.nodeSearch': 'Search nodes',
- 'common.noMatchingItems': 'No matching items',
- 'common.expandAll': 'Expand all',
- 'common.collapseAll': 'Collapse all',
- })[key] ?? key,
- }),
-}));
-
-vi.mock('@invoke-ai/ui-library', () => {
- type Props = {
- children?: ReactNode;
- onClick?: () => void;
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
- placeholder?: string;
- value?: string;
- [key: string]: unknown;
- };
-
- const getDomProps = ({ children: _children, ...props }: Props): React.HTMLAttributes<HTMLElement> =>
- Object.fromEntries(
- Object.entries(props).filter(
- ([key]) =>
- key === 'aria-label' ||
- key === 'onClick' ||
- key === 'onChange' ||
- key === 'onKeyDown' ||
- key === 'onPointerMove' ||
- key === 'placeholder' ||
- key === 'role' ||
- key === 'tabIndex' ||
- key === 'value' ||
- key.startsWith('aria-') ||
- key.startsWith('data-')
- )
- ) as React.HTMLAttributes<HTMLElement>;
-
- const Flex = React.forwardRef<HTMLDivElement, Props>(function Flex(
- { children, ...props }: Props,
- ref: React.ForwardedRef<HTMLDivElement>
- ) {
- return (
- <div ref={ref} {...getDomProps({ children, ...props })}>
- {children}
- </div>
- );
- });
- const Input = React.forwardRef<HTMLInputElement, Props>(function Input(
- { children, ...props }: Props,
- ref: React.ForwardedRef<HTMLInputElement>
- ) {
- return <input ref={ref} {...getDomProps({ children, ...props })} />;
- });
- const Box = ({ children }: Props) => <div>{children}</div>;
- const Text = ({ children }: Props) => <span>{children}</span>;
- const Button = ({ children, ...props }: Props) => (
- <button {...getDomProps({ children, ...props })}>{children}</button>
- );
- const Modal = ({ children, isOpen }: Props & { isOpen?: boolean }) => (isOpen ? <div>{children}</div> : null);
- const passthrough = ({ children }: Props) => <div>{children}</div>;
- const Icon = () => <span />;
- const ModalOverlay = () => null;
- const Spacer = () => <span />;
-
- Box.displayName = 'Box';
- Text.displayName = 'Text';
- Button.displayName = 'Button';
- Modal.displayName = 'Modal';
- passthrough.displayName = 'passthrough';
- Icon.displayName = 'Icon';
- ModalOverlay.displayName = 'ModalOverlay';
- Spacer.displayName = 'Spacer';
-
- return {
- Box,
- Button,
- Flex,
- Icon,
- Input,
- Modal,
- ModalBody: passthrough,
- ModalContent: passthrough,
- ModalOverlay,
- Portal: passthrough,
- Spacer,
- Text,
- };
-});
-
-import { AddNodeCmdk } from './AddNodeCmdk/AddNodeCmdk';
-
-declare global {
- var IS_REACT_ACT_ENVIRONMENT: boolean;
-}
-globalThis.IS_REACT_ACT_ENVIRONMENT = true;
-
-const setNodeId = (node: AnyNode, id: string): AnyNode => {
- node.id = id;
- node.data.id = id;
- return node;
-};
-
-const buildConnector = (id: string): AnyNode => ({
- id,
- type: 'connector',
- position: { x: 0, y: 0 },
- data: {
- id,
- type: 'connector',
- label: 'Connector',
- isOpen: true,
- },
-});
-
-describe('AddNodeCmdk (mounted)', () => {
- let container: HTMLDivElement;
- let root: Root;
-
- beforeEach(() => {
- const forNode = setNodeId(buildNode(for_loop), 'for-node');
- mocks.nodes = [forNode];
- mocks.edges = [];
- mocks.dispatch.mockReset();
- mocks.dispatch.mockImplementation((action: unknown) => {
- if (nodesChanged.match(action)) {
- mocks.nodes = applyNodeChanges(action.payload, mocks.nodes);
- }
- if (edgesChanged.match(action)) {
- mocks.edges = applyEdgeChanges(action.payload, mocks.edges);
- }
- return action;
- });
- mocks.buildNode.mockReset();
- mocks.buildNode.mockReturnValue(setNodeId(buildNode(for_return), 'return-node'));
-
- $templates.set({ for: for_loop, for_return });
- $addNodeCmdk.set(true);
- $cursorPos.set({ x: 0, y: 0 });
- $edgePendingUpdate.set(null);
- $pendingConnection.set({
- nodeId: 'for-node',
- handleId: 'item',
- handleType: 'source',
- fieldTemplate: for_loop.outputs.item as PendingConnection['fieldTemplate'],
- });
-
- container = document.createElement('div');
- document.body.appendChild(container);
- root = createRoot(container);
- });
-
- afterEach(() => {
- act(() => {
- root.unmount();
- });
- container.remove();
- $addNodeCmdk.set(false);
- $cursorPos.set(null);
- $edgePendingUpdate.set(null);
- $pendingConnection.set(null);
- $templates.set({});
- });
-
- it('adds ForReturn with loop linkage and auto-connects its output', () => {
- act(() => {
- root.render(<AddNodeCmdk />);
- });
-
- const returnItem = Array.from(container.querySelectorAll('[role="button"]')).find((element) =>
- element.textContent?.trim().startsWith('ForReturn')
- );
- expect(returnItem).toBeDefined();
-
- act(() => {
- returnItem?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
- });
-
- expect(mocks.edges).toEqual([
- expect.objectContaining({
- source: 'for-node',
- sourceHandle: 'item',
- target: 'return-node',
- targetHandle: 'output',
- }),
- expect.objectContaining({
- type: 'loop_linkage',
- source: 'for-node',
- sourceHandle: 'loop_linkage',
- target: 'return-node',
- targetHandle: 'loop_linkage',
- }),
- ]);
- expect($addNodeCmdk.get()).toBe(false);
- expect($pendingConnection.get()).toBeNull();
- });
-
- it('adds loop linkage when an iteration output is routed through a connector', () => {
- const connector = buildConnector('connector');
- mocks.nodes = [mocks.nodes[0]!, connector];
- mocks.edges = [buildEdge('for-node', 'item', connector.id, CONNECTOR_INPUT_HANDLE)];
- $pendingConnection.set({
- nodeId: connector.id,
- handleId: CONNECTOR_OUTPUT_HANDLE,
- handleType: 'source',
- fieldTemplate: {
- ...for_loop.outputs.item,
- name: CONNECTOR_OUTPUT_HANDLE,
- } as PendingConnection['fieldTemplate'],
- });
-
- act(() => {
- root.render(<AddNodeCmdk />);
- });
-
- const returnItem = Array.from(container.querySelectorAll('[role="button"]')).find((element) =>
- element.textContent?.trim().startsWith('ForReturn')
- );
- act(() => {
- returnItem?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
- });
-
- expect(mocks.edges).toContainEqual(
- expect.objectContaining({
- type: 'loop_linkage',
- source: 'for-node',
- sourceHandle: 'loop_linkage',
- target: 'return-node',
- targetHandle: 'loop_linkage',
- })
- );
- });
-
- it('does not add a duplicate linkage when the For is already paired', () => {
- const existingReturn = setNodeId(buildNode(for_return), 'existing-return');
- mocks.nodes = [mocks.nodes[0]!, existingReturn];
- mocks.edges = [buildLoopLinkageEdge('for-node', existingReturn.id)];
-
- act(() => {
- root.render(<AddNodeCmdk />);
- });
-
- const returnItem = Array.from(container.querySelectorAll('[role="button"]')).find((element) =>
- element.textContent?.trim().startsWith('ForReturn')
- );
- act(() => {
- returnItem?.dispatchEvent(new MouseEvent('click', { bubbles: true }));
- });
-
- expect(mocks.edges.filter((edge) => edge.type === 'loop_linkage')).toEqual([
- buildLoopLinkageEdge('for-node', existingReturn.id),
- ]);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.test.ts b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.test.ts
deleted file mode 100644
index 0f31d8868f..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.test.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-import type { PendingConnection } from 'features/nodes/store/types';
-import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from 'features/nodes/store/util/connectorTopology';
-import { add, buildEdge, buildNode, for_loop, for_return, templates } from 'features/nodes/store/util/testUtils';
-import type { InvocationTemplate } from 'features/nodes/types/invocation';
-import { describe, expect, it } from 'vitest';
-
-import { getPendingConnectionNodeItems, sortNodeCommandItemGroups, sortNodeCommandItems } from './AddNodeCmdk';
-
-describe('getPendingConnectionNodeItems', () => {
- it('prioritizes ForReturn for an iteration output connection', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'for-node',
- handleId: 'item',
- handleType: 'source' as const,
- fieldTemplate: for_loop.outputs.item as PendingConnection['fieldTemplate'],
- };
-
- const items = getPendingConnectionNodeItems([add, for_return], pendingConnection, '');
-
- expect(items[0]?.value).toBe('for_return');
- });
-
- it('only offers ForReturn for a For loop linkage connection', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'for-node',
- handleId: 'loop_linkage',
- handleType: 'source' as const,
- fieldTemplate: for_loop.outputs.loop_linkage as PendingConnection['fieldTemplate'],
- };
-
- const items = getPendingConnectionNodeItems([add, for_return], pendingConnection, '');
-
- expect(items.map((item) => item.value)).toEqual(['for_return']);
- });
-
- it('only offers For for a ForReturn loop linkage connection', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'return-node',
- handleId: 'loop_linkage',
- handleType: 'target' as const,
- fieldTemplate: for_return.inputs.loop_linkage as PendingConnection['fieldTemplate'],
- };
-
- const items = getPendingConnectionNodeItems([add, for_loop], pendingConnection, '');
-
- expect(items.map((item) => item.value)).toEqual(['for']);
- });
-
- it('keeps ForReturn first after exact-title search ranking', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'for-node',
- handleId: 'item',
- handleType: 'source' as const,
- fieldTemplate: for_loop.outputs.item as PendingConnection['fieldTemplate'],
- };
-
- const items = getPendingConnectionNodeItems([for_loop, for_return], pendingConnection, 'for');
-
- const sortedItems = sortNodeCommandItems(items, 'for', pendingConnection);
-
- expect(sortedItems.map((item) => item.value)).toEqual(['for_return', 'for']);
- });
-
- it('prioritizes ForReturn when the iteration output passes through a connector', () => {
- const forNode = buildNode(for_loop);
- forNode.id = 'for-node';
- const connector = {
- id: 'connector-node',
- type: 'connector' as const,
- position: { x: 0, y: 0 },
- data: { id: 'connector-node', type: 'connector' as const, label: 'Connector', isOpen: true },
- };
- const pendingConnection: PendingConnection = {
- nodeId: connector.id,
- handleId: CONNECTOR_OUTPUT_HANDLE,
- handleType: 'source' as const,
- fieldTemplate: {
- name: CONNECTOR_OUTPUT_HANDLE,
- title: 'Connector Output',
- description: '',
- fieldKind: 'output',
- ui_hidden: false,
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- },
- };
-
- const items = getPendingConnectionNodeItems([add, for_return], pendingConnection, '', {
- nodes: [forNode, connector],
- edges: [buildEdge(forNode.id, 'item', connector.id, CONNECTOR_INPUT_HANDLE)],
- templates: { ...templates, for: for_loop, for_return },
- });
-
- expect(items[0]?.value).toBe('for_return');
- });
-
- it('preserves generic pending connection ordering for non-loop outputs', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'add-node',
- handleId: 'value',
- handleType: 'source' as const,
- fieldTemplate: add.outputs.value as PendingConnection['fieldTemplate'],
- };
-
- const items = getPendingConnectionNodeItems([add, for_return], pendingConnection, '');
-
- expect(items.map((item) => item.value)).toEqual(['add', 'for_return']);
- });
-
- it('preserves exact-title ranking for a non-loop pending connection', () => {
- const pendingConnection: PendingConnection = {
- nodeId: 'add-node',
- handleId: 'value',
- handleType: 'source' as const,
- fieldTemplate: add.outputs.value as PendingConnection['fieldTemplate'],
- };
- const addOther = { ...add, title: 'Add Other', type: 'add_other' } as InvocationTemplate;
-
- const items = getPendingConnectionNodeItems([add, addOther], pendingConnection, 'add');
- const sortedItems = sortNodeCommandItems(items, 'add', pendingConnection);
-
- expect(sortedItems.map((item) => item.value)).toEqual(['add', 'add_other']);
- });
-});
-
-describe('sortNodeCommandItemGroups', () => {
- it('promotes the category containing ForReturn for an iteration output connection', () => {
- const addItem = getPendingConnectionNodeItems(
- [add],
- {
- nodeId: 'add-node',
- handleId: 'value',
- handleType: 'source',
- fieldTemplate: add.outputs.value as PendingConnection['fieldTemplate'],
- },
- ''
- )[0];
- const forReturnItem = getPendingConnectionNodeItems(
- [for_return],
- {
- nodeId: 'for-node',
- handleId: 'item',
- handleType: 'source',
- fieldTemplate: for_loop.outputs.item as PendingConnection['fieldTemplate'],
- },
- ''
- )[0];
- if (!addItem || !forReturnItem) {
- throw new Error('Expected command items');
- }
-
- const groups = sortNodeCommandItemGroups(
- [
- ['math', [addItem]],
- ['other', [forReturnItem]],
- ],
- '',
- true
- );
-
- expect(groups.map(([category]) => category)).toEqual(['other', 'math']);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.tsx
index 10d5cbbfb4..8f27a83c14 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.tsx
@@ -31,15 +31,12 @@ import {
nodesChanged,
} from 'features/nodes/store/nodesSlice';
import { selectNodesSlice } from 'features/nodes/store/selectors';
-import type { PendingConnection, Templates } from 'features/nodes/store/types';
-import { resolvePendingConnectionSource } from 'features/nodes/store/util/connectorTopology';
import { findUnoccupiedPosition } from 'features/nodes/store/util/findUnoccupiedPosition';
import { getFirstValidConnection } from 'features/nodes/store/util/getFirstValidConnection';
import { connectionToEdge } from 'features/nodes/store/util/reactFlowUtil';
import { validateConnectionTypes } from 'features/nodes/store/util/validateConnectionTypes';
import { selectShouldGroupNodesByCategory } from 'features/nodes/store/workflowSettingsSlice';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
-import type { AnyEdge, AnyNode, InvocationTemplate } from 'features/nodes/types/invocation';
+import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
import { isInvocationNode } from 'features/nodes/types/invocation';
import { useRegisteredHotkeys } from 'features/system/components/HotkeysModal/useHotkeyData';
import { toast } from 'features/toast/toast';
@@ -57,6 +54,7 @@ import {
PiLightningFill,
} from 'react-icons/pi';
import type { S } from 'services/api/types';
+import { objectEntries } from 'tsafe';
import { useDebounce } from 'use-debounce';
const useAddNode = () => {
@@ -132,34 +130,6 @@ const useAddNode = () => {
if (connection) {
const newEdge = connectionToEdge(connection);
store.dispatch(edgesChanged([{ type: 'add', item: newEdge }]));
-
- const resolvedSource = resolvePendingConnectionSource(pendingConnection, nodes, edges, templates);
- const sourceNode = resolvedSource
- ? nodes.find((candidate) => candidate.id === resolvedSource.nodeId)
- : nodes.find((candidate) => candidate.id === source);
- if (
- newEdge.type === 'default' &&
- node.data.type === 'for_return' &&
- sourceNode &&
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- resolvedSource?.outputScope === 'iteration' &&
- !edges.some((edge) => edge.type === 'loop_linkage' && edge.source === sourceNode.id)
- ) {
- store.dispatch(
- edgesChanged([
- {
- type: 'add',
- item: connectionToEdge({
- source: sourceNode.id,
- sourceHandle: LOOP_LINKAGE_FIELD,
- target: node.id,
- targetHandle: LOOP_LINKAGE_FIELD,
- }),
- },
- ])
- );
- }
}
}
},
@@ -373,161 +343,6 @@ const filter = memoize(
(item: FilterableItem, searchTerm: string) => `${item.type}-${searchTerm}`
);
-type PendingConnectionContext = {
- nodes: AnyNode[];
- edges: AnyEdge[];
- templates: Templates;
-};
-
-const isForIterationOutputConnection = (
- pendingConnection: PendingConnection | null,
- context?: PendingConnectionContext
-) => {
- if (!pendingConnection || pendingConnection.handleType !== 'source') {
- return false;
- }
-
- const resolvedSource = context
- ? resolvePendingConnectionSource(pendingConnection, context.nodes, context.edges, context.templates)
- : null;
- if (resolvedSource && context) {
- const sourceNode = context.nodes.find((node) => node.id === resolvedSource.nodeId);
- return (
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- (resolvedSource.outputScope === 'iteration' ||
- (resolvedSource.nodeId === pendingConnection.nodeId &&
- pendingConnection.fieldTemplate.fieldKind === 'output' &&
- pendingConnection.fieldTemplate.output_scope === 'iteration'))
- );
- }
-
- return (
- pendingConnection.fieldTemplate.fieldKind === 'output' &&
- pendingConnection.fieldTemplate.output_scope === 'iteration'
- );
-};
-
-export const getPendingConnectionNodeItems = (
- templatesArray: InvocationTemplate[],
- pendingConnection: PendingConnection,
- searchTerm: string,
- context?: PendingConnectionContext
-): NodeCommandItemData[] => {
- const items: NodeCommandItemData[] = [];
-
- for (const template of templatesArray) {
- if (!filter(template, searchTerm)) {
- continue;
- }
-
- if (
- pendingConnection.handleId === LOOP_LINKAGE_FIELD &&
- template.type !== (pendingConnection.handleType === 'source' ? 'for_return' : 'for')
- ) {
- continue;
- }
-
- const candidateFields = pendingConnection.handleType === 'source' ? template.inputs : template.outputs;
- for (const fieldTemplate of Object.values(candidateFields)) {
- const sourceType =
- pendingConnection.handleType === 'source' ? pendingConnection.fieldTemplate.type : fieldTemplate.type;
- const targetType =
- pendingConnection.handleType === 'target' ? pendingConnection.fieldTemplate.type : fieldTemplate.type;
-
- if (validateConnectionTypes(sourceType, targetType)) {
- items.push({
- label: template.title,
- value: template.type,
- description: template.description,
- classification: template.classification,
- nodePack: template.nodePack,
- category: template.category,
- });
- break;
- }
- }
- }
-
- return sortNodeCommandItems(items, searchTerm, pendingConnection, context);
-};
-
-export const sortNodeCommandItems = (
- items: NodeCommandItemData[],
- searchTerm: string,
- pendingConnection: PendingConnection | null,
- context?: PendingConnectionContext
-): NodeCommandItemData[] => {
- const sortedItems = [...items];
- const shouldPromoteForReturn = isForIterationOutputConnection(pendingConnection, context);
- const lowerSearch = searchTerm.toLowerCase();
-
- sortedItems.sort((a, b) => {
- // Contextual ForReturn priority is a hard first key, including when For is an exact title match.
- if (shouldPromoteForReturn) {
- if (a.value === 'for_return' && b.value !== 'for_return') {
- return -1;
- }
- if (a.value !== 'for_return' && b.value === 'for_return') {
- return 1;
- }
- }
-
- if (searchTerm) {
- const aExact = a.label.toLowerCase() === lowerSearch;
- const bExact = b.label.toLowerCase() === lowerSearch;
- if (aExact && !bExact) {
- return -1;
- }
- if (!aExact && bExact) {
- return 1;
- }
- }
-
- return 0;
- });
-
- return sortedItems;
-};
-
-export const sortNodeCommandItemGroups = (
- groups: [string, NodeCommandItemData[]][],
- searchTerm: string,
- shouldPromoteForReturn: boolean
-): [string, NodeCommandItemData[]][] => {
- const lowerSearch = searchTerm.toLowerCase();
- return [...groups].sort(([a, aItems], [b, bItems]) => {
- if (shouldPromoteForReturn) {
- const aHasForReturn = aItems.some((item) => item.value === 'for_return');
- const bHasForReturn = bItems.some((item) => item.value === 'for_return');
- if (aHasForReturn && !bHasForReturn) {
- return -1;
- }
- if (!aHasForReturn && bHasForReturn) {
- return 1;
- }
- }
-
- if (searchTerm) {
- const aHasExact = aItems.some((item) => item.label.toLowerCase() === lowerSearch);
- const bHasExact = bItems.some((item) => item.label.toLowerCase() === lowerSearch);
- if (aHasExact && !bHasExact) {
- return -1;
- }
- if (!aHasExact && bHasExact) {
- return 1;
- }
- }
- if (a === 'other') {
- return 1;
- }
- if (b === 'other') {
- return -1;
- }
- return a.localeCompare(b);
- });
-};
-
const categoryItemSx: SystemStyleObject = {
cursor: 'pointer',
userSelect: 'none',
@@ -581,13 +396,7 @@ const NodeCommandList = memo(
}) => {
const { t } = useTranslation();
const templatesArray = useStore($templatesArray);
- const templates = useStore($templates);
const pendingConnection = useStore($pendingConnection);
- const { nodes, edges } = useAppSelector(selectNodesSlice);
- const pendingConnectionContext = useMemo<PendingConnectionContext>(
- () => ({ nodes, edges, templates }),
- [nodes, edges, templates]
- );
const shouldGroupNodesByCategory = useAppSelector(selectShouldGroupNodesByCategory);
const currentImageFilterItem = useMemo<FilterableItem>(
() => ({
@@ -645,22 +454,50 @@ const NodeCommandList = memo(
}
}
} else {
- _items.push(
- ...getPendingConnectionNodeItems(templatesArray, pendingConnection, searchTerm, pendingConnectionContext)
- );
+ for (const template of templatesArray) {
+ if (filter(template, searchTerm)) {
+ const candidateFields = pendingConnection.handleType === 'source' ? template.inputs : template.outputs;
+
+ for (const [_fieldName, fieldTemplate] of objectEntries(candidateFields)) {
+ const sourceType =
+ pendingConnection.handleType === 'source' ? pendingConnection.fieldTemplate.type : fieldTemplate.type;
+ const targetType =
+ pendingConnection.handleType === 'target' ? pendingConnection.fieldTemplate.type : fieldTemplate.type;
+
+ if (validateConnectionTypes(sourceType, targetType)) {
+ _items.push({
+ label: template.title,
+ value: template.type,
+ description: template.description,
+ classification: template.classification,
+ nodePack: template.nodePack,
+ category: template.category,
+ });
+ break;
+ }
+ }
+ }
+ }
}
- return sortNodeCommandItems(_items, searchTerm, pendingConnection, pendingConnectionContext);
- }, [
- pendingConnection,
- templatesArray,
- pendingConnectionContext,
- searchTerm,
- currentImageFilterItem,
- notesFilterItem,
- ]);
+ // Sort exact title matches to the top when searching
+ if (searchTerm) {
+ const lowerSearch = searchTerm.toLowerCase();
+ _items.sort((a, b) => {
+ const aExact = a.label.toLowerCase() === lowerSearch;
+ const bExact = b.label.toLowerCase() === lowerSearch;
+ if (aExact && !bExact) {
+ return -1;
+ }
+ if (!aExact && bExact) {
+ return 1;
+ }
+ return 0;
+ });
+ }
- const shouldPromoteForReturn = isForIterationOutputConnection(pendingConnection, pendingConnectionContext);
+ return _items;
+ }, [pendingConnection, templatesArray, searchTerm, currentImageFilterItem, notesFilterItem]);
const groupedItems = useMemo(() => {
const groups: Record<string, NodeCommandItemData[]> = {};
@@ -671,8 +508,29 @@ const NodeCommandList = memo(
}
groups[cat].push(item);
}
- return sortNodeCommandItemGroups(Object.entries(groups), searchTerm, shouldPromoteForReturn);
- }, [items, searchTerm, shouldPromoteForReturn]);
+ // Sort categories alphabetically, but put "other" last.
+ // When searching, prioritize categories that contain an exact title match.
+ const lowerSearch = searchTerm.toLowerCase();
+ return Object.entries(groups).sort(([a, aItems], [b, bItems]) => {
+ if (searchTerm) {
+ const aHasExact = aItems.some((item) => item.label.toLowerCase() === lowerSearch);
+ const bHasExact = bItems.some((item) => item.label.toLowerCase() === lowerSearch);
+ if (aHasExact && !bHasExact) {
+ return -1;
+ }
+ if (!aHasExact && bHasExact) {
+ return 1;
+ }
+ }
+ if (a === 'other') {
+ return 1;
+ }
+ if (b === 'other') {
+ return -1;
+ }
+ return a.localeCompare(b);
+ });
+ }, [items, searchTerm]);
// When searching, auto-expand all categories; when not searching, use manual state
const isSearching = searchTerm.length > 0;
@@ -708,10 +566,7 @@ const NodeCommandList = memo(
</Flex>
)}
{groupedItems.map(([category, categoryItems]) => {
- const isExpanded =
- isSearching ||
- expandedCategories.has(category) ||
- (shouldPromoteForReturn && categoryItems.some((item) => item.value === 'for_return'));
+ const isExpanded = isSearching || expandedCategories.has(category);
return (
<Box key={category}>
<CommandItem value={`__category__:${category}`} onSelect={onSelect} asChild>
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx
index daa7147daf..697d1a1182 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx
@@ -48,10 +48,7 @@ import {
selectNodes,
selectNodesSlice,
} from 'features/nodes/store/selectors';
-import {
- getConnectorDeletionSpliceConnections,
- getEdgesWithLoopLinkageAliases,
-} from 'features/nodes/store/util/connectorTopology';
+import { getConnectorDeletionSpliceConnections } from 'features/nodes/store/util/connectorTopology';
import { connectionToEdge } from 'features/nodes/store/util/reactFlowUtil';
import { validateConnection } from 'features/nodes/store/util/validateConnection';
import { selectSelectionMode, selectShouldSnapToGrid } from 'features/nodes/store/workflowSettingsSlice';
@@ -68,8 +65,6 @@ import { PiPlugsConnectedBold, PiTrashBold } from 'react-icons/pi';
import CustomConnectionLine from './connectionLines/CustomConnectionLine';
import InvocationCollapsedEdge from './edges/InvocationCollapsedEdge';
import InvocationDefaultEdge from './edges/InvocationDefaultEdge';
-import InvocationLoopLinkageEdge from './edges/InvocationLoopLinkageEdge';
-import LoopBodyBoundaryOverlay from './LoopBodyBoundaryOverlay';
import ConnectorNode from './nodes/Connector/ConnectorNode';
import CurrentImageNode from './nodes/CurrentImage/CurrentImageNode';
import InvocationNodeWrapper from './nodes/Invocation/InvocationNodeWrapper';
@@ -81,7 +76,6 @@ import { isWorkflowHotkeyEnabled, shouldIgnoreWorkflowCopyHotkey } from './workf
const edgeTypes = {
collapsed: InvocationCollapsedEdge,
default: InvocationDefaultEdge,
- loop_linkage: InvocationLoopLinkageEdge,
} as const;
const nodeTypes = {
@@ -294,7 +288,7 @@ export const Flow = memo(() => {
const onEdgeDoubleClick = useCallback<NonNullable<ReactFlowProps['onEdgeDoubleClick']>>(
(event, edge) => {
- if (edge.hidden || (edge.type !== 'default' && edge.type !== 'loop_linkage')) {
+ if (edge.type !== 'default' || edge.hidden) {
return;
}
const flow = $flow.get();
@@ -377,7 +371,7 @@ export const Flow = memo(() => {
const renderedNodes = useMemo(() => nodes, [nodes]);
- const renderedEdges = useMemo(() => getEdgesWithLoopLinkageAliases(nodes, edges), [edges, nodes]);
+ const renderedEdges = useMemo(() => edges, [edges]);
const contextMenuPosition = contextMenuState ? { x: contextMenuState.pageX, y: contextMenuState.pageY } : null;
const contextMenuKey = contextMenuPosition ? `${contextMenuPosition.x}-${contextMenuPosition.y}` : 'closed';
@@ -388,7 +382,6 @@ export const Flow = memo(() => {
viewport={viewport}
renderedNodes={renderedNodes}
renderedEdges={renderedEdges}
- boundaryEdges={edges}
onInit={onInit}
onMouseMove={onMouseMove}
onNodesChange={onNodesChange}
@@ -440,7 +433,6 @@ type FlowSurfaceProps = {
viewport: ReactFlowProps<AnyNode, AnyEdge>['defaultViewport'];
renderedNodes: AnyNode[];
renderedEdges: AnyEdge[];
- boundaryEdges: AnyEdge[];
onInit: OnInit<AnyNode, AnyEdge>;
onMouseMove: (event: MouseEvent<HTMLDivElement>) => void;
onNodesChange: OnNodesChange<AnyNode>;
@@ -466,7 +458,6 @@ const FlowSurface = memo((props: FlowSurfaceProps) => {
viewport,
renderedNodes,
renderedEdges,
- boundaryEdges,
onInit,
onMouseMove,
onNodesChange,
@@ -532,7 +523,6 @@ const FlowSurface = memo((props: FlowSurfaceProps) => {
noPanClassName={NO_PAN_CLASS}
>
<Background gap={snapGrid} offset={snapGrid} />
- <LoopBodyBoundaryOverlay edges={boundaryEdges} />
</ReactFlow>
</div>
);
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.test.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.test.tsx
deleted file mode 100644
index e0eadcc6ad..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.test.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-// @vitest-environment happy-dom
-import { buildEdge, buildLoopLinkageEdge, buildNode, for_loop, for_return } from 'features/nodes/store/util/testUtils';
-import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import type { ReactNode } from 'react';
-import { act } from 'react';
-import type { Root } from 'react-dom/client';
-import { createRoot } from 'react-dom/client';
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-
-import LoopBodyBoundaryOverlay from './LoopBodyBoundaryOverlay';
-
-const flowMocks = vi.hoisted(() => ({
- nodes: [] as AnyNode[],
- getNodesBounds: vi.fn(() => ({ x: 10, y: 20, width: 100, height: 200 })),
-}));
-
-vi.mock('@xyflow/react', () => ({
- useNodes: () => flowMocks.nodes,
- useReactFlow: () => ({ getNodesBounds: flowMocks.getNodesBounds }),
- ViewportPortal: ({ children }: { children: ReactNode }) => children,
-}));
-
-vi.mock('@invoke-ai/ui-library', () => ({
- Box: ({ children, ...props }: { children: ReactNode; [key: string]: unknown }) => {
- const domProps = Object.fromEntries(
- Object.entries(props).filter(([key]) => key === 'title' || key.startsWith('aria-') || key.startsWith('data-'))
- );
- return <div {...domProps}>{children}</div>;
- },
- Text: ({ children }: { children: ReactNode }) => <span>{children}</span>,
-}));
-
-vi.mock('react-i18next', () => ({
- useTranslation: () => ({
- t: (key: string) => {
- if (key === 'nodes.forLoopBodyBoundary') {
- return 'For loop body';
- }
- if (key === 'nodes.forLoopBodyBoundaryStatus.invalid_linkage') {
- return 'invalid loop linkage';
- }
- return key;
- },
- }),
-}));
-
-declare global {
- var IS_REACT_ACT_ENVIRONMENT: boolean;
-}
-globalThis.IS_REACT_ACT_ENVIRONMENT = true;
-
-const setNodeId = (node: AnyNode, id: string): AnyNode => {
- node.id = id;
- node.data.id = id;
- return node;
-};
-
-const edge = (source: string, sourceHandle: string, target: string, targetHandle: string): AnyEdge =>
- buildEdge(source, sourceHandle, target, targetHandle);
-
-describe('LoopBodyBoundaryOverlay', () => {
- let container: HTMLDivElement;
- let root: Root;
-
- beforeEach(() => {
- flowMocks.nodes = [];
- flowMocks.getNodesBounds.mockClear();
- container = document.createElement('div');
- document.body.appendChild(container);
- root = createRoot(container);
- });
-
- afterEach(() => {
- act(() => {
- root.unmount();
- });
- container.remove();
- });
-
- const renderBoundary = (withLinkage: boolean) => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const returnNode = setNodeId(buildNode(for_return), 'return');
- flowMocks.nodes = [forNode, returnNode];
-
- act(() => {
- root.render(
- <LoopBodyBoundaryOverlay
- edges={[
- edge('for', 'item', 'return', 'output'),
- ...(withLinkage ? [buildLoopLinkageEdge('for', 'return')] : []),
- ]}
- />
- );
- });
- };
-
- it('renders the loop body label for a valid linkage', () => {
- renderBoundary(true);
-
- const boundary = container.querySelector('[data-loop-body-boundary="for"]');
- expect(boundary?.getAttribute('aria-label')).toBe('For loop body');
- expect(boundary?.textContent).toBe('For loop body');
- expect(boundary?.getAttribute('data-loop-body-status')).toBe('complete');
- });
-
- it('labels a body with missing linkage', () => {
- renderBoundary(false);
-
- const boundary = container.querySelector('[data-loop-body-boundary="for"]');
- expect(boundary?.getAttribute('aria-label')).toBe(
- 'For loop body - nodes.forLoopBodyBoundaryStatus.missing_linkage'
- );
- expect(boundary?.getAttribute('data-loop-body-status')).toBe('missing_linkage');
- });
-
- it('includes validation status for a detached linkage', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const returnNode = setNodeId(buildNode(for_return), 'return');
- flowMocks.nodes = [forNode, returnNode];
-
- act(() => {
- root.render(<LoopBodyBoundaryOverlay edges={[buildLoopLinkageEdge('for', 'return')]} />);
- });
-
- const boundary = container.querySelector('[data-loop-body-boundary="for"]');
- expect(boundary?.getAttribute('aria-label')).toBe('For loop body - invalid loop linkage');
- expect(boundary?.getAttribute('data-loop-body-status')).toBe('invalid_linkage');
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationLoopLinkageEdge.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationLoopLinkageEdge.tsx
deleted file mode 100644
index 7e91962a50..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationLoopLinkageEdge.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import type { SystemStyleObject } from '@invoke-ai/ui-library';
-import { chakra } from '@invoke-ai/ui-library';
-import type { EdgeProps } from '@xyflow/react';
-import { BaseEdge, getBezierPath } from '@xyflow/react';
-import { useAppSelector } from 'app/store/storeHooks';
-import { buildSelectAreConnectedNodesSelected } from 'features/nodes/components/flow/edges/util/buildEdgeSelectors';
-import { selectShouldAnimateEdges } from 'features/nodes/store/workflowSettingsSlice';
-import type { LoopLinkageInvocationNodeEdge } from 'features/nodes/types/invocation';
-import { memo, useMemo } from 'react';
-
-const ChakraBaseEdge = chakra(BaseEdge);
-
-const edgeSx: SystemStyleObject = {
- strokeWidth: '2px !important',
- stroke: 'green.500 !important',
- strokeDasharray: '6 4',
- opacity: '0.75 !important',
- '&[data-selected="true"]': {
- opacity: '1 !important',
- },
- '&[data-should-animate-edges="true"]': {
- animation: 'dashdraw 0.5s linear infinite !important',
- },
-};
-
-const InvocationLoopLinkageEdge = ({
- sourceX,
- sourceY,
- targetX,
- targetY,
- sourcePosition,
- targetPosition,
- markerEnd,
- selected = false,
- source,
- target,
-}: EdgeProps<LoopLinkageInvocationNodeEdge>) => {
- const shouldAnimateEdges = useAppSelector(selectShouldAnimateEdges);
- const selectAreConnectedNodesSelected = useMemo(
- () => buildSelectAreConnectedNodesSelected(source, target),
- [source, target]
- );
- const areConnectedNodesSelected = useAppSelector(selectAreConnectedNodesSelected);
- const [edgePath] = getBezierPath({
- sourceX,
- sourceY,
- sourcePosition,
- targetX,
- targetY,
- targetPosition,
- });
-
- return (
- <ChakraBaseEdge
- path={edgePath}
- markerEnd={markerEnd}
- sx={edgeSx}
- data-selected={selected}
- data-are-connected-nodes-selected={areConnectedNodesSelected}
- data-should-animate-edges={shouldAnimateEdges}
- />
- );
-};
-
-export default memo(InvocationLoopLinkageEdge);
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Connector/ConnectorNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Connector/ConnectorNode.tsx
index 8f5a515b3e..bc6867a9b9 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Connector/ConnectorNode.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Connector/ConnectorNode.tsx
@@ -120,15 +120,9 @@ const ConnectorNode = ({ id, selected }: NodeProps<Node<ConnectorNodeData>>) =>
justifyContent="center"
borderRadius="full"
bg={selected ? 'base.650' : 'base.700'}
- data-connector-node-body="true"
>
<Box className="connector-border" />
- <Icon
- as={PiDotOutlineFill}
- boxSize={5}
- color={selected ? 'base.50' : 'base.100'}
- data-connector-node-icon="true"
- />
+ <Icon as={PiDotOutlineFill} boxSize={5} color={selected ? 'base.50' : 'base.100'} />
</Box>
<Handle
className={NO_DRAG_CLASS}
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx
index 9f785f152f..7bb92c1494 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx
@@ -1,18 +1,20 @@
import type { SystemStyleObject } from '@invoke-ai/ui-library';
import { Flex, Grid, GridItem } from '@invoke-ai/ui-library';
import { InputFieldGate } from 'features/nodes/components/flow/nodes/Invocation/fields/InputFieldGate';
+import { OutputFieldGate } from 'features/nodes/components/flow/nodes/Invocation/fields/OutputFieldGate';
+import { OutputFieldNodesEditorView } from 'features/nodes/components/flow/nodes/Invocation/fields/OutputFieldNodesEditorView';
import {
useInputFieldNamesAnyOrDirect,
useInputFieldNamesConnection,
useInputFieldNamesMissing,
} from 'features/nodes/hooks/useInputFieldNamesByStatus';
+import { useOutputFieldNames } from 'features/nodes/hooks/useOutputFieldNames';
import { useWithFooter } from 'features/nodes/hooks/useWithFooter';
import { memo } from 'react';
import { InputFieldEditModeNodes } from './fields/InputFieldEditModeNodes';
import InvocationNodeFooter from './InvocationNodeFooter';
import InvocationNodeHeader from './InvocationNodeHeader';
-import { OutputFields } from './OutputFields';
type Props = {
nodeId: string;
@@ -104,3 +106,19 @@ const MissingFields = memo(({ nodeId }: { nodeId: string }) => {
);
});
MissingFields.displayName = 'MissingFields';
+
+const OutputFields = memo(({ nodeId }: { nodeId: string }) => {
+ const fieldNames = useOutputFieldNames();
+ return (
+ <>
+ {fieldNames.map((fieldName, i) => (
+ <GridItem gridColumnStart={2} gridRowStart={i + 1} key={`${nodeId}.${fieldName}.output-field`}>
+ <OutputFieldGate nodeId={nodeId} fieldName={fieldName}>
+ <OutputFieldNodesEditorView nodeId={nodeId} fieldName={fieldName} />
+ </OutputFieldGate>
+ </GridItem>
+ ))}
+ </>
+ );
+});
+OutputFields.displayName = 'OutputFields';
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx
index 9368073f19..a257326f92 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx
@@ -15,7 +15,7 @@ interface Props {
export const InvocationNodeInfoIcon = memo(({ nodeId }: Props) => {
return (
<Tooltip label={<TooltipContent nodeId={nodeId} />} placement="top" shouldWrapChildren>
- <Icon as={PiInfoBold} data-node-info-icon="true" display="block" boxSize={4} w={8} />
+ <Icon as={PiInfoBold} display="block" boxSize={4} w={8} />
</Tooltip>
);
});
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx
index 2786a127db..a740a2ee3d 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx
@@ -30,14 +30,7 @@ const InvocationNodeStatusIndicator = ({ nodeId }: Props) => {
return (
<Tooltip label={<TooltipLabel nodeExecutionState={nodeExecutionState} />} placement="top">
- <Flex
- className={DRAG_HANDLE_CLASSNAME}
- data-node-status-indicator="true"
- w={5}
- h="full"
- alignItems="center"
- justifyContent="flex-end"
- >
+ <Flex className={DRAG_HANDLE_CLASSNAME} w={5} h="full" alignItems="center" justifyContent="flex-end">
<StatusIcon nodeExecutionState={nodeExecutionState} />
</Flex>
</Tooltip>
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.test.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.test.tsx
deleted file mode 100644
index 54f8f467e6..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.test.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import type { OutputFieldNamesByScope } from 'features/nodes/util/node/getOutputFieldNamesByScope';
-import type { ReactNode } from 'react';
-import { renderToStaticMarkup } from 'react-dom/server';
-import { describe, expect, it, vi } from 'vitest';
-
-import { OutputFields } from './OutputFields';
-
-const mocks = vi.hoisted(() => ({
- fieldNames: {
- all: ['item', 'output_collection'],
- unscoped: [],
- iteration: ['item'],
- final: ['output_collection'],
- } as OutputFieldNamesByScope,
-}));
-
-vi.mock('@invoke-ai/ui-library', () => ({
- GridItem: ({ children }: { children: ReactNode }) => <div>{children}</div>,
- Text: ({ children }: { children: ReactNode }) => <span>{children}</span>,
-}));
-
-vi.mock('features/nodes/hooks/useOutputFieldNames', () => ({
- useOutputFieldNamesByScope: () => mocks.fieldNames,
-}));
-
-vi.mock('features/nodes/components/flow/nodes/Invocation/fields/OutputFieldGate', () => ({
- OutputFieldGate: ({ children }: { children: ReactNode }) => children,
-}));
-
-vi.mock('features/nodes/components/flow/nodes/Invocation/fields/OutputFieldNodesEditorView', () => ({
- OutputFieldNodesEditorView: ({ fieldName }: { fieldName: string }) => <span data-field={fieldName}>{fieldName}</span>,
-}));
-
-vi.mock('react-i18next', () => ({
- useTranslation: () => ({ t: (key: string) => key }),
-}));
-
-describe(OutputFields.name, () => {
- it('renders scoped outputs under localized section headings', () => {
- const html = renderToStaticMarkup(<OutputFields nodeId="for" />);
-
- expect(html).toContain('nodes.iterationOutputs');
- expect(html).toContain('nodes.finalOutputs');
- expect(html.indexOf('nodes.iterationOutputs')).toBeLessThan(html.indexOf('data-field="item"'));
- expect(html.indexOf('nodes.finalOutputs')).toBeLessThan(html.indexOf('data-field="output_collection"'));
- });
-
- it('renders ordinary outputs without scope headings', () => {
- mocks.fieldNames = {
- all: ['value'],
- unscoped: ['value'],
- iteration: [],
- final: [],
- };
-
- const html = renderToStaticMarkup(<OutputFields nodeId="ordinary" />);
-
- expect(html).toContain('data-field="value"');
- expect(html).not.toContain('nodes.iterationOutputs');
- expect(html).not.toContain('nodes.finalOutputs');
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.tsx
deleted file mode 100644
index a46dbf2a7e..0000000000
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/OutputFields.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { GridItem, Text } from '@invoke-ai/ui-library';
-import { OutputFieldGate } from 'features/nodes/components/flow/nodes/Invocation/fields/OutputFieldGate';
-import { OutputFieldNodesEditorView } from 'features/nodes/components/flow/nodes/Invocation/fields/OutputFieldNodesEditorView';
-import { useOutputFieldNamesByScope } from 'features/nodes/hooks/useOutputFieldNames';
-import { getOutputFieldRows } from 'features/nodes/util/node/getOutputFieldRows';
-import { memo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-export const OutputFields = memo(({ nodeId }: { nodeId: string }) => {
- const { t } = useTranslation();
- const fieldNames = useOutputFieldNamesByScope();
- const rows = getOutputFieldRows(fieldNames);
- return (
- <>
- {rows.map((row, i) =>
- row.type === 'header' ? (
- <GridItem gridColumnStart={2} gridRowStart={i + 1} key={`${nodeId}.${row.scope}.output-header`} px={2} pt={1}>
- <Text variant="subtext" fontSize="xs" fontWeight="semibold" textAlign="end">
- {row.scope === 'iteration' ? t('nodes.iterationOutputs') : t('nodes.finalOutputs')}
- </Text>
- </GridItem>
- ) : (
- <GridItem gridColumnStart={2} gridRowStart={i + 1} key={`${nodeId}.${row.fieldName}.output-field`}>
- <OutputFieldGate nodeId={nodeId} fieldName={row.fieldName}>
- <OutputFieldNodesEditorView nodeId={nodeId} fieldName={row.fieldName} />
- </OutputFieldGate>
- </GridItem>
- )
- )}
- </>
- );
-});
-OutputFields.displayName = 'OutputFields';
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldTitle.tsx
index 40c2db08ce..396b05c2ac 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldTitle.tsx
+++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldTitle.tsx
@@ -100,7 +100,6 @@ export const InputFieldTitle = memo((props: Props) => {
className={NO_FIT_ON_DOUBLE_CLICK_CLASS}
sx={labelSx}
noOfLines={1}
- data-node-input-field-title="true"
data-is-invalid={isInvalid}
data-is-disabled={isDisabled}
data-is-added-to-form={isAddedToForm}
diff --git a/invokeai/frontend/web/src/features/nodes/hooks/useAutoLayout.ts b/invokeai/frontend/web/src/features/nodes/hooks/useAutoLayout.ts
index 90286610b7..eb8eeb052a 100644
--- a/invokeai/frontend/web/src/features/nodes/hooks/useAutoLayout.ts
+++ b/invokeai/frontend/web/src/features/nodes/hooks/useAutoLayout.ts
@@ -83,12 +83,10 @@ export const useAutoLayout = (): (() => void) => {
});
});
- let edgesToLayout: Edge[] = edges.filter((edge) => edge.type !== 'loop_linkage');
+ let edgesToLayout: Edge[] = edges;
if (isLayoutSelection) {
const nodesToLayoutIds = new Set(nodesToLayout.map((n) => n.id));
- edgesToLayout = edges.filter(
- (edge) => edge.type !== 'loop_linkage' && nodesToLayoutIds.has(edge.source) && nodesToLayoutIds.has(edge.target)
- );
+ edgesToLayout = edges.filter((edge) => nodesToLayoutIds.has(edge.source) && nodesToLayoutIds.has(edge.target));
}
edgesToLayout.forEach((edge) => {
diff --git a/invokeai/frontend/web/src/features/nodes/hooks/useNodeCopyPaste.ts b/invokeai/frontend/web/src/features/nodes/hooks/useNodeCopyPaste.ts
index 786724abb6..5c86a0b8f0 100644
--- a/invokeai/frontend/web/src/features/nodes/hooks/useNodeCopyPaste.ts
+++ b/invokeai/frontend/web/src/features/nodes/hooks/useNodeCopyPaste.ts
@@ -16,9 +16,7 @@ import {
import { selectNodesSlice } from 'features/nodes/store/selectors';
import { findUnoccupiedPosition } from 'features/nodes/store/util/findUnoccupiedPosition';
import { validateConnection } from 'features/nodes/store/util/validateConnection';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import { isInvocationNode } from 'features/nodes/types/invocation';
import { t } from 'i18next';
import { v4 as uuidv4 } from 'uuid';
@@ -136,39 +134,6 @@ const _pasteSelection = (withEdgesToCopiedNodes?: boolean) => {
);
return;
}
- } else if (e.type === 'loop_linkage') {
- const sourceNode = validationNodes.find((n) => n.id === e.source);
- const targetNode = validationNodes.find((n) => n.id === e.target);
- if (
- !sourceNode ||
- !targetNode ||
- !isInvocationNode(sourceNode) ||
- !isInvocationNode(targetNode) ||
- sourceNode.data.type !== 'for' ||
- targetNode.data.type !== 'for_return' ||
- e.sourceHandle !== LOOP_LINKAGE_FIELD ||
- e.targetHandle !== LOOP_LINKAGE_FIELD
- ) {
- log.warn(
- {
- edgeId: e.id,
- source: e.source,
- sourceHandle: e.sourceHandle,
- target: e.target,
- targetHandle: e.targetHandle,
- },
- `Invalid loop linkage edge, cannot paste`
- );
- return;
- }
- if (
- validationEdges.some(
- (edge) => edge.type === 'loop_linkage' && (edge.source === e.source || edge.target === e.target)
- )
- ) {
- log.warn({ edgeId: e.id, source: e.source, target: e.target }, `Duplicate loop linkage edge, cannot paste`);
- return;
- }
} else if (e.type === 'default') {
const { type, source, sourceHandle, target, targetHandle } = e;
@@ -200,7 +165,7 @@ const _pasteSelection = (withEdgesToCopiedNodes?: boolean) => {
return;
}
} else {
- // All our edges should be either "collapsed", "default", or "loop_linkage" type.
+ // All our edges should be either "collapsed" or "default" type, so if we get here, something is wrong
const { type } = e;
log.warn({ edge: { type } }, `Invalid edge type, cannot paste`);
return;
diff --git a/invokeai/frontend/web/src/features/nodes/hooks/useOutputFieldNames.ts b/invokeai/frontend/web/src/features/nodes/hooks/useOutputFieldNames.ts
index b58bbab0ac..81e89b0fe7 100644
--- a/invokeai/frontend/web/src/features/nodes/hooks/useOutputFieldNames.ts
+++ b/invokeai/frontend/web/src/features/nodes/hooks/useOutputFieldNames.ts
@@ -1,22 +1,17 @@
import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/store/storeHooks';
import { useInvocationNodeContext } from 'features/nodes/components/flow/nodes/Invocation/context';
-import {
- getOutputFieldNamesByScope,
- type OutputFieldNamesByScope,
-} from 'features/nodes/util/node/getOutputFieldNamesByScope';
+import { getSortedFilteredFieldNames } from 'features/nodes/util/node/getSortedFilteredFieldNames';
import { useMemo } from 'react';
-export const useOutputFieldNamesByScope = (): OutputFieldNamesByScope => {
+export const useOutputFieldNames = (): string[] => {
const ctx = useInvocationNodeContext();
const selector = useMemo(
() =>
createSelector([ctx.selectNodeTemplateOrThrow], (template) =>
- getOutputFieldNamesByScope(Object.values(template.outputs))
+ getSortedFilteredFieldNames(Object.values(template.outputs))
),
[ctx]
);
return useAppSelector(selector);
};
-
-export const useOutputFieldNames = (): string[] => useOutputFieldNamesByScope().all;
diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.test.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.test.ts
index 5ceb678d13..6703317f2c 100644
--- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.test.ts
@@ -7,25 +7,14 @@ import { describe, expect, it } from 'vitest';
import {
callSavedWorkflowDynamicFieldsChanged,
connectorInserted,
- edgesChanged,
fieldIntegerValueChanged,
fieldStringValueChanged,
fieldValueReset,
- nodeIsOpenChanged,
nodesChanged,
nodesSliceConfig,
} from './nodesSlice';
import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from './util/connectorTopology';
-import {
- add,
- buildEdge,
- buildLoopLinkageEdge,
- buildNode,
- for_loop,
- for_return,
- sub,
- templates,
-} from './util/testUtils';
+import { add, buildEdge, buildNode, sub, templates } from './util/testUtils';
const callSavedWorkflowTemplate = templates.call_saved_workflow;
const addTemplate = templates.add;
@@ -509,30 +498,6 @@ describe('nodesSlice connector actions', () => {
]);
});
- it('splits a direct loop linkage into a connector alias when inserting a connector', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const connector = buildFixedConnectorNode('connector-1');
- const directEdge = buildLoopLinkageEdge(forNode.id, returnNode.id);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [directEdge];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- connectorInserted({
- edgeId: directEdge.id,
- connector,
- })
- );
-
- expect(nextState.edges).toEqual([
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ]);
- });
-
it('splices connector outputs back to the resolved upstream source when removed', () => {
const source = buildNode(add);
const target = buildNode(sub);
@@ -647,362 +612,3 @@ describe('nodesSlice connector actions', () => {
expect(nextState.edges).toEqual([buildEdge(source.id, 'value', target.id, 'a')]);
});
});
-
-describe('nodesSlice loop boundary actions', () => {
- it('stores loop linkage as an explicit edge', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- edgesChanged([{ type: 'add', item: buildLoopLinkageEdge(forNode.id, returnNode.id) }])
- );
- expect(nextState.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
- it('removes loop linkage when either boundary node is removed', () => {
- const oldForNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [oldForNode, returnNode];
- initialState.edges = [buildLoopLinkageEdge(oldForNode.id, returnNode.id)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: oldForNode.id }])
- );
- expect(nextState.edges).toEqual([]);
- });
-
- it('removes all connector alias edges when a For boundary is removed', () => {
- const forNode = buildNode(for_loop);
- const connector = buildFixedConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, connector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(initialState, nodesChanged([{ type: 'remove', id: forNode.id }]));
-
- expect(nextState.edges).toEqual([]);
- });
-
- it('removes all connector alias edges when a For boundary is replaced by another node type', () => {
- const forNode = buildNode(for_loop);
- const replacement = buildNode(add);
- const connector = buildFixedConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- replacement.id = forNode.id;
- replacement.data.id = forNode.id;
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, connector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([
- { type: 'remove', id: forNode.id },
- { type: 'add', item: replacement },
- ])
- );
-
- expect(nextState.edges).toEqual([]);
- });
-
- it('removes an incomplete connector alias when a For boundary is replaced by another node type', () => {
- const forNode = buildNode(for_loop);
- const replacement = buildNode(add);
- const connector = buildFixedConnectorNode('connector-1');
- replacement.id = forNode.id;
- replacement.data.id = forNode.id;
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, connector];
- initialState.edges = [buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([
- { type: 'remove', id: forNode.id },
- { type: 'add', item: replacement },
- ])
- );
-
- expect(nextState.edges).toEqual([]);
- });
-
- it('splices a connector loop linkage alias into a direct edge when removed', () => {
- const forNode = buildNode(for_loop);
- const connector = buildFixedConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, connector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: connector.id }])
- );
-
- expect(nextState.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
- it('splices a removed terminal loop linkage connector to the preceding connector', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildFixedConnectorNode('connector-a');
- const terminalConnector = buildFixedConnectorNode('connector-b');
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, firstConnector, terminalConnector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, terminalConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(terminalConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: terminalConnector.id }])
- );
-
- expect(nextState.nodes.map((node) => node.id)).toEqual([forNode.id, firstConnector.id, returnNode.id]);
- expect(nextState.edges).toEqual([
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- expect.objectContaining({
- type: 'default',
- source: firstConnector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
- it('splices a removed interior loop linkage connector to the preceding connector', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildFixedConnectorNode('connector-a');
- const removedConnector = buildFixedConnectorNode('connector-b');
- const terminalConnector = buildFixedConnectorNode('connector-c');
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, firstConnector, removedConnector, terminalConnector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, removedConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(removedConnector.id, CONNECTOR_OUTPUT_HANDLE, terminalConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(terminalConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: removedConnector.id }])
- );
-
- expect(nextState.nodes.map((node) => node.id)).toEqual([
- forNode.id,
- firstConnector.id,
- terminalConnector.id,
- returnNode.id,
- ]);
- expect(nextState.edges).toEqual(
- expect.arrayContaining([
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, terminalConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(terminalConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ])
- );
- });
-
- it('splices a chain when multiple loop linkage connectors are removed together', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildFixedConnectorNode('connector-a');
- const secondConnector = buildFixedConnectorNode('connector-b');
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, firstConnector, secondConnector, returnNode];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, secondConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([
- { type: 'remove', id: firstConnector.id },
- { type: 'remove', id: secondConnector.id },
- ])
- );
-
- expect(nextState.nodes.map((node) => node.id)).toEqual([forNode.id, returnNode.id]);
- expect(nextState.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
- it('does not create invalid edges when removing a loop linkage connector with an ordinary fanout', () => {
- const forNode = buildNode(for_loop);
- const connector = buildFixedConnectorNode('connector');
- const returnNode = buildNode(for_return);
- const ordinaryTarget = buildNode(sub);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, connector, returnNode, ordinaryTarget];
- initialState.edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, ordinaryTarget.id, 'a'),
- ];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: connector.id }])
- );
-
- expect(nextState.nodes.map((node) => node.id)).toEqual([forNode.id, returnNode.id, ordinaryTarget.id]);
- expect(nextState.edges).toEqual([]);
- });
-
- it('preserves linkage when a boundary is replaced with the same node id', () => {
- const forNode = buildNode(for_loop);
- const replacement = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- replacement.id = forNode.id;
- replacement.data.id = forNode.id;
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [buildLoopLinkageEdge(forNode.id, returnNode.id)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([
- { type: 'remove', id: forNode.id },
- { type: 'add', item: replacement },
- ])
- );
- expect(nextState.edges).toEqual([buildLoopLinkageEdge(forNode.id, returnNode.id)]);
- });
-
- it('removes linkage when a boundary is replaced by a different node type', () => {
- const forNode = buildNode(for_loop);
- const replacement = buildNode(add);
- const returnNode = buildNode(for_return);
- replacement.id = forNode.id;
- replacement.data.id = forNode.id;
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [buildLoopLinkageEdge(forNode.id, returnNode.id)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([
- { type: 'remove', id: forNode.id },
- { type: 'add', item: replacement },
- ])
- );
-
- expect(nextState.edges).toEqual([]);
- });
-
- it('removes linkage when its ForReturn is removed', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [buildLoopLinkageEdge(forNode.id, returnNode.id)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodesChanged([{ type: 'remove', id: returnNode.id }])
- );
- expect(nextState.edges).toEqual([]);
- });
-
- it('does not collapse loop linkage when both boundary nodes are closed', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- returnNode.data.isOpen = false;
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [buildLoopLinkageEdge(forNode.id, returnNode.id)];
-
- const nextState = nodesSliceConfig.slice.reducer(
- initialState,
- nodeIsOpenChanged({ nodeId: forNode.id, isOpen: false })
- );
-
- expect(nextState.edges).toEqual([buildLoopLinkageEdge(forNode.id, returnNode.id)]);
- });
-
- it('does not treat loop linkage as a hidden edge of a collapsed data-flow edge', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- returnNode.data.isOpen = false;
- const loopLinkageEdge = buildLoopLinkageEdge(forNode.id, returnNode.id);
- const dataFlowEdge = buildEdge(forNode.id, 'item', returnNode.id, 'output');
-
- const initialState = deepClone(nodesSliceConfig.slice.reducer(undefined, { type: 'test/init' }));
- initialState.nodes = [forNode, returnNode];
- initialState.edges = [dataFlowEdge, loopLinkageEdge];
-
- const closedState = nodesSliceConfig.slice.reducer(
- initialState,
- nodeIsOpenChanged({ nodeId: forNode.id, isOpen: false })
- );
- const collapsedEdge = closedState.edges.find((edge) => edge.type === 'collapsed');
- if (!collapsedEdge) {
- throw new Error('Expected collapsed edge');
- }
-
- const nextState = nodesSliceConfig.slice.reducer(
- closedState,
- edgesChanged([{ type: 'remove', id: collapsedEdge.id }])
- );
-
- expect(nextState.edges).toEqual([loopLinkageEdge]);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts
index 7ca12180a6..3faabbce8f 100644
--- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts
@@ -24,11 +24,11 @@ import { type NodesState, zNodesState } from 'features/nodes/store/types';
import {
CONNECTOR_INPUT_HANDLE,
CONNECTOR_OUTPUT_HANDLE,
- getConnectorDeletionSpliceConnections,
- getLoopLinkageAliasEdgeIdsForBoundary,
+ getConnectorOutputEdges,
+ resolveConnectorSource,
} from 'features/nodes/store/util/connectorTopology';
-import { connectionToEdge, isLoopLinkageEdge } from 'features/nodes/store/util/reactFlowUtil';
-import { LOOP_LINKAGE_FIELD, SHARED_NODE_PROPERTIES } from 'features/nodes/types/constants';
+import { connectionToEdge } from 'features/nodes/store/util/reactFlowUtil';
+import { SHARED_NODE_PROPERTIES } from 'features/nodes/types/constants';
import type {
BoardFieldValue,
BooleanFieldValue,
@@ -248,96 +248,37 @@ const removeCallSavedWorkflowDynamicFieldsFromForm = (
}
};
-const isValidLoopLinkageEdge = (edge: AnyEdge, nodes: AnyNode[]): boolean => {
- if (!isLoopLinkageEdge(edge)) {
- return true;
- }
-
- const sourceNode = nodes.find((node) => node.id === edge.source);
- const targetNode = nodes.find((node) => node.id === edge.target);
- return Boolean(
- sourceNode &&
- targetNode &&
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- isInvocationNode(targetNode) &&
- targetNode.data.type === 'for_return' &&
- edge.sourceHandle === LOOP_LINKAGE_FIELD &&
- edge.targetHandle === LOOP_LINKAGE_FIELD
- );
-};
-
const slice = createSlice({
name: 'nodes',
initialState: getInitialState(),
reducers: {
nodesChanged: (state, action: PayloadAction<NodeChange<AnyNode>[]>) => {
- const replacementNodesById = new Map<string, AnyNode>();
- for (const change of action.payload) {
- if (change.type === 'add' || change.type === 'replace') {
- replacementNodesById.set(change.item.id, change.item);
- }
- }
-
- const removedBoundaryAliasEdgeIds = new Set<string>();
- for (const change of action.payload) {
- if (change.type !== 'remove' && change.type !== 'replace') {
- continue;
- }
-
- const oldNode = state.nodes.find((candidate) => candidate.id === change.id);
- if (!isInvocationNode(oldNode) || !['for', 'for_return'].includes(oldNode.data.type)) {
- continue;
- }
-
- const replacementNode = replacementNodesById.get(change.id);
- if (isInvocationNode(replacementNode) && replacementNode.data.type === oldNode.data.type) {
- continue;
- }
-
- getLoopLinkageAliasEdgeIdsForBoundary(oldNode.id, state.nodes, state.edges).forEach((edgeId) =>
- removedBoundaryAliasEdgeIds.add(edgeId)
- );
- }
-
- const replacementNodeIds = new Set(
- action.payload.flatMap((change) => (change.type === 'add' || change.type === 'replace' ? [change.item.id] : []))
- );
- const removedConnectorIds = new Set(
- action.payload
- .flatMap((change) => (change.type === 'remove' && !replacementNodeIds.has(change.id) ? [change.id] : []))
- .filter((nodeId) => isConnectorNode(state.nodes.find((node) => node.id === nodeId)))
- );
- const removedNodeIds = new Set(
- action.payload.flatMap((change) =>
- change.type === 'remove' && !replacementNodeIds.has(change.id) ? [change.id] : []
- )
- );
- const removedConnectorSpliceEdgesById = new Map<string, AnyEdge>();
- for (const change of action.payload) {
+ const removedConnectorSpliceEdges: AnyEdge[] = action.payload.flatMap((change) => {
if (change.type !== 'remove') {
- continue;
+ return [];
}
const node = state.nodes.find((candidate) => candidate.id === change.id);
- if (!isConnectorNode(node) || !removedConnectorIds.has(node.id)) {
- continue;
+ if (!isConnectorNode(node)) {
+ return [];
}
- const spliceEdges =
- getConnectorDeletionSpliceConnections(
- node.id,
- state.nodes,
- state.edges,
- undefined,
- undefined,
- removedConnectorIds
- )
- ?.filter((connection) => !removedNodeIds.has(connection.source) && !removedNodeIds.has(connection.target))
- .map((connection) => connectionToEdge(connection)) ?? [];
- spliceEdges.forEach((edge) => removedConnectorSpliceEdgesById.set(edge.id, edge));
- }
- const removedConnectorSpliceEdges = [...removedConnectorSpliceEdgesById.values()];
+ const resolvedSource = resolveConnectorSource(node.id, state.nodes, state.edges);
+ if (!resolvedSource) {
+ return [];
+ }
+
+ return getConnectorOutputEdges(node.id, state.edges)
+ .filter((edge): edge is AnyEdge & { type: 'default'; targetHandle: string } => edge.type === 'default')
+ .map((edge) =>
+ connectionToEdge({
+ source: resolvedSource.nodeId,
+ sourceHandle: resolvedSource.fieldName,
+ target: edge.target,
+ targetHandle: edge.targetHandle,
+ })
+ );
+ });
// TODO(psyche): The below TS issue was recently fixed upstream. Need to upgrade @xyflow/react and then we
// should be able to remove this cast.
@@ -363,11 +304,7 @@ const slice = createSlice({
for (const e of state.edges) {
const sourceExists = state.nodes.some((n) => n.id === e.source);
const targetExists = state.nodes.some((n) => n.id === e.target);
- if (
- !(sourceExists && targetExists) ||
- !isValidLoopLinkageEdge(e, state.nodes) ||
- removedBoundaryAliasEdgeIds.has(e.id)
- ) {
+ if (!(sourceExists && targetExists)) {
edgeChanges.push({ type: 'remove', id: e.id });
}
}
@@ -413,9 +350,7 @@ const slice = createSlice({
const edge = state.edges.find((e) => e.id === change.id);
// If we deleted or selected a collapsed edge, we need to find its "hidden" edges and do the same to them
if (edge && edge.type === 'collapsed') {
- const hiddenEdges = state.edges.filter(
- (e) => e.type === 'default' && e.source === edge.source && e.target === edge.target
- );
+ const hiddenEdges = state.edges.filter((e) => e.source === edge.source && e.target === edge.target);
for (const { id } of hiddenEdges) {
if (change.type === 'remove') {
changes.push({ type: 'remove', id });
@@ -496,7 +431,6 @@ const slice = createSlice({
// - if the edge was just closed, we need to check all its edges and hide them if both nodes are closed
const connectedEdges = getConnectedEdges([node], state.edges);
- const executableConnectedEdges = connectedEdges.filter((edge) => edge.type !== 'loop_linkage');
if (isOpen) {
// reset hidden status of all edges
@@ -510,19 +444,18 @@ const slice = createSlice({
}
});
} else {
- const executableEdges = state.edges.filter((edge) => edge.type !== 'loop_linkage');
- const closedIncomers = getIncomers(node, state.nodes, executableEdges).filter(
+ const closedIncomers = getIncomers(node, state.nodes, state.edges).filter(
(node) => isInvocationNode(node) && node.data.isOpen === false
);
- const closedOutgoers = getOutgoers(node, state.nodes, executableEdges).filter(
+ const closedOutgoers = getOutgoers(node, state.nodes, state.edges).filter(
(node) => isInvocationNode(node) && node.data.isOpen === false
);
const collapsedEdgesToCreate: AnyEdge[] = [];
// hide all edges
- executableConnectedEdges.forEach((edge) => {
+ connectedEdges.forEach((edge) => {
if (edge.target === nodeId && closedIncomers.find((node) => node.id === edge.source)) {
edge.hidden = true;
const collapsedEdge = collapsedEdgesToCreate.find(
@@ -583,7 +516,7 @@ const slice = createSlice({
) => {
const { edgeId, connector } = action.payload;
const edge = state.edges.find((candidate) => candidate.id === edgeId);
- if (!edge || (edge.type !== 'default' && edge.type !== 'loop_linkage')) {
+ if (!edge || edge.type !== 'default') {
return;
}
state.nodes.push({ ...SHARED_NODE_PROPERTIES, ...connector } as (typeof state.nodes)[number]);
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.test.ts
index 3a6e203079..e87ebcde79 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.test.ts
@@ -7,13 +7,10 @@ import {
getConnectorDeletionSpliceConnections,
getConnectorInputEdge,
getConnectorOutputEdges,
- getEdgesWithLoopLinkageAliases,
resolveConnectorSource,
resolveConnectorSourceFieldType,
- resolveLoopLinkagePath,
- resolvePendingConnectionSource,
} from './connectorTopology';
-import { add, buildEdge, buildNode, for_loop, for_return, img_resize, sub, templates } from './testUtils';
+import { add, buildEdge, buildNode, img_resize, sub, templates } from './testUtils';
const buildConnectorNode = (id: string): ConnectorNode => ({
id,
@@ -28,32 +25,6 @@ const buildConnectorNode = (id: string): ConnectorNode => ({
});
describe('connectorTopology', () => {
- it('resolves pending connector source metadata, including output scope', () => {
- const source = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const pendingConnection = {
- nodeId: connector.id,
- handleId: CONNECTOR_OUTPUT_HANDLE,
- handleType: 'source' as const,
- fieldTemplate: {
- name: CONNECTOR_OUTPUT_HANDLE,
- title: 'Connector Output',
- description: '',
- fieldKind: 'output' as const,
- ui_hidden: false,
- type: { name: 'AnyField', cardinality: 'SINGLE' as const, batch: false },
- },
- };
- const nodes: AnyNode[] = [source, connector];
- const edges = [buildEdge(source.id, 'item', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- expect(resolvePendingConnectionSource(pendingConnection, nodes, edges, { ...templates, for: for_loop })).toEqual({
- nodeId: source.id,
- fieldName: 'item',
- outputScope: 'iteration',
- });
- });
-
it('resolves the effective upstream source through one connector', () => {
const source = buildNode(add);
const connector = buildConnectorNode('connector-1');
@@ -87,92 +58,6 @@ describe('connectorTopology', () => {
});
});
- it('resolves a one-to-one connector loop linkage path', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const inputEdge = buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE);
- const outputEdge = buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage');
- const nodes: AnyNode[] = [forNode, connector, returnNode];
-
- expect(resolveLoopLinkagePath(outputEdge, nodes, [inputEdge, outputEdge])).toEqual({
- forNodeId: forNode.id,
- returnNodeId: returnNode.id,
- edgeIds: [inputEdge.id, outputEdge.id],
- connectorNodeIds: [connector.id],
- });
- });
-
- it('resolves a connector loop linkage path through a connector chain', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const firstInputEdge = buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE);
- const chainEdge = buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, secondConnector.id, CONNECTOR_INPUT_HANDLE);
- const outputEdge = buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage');
- const nodes: AnyNode[] = [forNode, firstConnector, secondConnector, returnNode];
-
- expect(resolveLoopLinkagePath(outputEdge, nodes, [firstInputEdge, chainEdge, outputEdge])).toEqual({
- forNodeId: forNode.id,
- returnNodeId: returnNode.id,
- edgeIds: [firstInputEdge.id, chainEdge.id, outputEdge.id],
- connectorNodeIds: [firstConnector.id, secondConnector.id],
- });
- });
-
- it('marks every complete connector loop linkage segment for dashed rendering', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const inputEdge = buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE);
- const outputEdge = buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage');
- const edges = [inputEdge, outputEdge];
-
- expect(getEdgesWithLoopLinkageAliases([forNode, connector, returnNode], edges)).toEqual([
- { ...inputEdge, type: 'loop_linkage' },
- { ...outputEdge, type: 'loop_linkage' },
- ]);
- expect(edges).toEqual([inputEdge, outputEdge]);
- });
-
- it('marks every segment in a chained connector loop linkage for dashed rendering', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, secondConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(getEdgesWithLoopLinkageAliases([forNode, firstConnector, secondConnector, returnNode], edges)).toEqual(
- edges.map((edge) => ({ ...edge, type: 'loop_linkage' }))
- );
- });
-
- it('leaves an incomplete connector loop linkage path as a default edge', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const edges = [buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- expect(getEdgesWithLoopLinkageAliases([forNode, connector], edges)).toEqual(edges);
- });
-
- it('rejects a connector loop linkage path that fans out', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const firstReturnNode = buildNode(for_return);
- const secondReturnNode = buildNode(for_return);
- const inputEdge = buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE);
- const firstOutputEdge = buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, firstReturnNode.id, 'loop_linkage');
- const secondOutputEdge = buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, secondReturnNode.id, 'loop_linkage');
- const nodes: AnyNode[] = [forNode, connector, firstReturnNode, secondReturnNode];
-
- expect(resolveLoopLinkagePath(firstOutputEdge, nodes, [inputEdge, firstOutputEdge, secondOutputEdge])).toBe(null);
- });
-
it('returns no source or type for an unresolved connector chain', () => {
const connectorA = buildConnectorNode('connector-a');
const connectorB = buildConnectorNode('connector-b');
@@ -230,54 +115,6 @@ describe('connectorTopology', () => {
]);
});
- it('splices a terminal loop linkage connector to its immediate upstream connector', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-a');
- const terminalConnector = buildConnectorNode('connector-b');
- const returnNode = buildNode(for_return);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, terminalConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(terminalConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(
- getConnectorDeletionSpliceConnections(
- terminalConnector.id,
- [forNode, firstConnector, terminalConnector, returnNode],
- edges,
- { ...templates, for: for_loop, for_return }
- )
- ).toEqual([
- {
- source: firstConnector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- ]);
- });
-
- it('does not splice a loop linkage connector with an invalid ordinary fanout', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector');
- const returnNode = buildNode(for_return);
- const ordinaryTarget = buildNode(sub);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, ordinaryTarget.id, 'a'),
- ];
-
- expect(
- getConnectorDeletionSpliceConnections(connector.id, [forNode, connector, returnNode, ordinaryTarget], edges, {
- ...templates,
- for: for_loop,
- for_return,
- })
- ).toBe(null);
- });
-
it('returns no splice-through edges when a connector has downstream targets but no upstream source', () => {
const connector = buildConnectorNode('connector-1');
const target = buildNode(sub);
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.ts b/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.ts
index 6d96d03d4b..e1267763d7 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/connectorTopology.ts
@@ -1,5 +1,4 @@
-import type { PendingConnection, Templates } from 'features/nodes/store/types';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
+import type { Templates } from 'features/nodes/store/types';
import type { FieldType } from 'features/nodes/types/field';
import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
import { isConnectorNode, isInvocationNode } from 'features/nodes/types/invocation';
@@ -12,13 +11,6 @@ type ResolvedConnectorSource = {
fieldName: string;
};
-type ResolvedLoopLinkagePath = {
- forNodeId: string;
- returnNodeId: string;
- edgeIds: string[];
- connectorNodeIds: string[];
-};
-
type SpliceConnection = {
source: string;
sourceHandle: string;
@@ -35,17 +27,6 @@ type SpliceConnectionValidator = (
strict?: boolean
) => string | null;
-type ResolvedConnectorOutputEdges = {
- edges: AnyEdge[];
- traversedEdgeIds: Set<string>;
-};
-
-type ResolvedPendingConnectionSource = {
- nodeId: string;
- fieldName: string;
- outputScope?: 'iteration' | 'final';
-};
-
export const getConnectorInputEdge = (connectorId: string, edges: AnyEdge[]): AnyEdge | undefined =>
edges.find(
(edge) =>
@@ -64,84 +45,6 @@ export const getConnectorOutputEdges = (connectorId: string, edges: AnyEdge[]):
typeof edge.targetHandle === 'string'
);
-const getConnectorDeletionOutputEdges = (
- connectorId: string,
- nodes: AnyNode[],
- edges: AnyEdge[],
- removedConnectorIds: ReadonlySet<string>
-): ResolvedConnectorOutputEdges | null => {
- const visitedConnectorIds = new Set<string>();
- const traversedEdgeIds = new Set<string>();
- const outputEdges: AnyEdge[] = [];
-
- const resolve = (currentConnectorId: string): boolean => {
- if (visitedConnectorIds.has(currentConnectorId)) {
- return false;
- }
- visitedConnectorIds.add(currentConnectorId);
-
- for (const edge of getConnectorOutputEdges(currentConnectorId, edges)) {
- traversedEdgeIds.add(edge.id);
- const targetNode = nodes.find((node) => node.id === edge.target);
- if (removedConnectorIds.has(edge.target) && isConnectorNode(targetNode)) {
- if (!resolve(targetNode.id)) {
- return false;
- }
- } else {
- outputEdges.push(edge);
- }
- }
- return true;
- };
-
- return resolve(connectorId) ? { edges: outputEdges, traversedEdgeIds } : null;
-};
-
-const getConnectorDeletionInputEdgeIds = (
- connectorId: string,
- nodes: AnyNode[],
- edges: AnyEdge[],
- removedConnectorIds: ReadonlySet<string>
-): Set<string> => {
- const inputEdgeIds = new Set<string>();
- const visitedConnectorIds = new Set<string>();
- let currentConnectorId: string | null = connectorId;
-
- while (currentConnectorId && !visitedConnectorIds.has(currentConnectorId)) {
- visitedConnectorIds.add(currentConnectorId);
- const inputEdge = getConnectorInputEdge(currentConnectorId, edges);
- if (!inputEdge) {
- break;
- }
- inputEdgeIds.add(inputEdge.id);
-
- const sourceNode = nodes.find((node) => node.id === inputEdge.source);
- currentConnectorId = isConnectorNode(sourceNode) && removedConnectorIds.has(sourceNode.id) ? sourceNode.id : null;
- }
-
- return inputEdgeIds;
-};
-
-const resolveSurvivingConnectorDeletionSource = (
- connectorId: string,
- nodes: AnyNode[],
- edges: AnyEdge[],
- removedConnectorIds: ReadonlySet<string>
-): ResolvedConnectorSource | null => {
- const visitedConnectorIds = new Set<string>();
- let resolvedSource = resolveConnectorDeletionSource(connectorId, nodes, edges);
-
- while (resolvedSource && removedConnectorIds.has(resolvedSource.nodeId)) {
- if (visitedConnectorIds.has(resolvedSource.nodeId)) {
- return null;
- }
- visitedConnectorIds.add(resolvedSource.nodeId);
- resolvedSource = resolveConnectorDeletionSource(resolvedSource.nodeId, nodes, edges);
- }
-
- return resolvedSource;
-};
-
export const resolveConnectorSource = (
connectorId: string,
nodes: AnyNode[],
@@ -182,284 +85,6 @@ export const resolveConnectorSource = (
return resolve(connectorId);
};
-/**
- * Resolves a connector alias used for the visual loop linkage between a For and ForReturn.
- * Every connector on this path must have exactly one input and one output, so the alias cannot
- * branch or be reused as ordinary data flow.
- */
-export const resolveLoopLinkagePath = (
- edge: AnyEdge,
- nodes: AnyNode[],
- edges: AnyEdge[]
-): ResolvedLoopLinkagePath | null => {
- if (edge.type !== 'default' || edge.targetHandle !== LOOP_LINKAGE_FIELD || typeof edge.sourceHandle !== 'string') {
- return null;
- }
-
- const returnNode = nodes.find((node) => node.id === edge.target);
- if (!returnNode || !isInvocationNode(returnNode) || returnNode.data.type !== 'for_return') {
- return null;
- }
-
- const edgeIds = [edge.id];
- const connectorNodeIds: string[] = [];
- const visitedConnectors = new Set<string>();
- let currentEdge: AnyEdge = edge;
-
- while (true) {
- const sourceNode = nodes.find((node) => node.id === currentEdge.source);
- if (!sourceNode || typeof currentEdge.sourceHandle !== 'string') {
- return null;
- }
-
- if (isInvocationNode(sourceNode)) {
- if (sourceNode.data.type !== 'for' || currentEdge.sourceHandle !== LOOP_LINKAGE_FIELD) {
- return null;
- }
- return {
- forNodeId: sourceNode.id,
- returnNodeId: returnNode.id,
- edgeIds: [...edgeIds].reverse(),
- connectorNodeIds: [...connectorNodeIds].reverse(),
- };
- }
-
- if (!isConnectorNode(sourceNode) || currentEdge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE) {
- return null;
- }
- if (visitedConnectors.has(sourceNode.id)) {
- return null;
- }
- visitedConnectors.add(sourceNode.id);
- connectorNodeIds.push(sourceNode.id);
-
- const inputEdges = edges.filter(
- (candidate) =>
- candidate.type === 'default' &&
- candidate.target === sourceNode.id &&
- candidate.targetHandle === CONNECTOR_INPUT_HANDLE &&
- typeof candidate.sourceHandle === 'string'
- );
- const outputEdges = getConnectorOutputEdges(sourceNode.id, edges);
- if (
- inputEdges.length !== 1 ||
- outputEdges.length !== 1 ||
- (outputEdges[0] !== currentEdge && outputEdges[0]?.id !== currentEdge.id)
- ) {
- return null;
- }
-
- const inputEdge = inputEdges[0];
- if (!inputEdge) {
- return null;
- }
- edgeIds.push(inputEdge.id);
- currentEdge = inputEdge;
- }
-};
-
-const getResolvedLoopLinkagePathForConnector = (
- connectorId: string,
- nodes: AnyNode[],
- edges: AnyEdge[]
-): ResolvedLoopLinkagePath | null => {
- for (const edge of edges) {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD
- ) {
- continue;
- }
-
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- if (path?.connectorNodeIds.includes(connectorId)) {
- return path;
- }
- }
- return null;
-};
-
-/**
- * Finds the serialized connector edges attached to a boundary's loop-linkage alias,
- * including an alias that has not reached its opposite boundary yet.
- */
-export const getLoopLinkageAliasEdgeIdsForBoundary = (
- boundaryNodeId: string,
- nodes: AnyNode[],
- edges: AnyEdge[]
-): Set<string> => {
- const edgeIds = new Set<string>();
- const visitedForwardConnectorIds = new Set<string>();
- const visitedBackwardConnectorIds = new Set<string>();
-
- const visitForward = (connectorId: string): void => {
- if (visitedForwardConnectorIds.has(connectorId)) {
- return;
- }
- visitedForwardConnectorIds.add(connectorId);
- for (const edge of getConnectorOutputEdges(connectorId, edges)) {
- edgeIds.add(edge.id);
- const targetNode = nodes.find((node) => node.id === edge.target);
- if (isConnectorNode(targetNode) && edge.targetHandle === CONNECTOR_INPUT_HANDLE) {
- visitForward(targetNode.id);
- }
- }
- };
-
- const visitBackward = (connectorId: string): void => {
- if (visitedBackwardConnectorIds.has(connectorId)) {
- return;
- }
- visitedBackwardConnectorIds.add(connectorId);
- const inputEdge = getConnectorInputEdge(connectorId, edges);
- if (!inputEdge) {
- return;
- }
- edgeIds.add(inputEdge.id);
- const sourceNode = nodes.find((node) => node.id === inputEdge.source);
- if (isConnectorNode(sourceNode) && inputEdge.sourceHandle === CONNECTOR_OUTPUT_HANDLE) {
- visitBackward(sourceNode.id);
- }
- };
-
- for (const edge of edges) {
- if (edge.type !== 'default') {
- continue;
- }
-
- if (
- edge.source === boundaryNodeId &&
- edge.sourceHandle === LOOP_LINKAGE_FIELD &&
- edge.targetHandle === CONNECTOR_INPUT_HANDLE
- ) {
- const targetNode = nodes.find((node) => node.id === edge.target);
- if (isConnectorNode(targetNode)) {
- edgeIds.add(edge.id);
- visitForward(targetNode.id);
- }
- }
-
- if (
- edge.target === boundaryNodeId &&
- edge.targetHandle === LOOP_LINKAGE_FIELD &&
- edge.sourceHandle === CONNECTOR_OUTPUT_HANDLE
- ) {
- const sourceNode = nodes.find((node) => node.id === edge.source);
- if (isConnectorNode(sourceNode)) {
- edgeIds.add(edge.id);
- visitBackward(sourceNode.id);
- }
- }
- }
-
- return edgeIds;
-};
-
-/**
- * Builds the edge list used only for React Flow rendering. Complete connector
- * aliases are presented as loop-linkage edges so they use the dashed green
- * renderer; the supplied edge list is never mutated.
- */
-export const getEdgesWithLoopLinkageAliases = (nodes: AnyNode[], edges: AnyEdge[]): AnyEdge[] => {
- const loopLinkageEdgeIds = new Set<string>();
- for (const edge of edges) {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- continue;
- }
-
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- path?.edgeIds.forEach((edgeId) => loopLinkageEdgeIds.add(edgeId));
- }
-
- return edges.map((edge) => (loopLinkageEdgeIds.has(edge.id) ? ({ ...edge, type: 'loop_linkage' } as AnyEdge) : edge));
-};
-
-/**
- * Resolves the source to use when removing a connector. Loop-linkage aliases
- * preserve the remaining connector chain; ordinary data connectors keep
- * splicing back to their invocation source.
- */
-const resolveConnectorDeletionSource = (
- connectorId: string,
- nodes: AnyNode[],
- edges: AnyEdge[]
-): ResolvedConnectorSource | null => {
- const resolvedSource = resolveConnectorSource(connectorId, nodes, edges);
- if (!resolvedSource) {
- return null;
- }
-
- const sourceNode = nodes.find((node) => node.id === resolvedSource.nodeId);
- if (
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- resolvedSource.fieldName === LOOP_LINKAGE_FIELD
- ) {
- const outputEdges = getConnectorOutputEdges(connectorId, edges);
- if (
- outputEdges.length !== 1 ||
- outputEdges.some((edge) => {
- const targetNode = nodes.find((node) => node.id === edge.target);
- return !(
- (isConnectorNode(targetNode) && edge.targetHandle === CONNECTOR_INPUT_HANDLE) ||
- (isInvocationNode(targetNode) &&
- targetNode.data.type === 'for_return' &&
- edge.targetHandle === LOOP_LINKAGE_FIELD)
- );
- })
- ) {
- return null;
- }
- }
-
- const linkagePath = getResolvedLoopLinkagePathForConnector(connectorId, nodes, edges);
- const inputEdge = getConnectorInputEdge(connectorId, edges);
- if (linkagePath && inputEdge && typeof inputEdge.sourceHandle === 'string') {
- return {
- nodeId: inputEdge.source,
- fieldName: inputEdge.sourceHandle,
- };
- }
-
- return resolvedSource;
-};
-
-export const resolvePendingConnectionSource = (
- pendingConnection: PendingConnection | null,
- nodes: AnyNode[],
- edges: AnyEdge[],
- templates?: Templates
-): ResolvedPendingConnectionSource | null => {
- if (!pendingConnection || pendingConnection.handleType !== 'source') {
- return null;
- }
-
- const pendingNode = nodes.find((node) => node.id === pendingConnection.nodeId);
- const resolvedSource =
- pendingNode && isConnectorNode(pendingNode)
- ? resolveConnectorSource(pendingNode.id, nodes, edges)
- : isInvocationNode(pendingNode)
- ? { nodeId: pendingNode.id, fieldName: pendingConnection.handleId }
- : null;
- if (!resolvedSource) {
- return null;
- }
-
- const sourceNode = nodes.find((node) => node.id === resolvedSource.nodeId);
- const outputScope =
- sourceNode && isInvocationNode(sourceNode)
- ? (templates?.[sourceNode.data.type]?.outputs[resolvedSource.fieldName]?.output_scope ?? undefined)
- : undefined;
-
- return { ...resolvedSource, outputScope };
-};
-
export const resolveConnectorSourceFieldType = (
connectorId: string,
nodes: AnyNode[],
@@ -484,21 +109,15 @@ export const getConnectorDeletionSpliceConnections = (
connectorId: string,
nodes: AnyNode[],
edges: AnyEdge[],
- templates?: Templates,
- validateConnection?: SpliceConnectionValidator,
- removedConnectorIds: ReadonlySet<string> = new Set()
+ templates: Templates,
+ validateConnection?: SpliceConnectionValidator
): SpliceConnection[] | null => {
- const resolvedSource = resolveSurvivingConnectorDeletionSource(connectorId, nodes, edges, removedConnectorIds);
+ const resolvedSource = resolveConnectorSource(connectorId, nodes, edges);
if (!resolvedSource) {
return null;
}
- const resolvedOutputEdges = getConnectorDeletionOutputEdges(connectorId, nodes, edges, removedConnectorIds);
- if (!resolvedOutputEdges) {
- return null;
- }
- const { edges: outputEdges, traversedEdgeIds } = resolvedOutputEdges;
- const inputEdgeIds = getConnectorDeletionInputEdgeIds(connectorId, nodes, edges, removedConnectorIds);
+ const outputEdges = getConnectorOutputEdges(connectorId, edges);
const spliceConnections = outputEdges
.filter((edge): edge is AnyEdge & { type: 'default'; targetHandle: string } => edge.type === 'default')
.map((edge) => ({
@@ -517,16 +136,13 @@ export const getConnectorDeletionSpliceConnections = (
deduped.add(key);
}
- if (!templates) {
- return validateConnection ? null : spliceConnections;
- }
-
if (!validateConnection) {
const sourceType = resolveConnectorSourceFieldType(connectorId, nodes, edges, templates);
if (!sourceType) {
return null;
}
- const outputEdgeIds = traversedEdgeIds;
+ const inputEdgeId = getConnectorInputEdge(connectorId, edges)?.id;
+ const outputEdgeIds = new Set(outputEdges.map((edge) => edge.id));
for (const connection of spliceConnections) {
const targetNode = nodes.find((node) => node.id === connection.target);
@@ -557,7 +173,7 @@ export const getConnectorDeletionSpliceConnections = (
const existingTargetConflict = edges.some(
(edge) =>
edge.type === 'default' &&
- !inputEdgeIds.has(edge.id) &&
+ edge.id !== inputEdgeId &&
!outputEdgeIds.has(edge.id) &&
edge.target === connection.target &&
edge.targetHandle === connection.targetHandle
@@ -580,7 +196,10 @@ export const getConnectorDeletionSpliceConnections = (
return spliceConnections;
}
- const ignoredEdgeIds = new Set([...inputEdgeIds, ...traversedEdgeIds]);
+ const ignoredEdgeIds = new Set([
+ getConnectorInputEdge(connectorId, edges)?.id,
+ ...outputEdges.map((edge) => edge.id),
+ ]);
const existingEdges = edges.filter((edge) => !ignoredEdgeIds.has(edge.id));
const stagedConnections: SpliceConnection[] = [];
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.test.ts
index 0f7487517a..b4374a920c 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.test.ts
@@ -6,16 +6,7 @@ import {
getSourceCandidateFields,
getTargetCandidateFields,
} from 'features/nodes/store/util/getFirstValidConnection';
-import {
- add,
- buildEdge,
- buildNode,
- for_loop,
- for_return,
- img_resize,
- sub,
- templates,
-} from 'features/nodes/store/util/testUtils';
+import { add, buildEdge, buildNode, img_resize, sub, templates } from 'features/nodes/store/util/testUtils';
import { describe, expect, it } from 'vitest';
const buildConnectorNode = (id: string) => ({
@@ -169,77 +160,6 @@ describe('getFirstValidConnection', () => {
targetHandle: 'width',
});
});
-
- it('should resolve a connector output candidate for a ForReturn linkage input', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const edges = [buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE)];
- const loopTemplates = { ...templates, for: for_loop, for_return };
-
- expect(
- getFirstValidConnection(
- connector.id,
- null,
- returnNode.id,
- 'loop_linkage',
- [forNode, connector, returnNode],
- edges,
- loopTemplates,
- null
- )
- ).toEqual({
- source: connector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- });
- });
-
- it('should auto-wire a For iteration item output to the ForReturn output input', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const loopTemplates = { for: for_loop, for_return };
-
- expect(
- getFirstValidConnection(forNode.id, 'item', returnNode.id, null, [forNode, returnNode], [], loopTemplates, null)
- ).toEqual({
- source: forNode.id,
- sourceHandle: 'item',
- target: returnNode.id,
- targetHandle: 'output',
- });
- });
-
- it('should auto-wire a For state output to the ForReturn state input', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const loopTemplates = { for: for_loop, for_return };
-
- expect(
- getFirstValidConnection(forNode.id, 'state', returnNode.id, null, [forNode, returnNode], [], loopTemplates, null)
- ).toEqual({
- source: forNode.id,
- sourceHandle: 'state',
- target: returnNode.id,
- targetHandle: 'state',
- });
- });
-
- it('should auto-wire the exact For state output to a fixed ForReturn state input', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const loopTemplates = { for: for_loop, for_return };
-
- expect(
- getFirstValidConnection(forNode.id, null, returnNode.id, 'state', [forNode, returnNode], [], loopTemplates, null)
- ).toEqual({
- source: forNode.id,
- sourceHandle: 'state',
- target: returnNode.id,
- targetHandle: 'state',
- });
- });
});
describe('getTargetCandidateFields', () => {
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.ts b/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.ts
index 70b1fd5bef..17b068ad0c 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/getFirstValidConnection.ts
@@ -1,31 +1,16 @@
import type { Connection } from '@xyflow/react';
import { map } from 'es-toolkit/compat';
import type { Templates } from 'features/nodes/store/types';
-import { areTypesEqual } from 'features/nodes/store/util/areTypesEqual';
import {
CONNECTOR_INPUT_HANDLE,
CONNECTOR_OUTPUT_HANDLE,
resolveConnectorSourceFieldType,
} from 'features/nodes/store/util/connectorTopology';
import { validateConnection } from 'features/nodes/store/util/validateConnection';
-import type { FieldInputTemplate, FieldOutputTemplate, FieldType } from 'features/nodes/types/field';
+import type { FieldInputTemplate, FieldOutputTemplate } from 'features/nodes/types/field';
import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
import { getInvocationNodeInputTemplate, isConnectorNode, isInvocationNode } from 'features/nodes/types/invocation';
-const rankCandidateFieldsByType = <T extends FieldInputTemplate | FieldOutputTemplate>(
- fields: T[],
- type: FieldType | null | undefined
-): T[] => {
- if (!type) {
- return fields;
- }
-
- return [
- ...fields.filter((field) => areTypesEqual(type, field.type)),
- ...fields.filter((field) => !areTypesEqual(type, field.type)),
- ];
-};
-
/**
*
* @param source The source (node id)
@@ -142,10 +127,7 @@ export const getTargetCandidateFields = (
return [];
}
- let sourceFieldType: FieldType | null | undefined;
- if (isConnectorNode(sourceNode)) {
- sourceFieldType = resolveConnectorSourceFieldType(sourceNode.id, nodes, edges, templates);
- } else {
+ if (!isConnectorNode(sourceNode)) {
const sourceTemplate = templates[sourceNode.data.type];
if (!sourceTemplate) {
return [];
@@ -156,8 +138,6 @@ export const getTargetCandidateFields = (
if (!sourceField) {
return [];
}
-
- sourceFieldType = sourceField.type;
}
const targetCandidateFields = Object.entries(targetNode.data.inputs).flatMap(([fieldName, input]) => {
@@ -170,7 +150,7 @@ export const getTargetCandidateFields = (
return connectionErrorTKey === null ? [field] : [];
});
- return rankCandidateFieldsByType(targetCandidateFields, sourceFieldType);
+ return targetCandidateFields;
};
export const getSourceCandidateFields = (
@@ -218,7 +198,6 @@ export const getSourceCandidateFields = (
return [];
}
- let targetFieldType: FieldType | undefined;
if (!isConnectorNode(targetNode)) {
if (!isInvocationNode(targetNode)) {
return [];
@@ -233,7 +212,6 @@ export const getSourceCandidateFields = (
if (!targetField) {
return [];
}
- targetFieldType = targetField.type;
} else if (targetHandle !== CONNECTOR_INPUT_HANDLE) {
return [];
}
@@ -244,5 +222,5 @@ export const getSourceCandidateFields = (
return connectionErrorTKey === null;
});
- return rankCandidateFieldsByType(sourceCandidateFields, targetFieldType);
+ return sourceCandidateFields;
};
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/getHasCycles.ts b/invokeai/frontend/web/src/features/nodes/store/util/getHasCycles.ts
index 29b79bb18c..9b0b99e48d 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/getHasCycles.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/getHasCycles.ts
@@ -19,9 +19,7 @@ export const getHasCycles = (source: string, target: string, nodes: Node[], edge
});
edges.forEach((e) => {
- if (e.type === 'default') {
- g.setEdge(e.source, e.target);
- }
+ g.setEdge(e.source, e.target);
});
// add the candidate edge
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.test.ts
index b0856dfab1..b70eda4bda 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.test.ts
@@ -20,22 +20,4 @@ describe('connectionToEdge', () => {
id: 'reactflow__edge-source-nodevalue-target-nodea',
});
});
-
- it('creates a loop linkage edge when both handles are loop linkage handles', () => {
- expect(
- connectionToEdge({
- source: 'for-node',
- sourceHandle: 'loop_linkage',
- target: 'return-node',
- targetHandle: 'loop_linkage',
- })
- ).toEqual({
- type: 'loop_linkage',
- source: 'for-node',
- sourceHandle: 'loop_linkage',
- target: 'return-node',
- targetHandle: 'loop_linkage',
- id: 'reactflow__edge-for-nodeloop_linkage-return-nodeloop_linkage',
- });
- });
});
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.ts b/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.ts
index 451d8ff384..3eaece154f 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/reactFlowUtil.ts
@@ -1,18 +1,7 @@
import type { Connection } from '@xyflow/react';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
import type { AnyEdge } from 'features/nodes/types/invocation';
import { assert } from 'tsafe';
-export const getEdgeTypeFromHandles = (
- sourceHandle: string | null | undefined,
- targetHandle: string | null | undefined
-): 'default' | 'loop_linkage' =>
- sourceHandle === LOOP_LINKAGE_FIELD && targetHandle === LOOP_LINKAGE_FIELD ? 'loop_linkage' : 'default';
-
-export const isLoopLinkageEdge = (edge: Pick<AnyEdge, 'type' | 'sourceHandle' | 'targetHandle'>): boolean =>
- edge.type === 'loop_linkage' ||
- (edge.type === 'default' && getEdgeTypeFromHandles(edge.sourceHandle, edge.targetHandle) === 'loop_linkage');
-
/**
* Gets the edge id for a connection
* Copied from: https://github.com/xyflow/xyflow/blob/v11/packages/core/src/utils/graph.ts#L44-L45
@@ -35,7 +24,7 @@ export const connectionToEdge = (connection: Connection): AnyEdge => {
const { source, sourceHandle, target, targetHandle } = connection;
assert(source && sourceHandle && target && targetHandle, 'Invalid connection');
return {
- type: getEdgeTypeFromHandles(sourceHandle, targetHandle),
+ type: 'default',
source,
sourceHandle,
target,
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/testUtils.ts b/invokeai/frontend/web/src/features/nodes/store/util/testUtils.ts
index 6632e27048..67c477408f 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/testUtils.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/testUtils.ts
@@ -12,15 +12,6 @@ export const buildEdge = (source: string, sourceHandle: string, target: string,
id: `reactflow__edge-${source}${sourceHandle}-${target}${targetHandle}`,
});
-export const buildLoopLinkageEdge = (source: string, target: string): AnyEdge => ({
- source,
- sourceHandle: 'loop_linkage',
- target,
- targetHandle: 'loop_linkage',
- type: 'loop_linkage',
- id: `reactflow__edge-${source}-loop_linkage-${target}-loop_linkage`,
-});
-
export const buildNode = (template: InvocationTemplate) => buildInvocationNode({ x: 0, y: 0 }, template);
export const add: InvocationTemplate = {
@@ -640,251 +631,6 @@ const iterate: InvocationTemplate = {
category: 'collections',
};
-export const for_loop: InvocationTemplate = {
- title: 'For',
- type: 'for',
- version: '1.3.0',
- tags: [],
- description: '',
- outputType: 'for_output',
- inputs: {
- collection: {
- name: 'collection',
- title: 'Collection',
- required: false,
- default: undefined,
- description: 'The list of items to iterate over',
- fieldKind: 'input',
- input: 'connection',
- ui_hidden: false,
- ui_type: 'CollectionField',
- type: {
- name: 'CollectionField',
- cardinality: 'COLLECTION',
- batch: false,
- },
- },
- state: {
- name: 'state',
- title: 'State',
- required: false,
- default: undefined,
- description: 'Optional initial loop state',
- fieldKind: 'input',
- input: 'connection',
- ui_hidden: false,
- type: {
- name: 'LoopState',
- cardinality: 'SINGLE',
- batch: false,
- },
- },
- },
- outputs: {
- loop_linkage: {
- fieldKind: 'output',
- name: 'loop_linkage',
- title: 'Loop Linkage',
- description: 'The loop linkage to the matching ForReturn',
- type: {
- name: 'AnyField',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- ui_type: 'AnyField',
- },
- item: {
- fieldKind: 'output',
- name: 'item',
- title: 'Collection Item',
- description: 'The item for the current loop iteration, or None when the collection is empty',
- type: {
- name: 'CollectionItemField',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- ui_type: 'CollectionItemField',
- output_scope: 'iteration',
- },
- index: {
- fieldKind: 'output',
- name: 'index',
- title: 'Index',
- description: 'The index for the current loop iteration',
- type: {
- name: 'IntegerField',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- output_scope: 'iteration',
- },
- total: {
- fieldKind: 'output',
- name: 'total',
- title: 'Total',
- description: 'The total number of items in the loop collection',
- type: {
- name: 'IntegerField',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- output_scope: 'iteration',
- },
- state: {
- fieldKind: 'output',
- name: 'state',
- title: 'State',
- description: 'The state for the current loop iteration',
- type: {
- name: 'LoopState',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- output_scope: 'iteration',
- },
- output_collection: {
- fieldKind: 'output',
- name: 'output_collection',
- title: 'Output Collection',
- description: 'The collected loop body outputs',
- type: {
- name: 'CollectionField',
- cardinality: 'COLLECTION',
- batch: false,
- },
- ui_hidden: false,
- ui_type: 'CollectionField',
- output_scope: 'final',
- },
- final_state: {
- fieldKind: 'output',
- name: 'final_state',
- title: 'Final State',
- description: 'The final loop state',
- type: {
- name: 'LoopState',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: false,
- output_scope: 'final',
- },
- },
- useCache: true,
- nodePack: 'invokeai',
- classification: 'stable',
- category: 'other',
-};
-
-export const for_return: InvocationTemplate = {
- title: 'ForReturn',
- type: 'for_return',
- version: '1.3.2',
- tags: [],
- description: '',
- outputType: 'for_return_output',
- inputs: {
- loop_linkage: {
- name: 'loop_linkage',
- title: 'Loop Linkage',
- required: false,
- default: undefined,
- description: 'The loop linkage from the matching For',
- fieldKind: 'input',
- input: 'connection',
- ui_hidden: false,
- ui_type: 'AnyField',
- type: {
- name: 'AnyField',
- cardinality: 'SINGLE',
- batch: false,
- },
- },
- output: {
- name: 'output',
- title: 'Output',
- required: false,
- default: undefined,
- description: 'The output item to append to the loop output collection',
- fieldKind: 'input',
- input: 'connection',
- ui_hidden: false,
- ui_type: 'CollectionItemField',
- type: {
- name: 'CollectionItemField',
- cardinality: 'SINGLE',
- batch: false,
- },
- },
- state: {
- name: 'state',
- title: 'State',
- required: false,
- default: undefined,
- description: 'The state to pass to the next loop iteration',
- fieldKind: 'input',
- input: 'connection',
- ui_hidden: false,
- type: {
- name: 'LoopState',
- cardinality: 'SINGLE',
- batch: false,
- },
- },
- continue_condition: {
- name: 'continue_condition',
- title: 'Continue Condition',
- required: false,
- default: true,
- description: 'Whether to schedule the next loop iteration; false finalizes the loop',
- fieldKind: 'input',
- input: 'any',
- ui_hidden: false,
- type: {
- name: 'BooleanField',
- cardinality: 'SINGLE',
- batch: false,
- },
- },
- },
- outputs: {
- output: {
- fieldKind: 'output',
- name: 'output',
- title: 'Output',
- description: 'The output item to append to the loop output collection',
- type: {
- name: 'CollectionItemField',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: true,
- ui_type: 'CollectionItemField',
- },
- state: {
- fieldKind: 'output',
- name: 'state',
- title: 'State',
- description: 'The state to pass to the next loop iteration',
- type: {
- name: 'LoopState',
- cardinality: 'SINGLE',
- batch: false,
- },
- ui_hidden: true,
- },
- },
- useCache: true,
- nodePack: 'invokeai',
- classification: 'stable',
- category: 'other',
-};
-
export const templates: Templates = {
add,
call_saved_workflow,
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.test.ts
index f870084eeb..1eef079443 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.test.ts
@@ -2,7 +2,7 @@ import { deepClone } from 'common/util/deepClone';
import { set } from 'es-toolkit/compat';
import { callSavedWorkflowDynamicFieldsChanged, nodesSliceConfig } from 'features/nodes/store/nodesSlice';
import type { IntegerFieldInputTemplate } from 'features/nodes/types/field';
-import type { AnyEdge, InvocationTemplate } from 'features/nodes/types/invocation';
+import type { InvocationTemplate } from 'features/nodes/types/invocation';
import { describe, expect, it } from 'vitest';
import {
@@ -13,12 +13,9 @@ import {
import {
add,
buildEdge,
- buildLoopLinkageEdge,
buildNode,
call_saved_workflow,
collect,
- for_loop,
- for_return,
img_resize,
main_model_loader,
sub,
@@ -104,18 +101,6 @@ const ifTemplate: InvocationTemplate = {
classification: 'stable',
};
-const buildConnectorNode = (id: string) => ({
- id,
- type: 'connector' as const,
- position: { x: 0, y: 0 },
- data: {
- id,
- type: 'connector' as const,
- label: 'Connector',
- isOpen: true,
- },
-});
-
const floatOutputTemplate: InvocationTemplate = {
title: 'Float Output',
type: 'float_output',
@@ -234,6 +219,18 @@ const workflowReturnTemplate: InvocationTemplate = {
classification: 'beta',
};
+const buildConnectorNode = (id: string) => ({
+ id,
+ type: 'connector' as const,
+ position: { x: 0, y: 0 },
+ data: {
+ id,
+ type: 'connector' as const,
+ label: 'Connector',
+ isOpen: true,
+ },
+});
+
describe(validateConnection.name, () => {
it('should reject invalid connection to self', () => {
const c = { source: 'add', sourceHandle: 'value', target: 'add', targetHandle: 'a' };
@@ -488,595 +485,6 @@ describe(validateConnection.name, () => {
expect(r).toEqual('nodes.fieldTypesMustMatch');
});
- describe('loop linkage', () => {
- it('accepts a For to ForReturn linkage connection', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
-
- expect(
- validateConnection(
- {
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- [forNode, returnNode],
- [],
- templates,
- null
- )
- ).toBeNull();
- });
-
- it('rejects a linkage connection with a non-linkage handle', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
-
- expect(
- validateConnection(
- {
- source: forNode.id,
- sourceHandle: 'item',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- [forNode, returnNode],
- [],
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageInvalid');
- });
-
- it('accepts the For side of a connector linkage alias', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
-
- expect(
- validateConnection(
- {
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: connector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [forNode, connector],
- [],
- templates,
- null
- )
- ).toBeNull();
- });
-
- it('rejects the For side of an alias that would reuse an already-linked ForReturn', () => {
- const forNode = buildNode(for_loop);
- const existingForNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const edges = [
- buildLoopLinkageEdge(existingForNode.id, returnNode.id),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(
- validateConnection(
- {
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: connector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [forNode, existingForNode, connector, returnNode],
- edges,
- { ...templates, for: for_loop, for_return },
- null
- )
- ).toBe('nodes.forLoopLinkageDuplicate');
- });
-
- it('rejects the For side of a connector linkage alias with an occupied connector input', () => {
- const forNode = buildNode(for_loop);
- const sourceNode = buildNode(sub);
- const connector = buildConnectorNode('connector-1');
- const edges = [buildEdge(sourceNode.id, 'value', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- expect(
- validateConnection(
- {
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: connector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [forNode, sourceNode, connector],
- edges,
- { ...templates, for: for_loop },
- null
- )
- ).toBe('nodes.inputMayOnlyHaveOneConnection');
- });
-
- it('accepts the ForReturn side of a complete connector linkage alias', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const edges = [buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- expect(
- validateConnection(
- {
- source: connector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- [forNode, connector, returnNode],
- edges,
- templates,
- null
- )
- ).toBeNull();
- });
-
- it('accepts a connector chain edge between an attached For and ForReturn', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(
- validateConnection(
- {
- source: firstConnector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: secondConnector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [forNode, firstConnector, secondConnector, returnNode],
- edges,
- templates,
- null
- )
- ).toBeNull();
- });
-
- it('accepts a connector deletion splice that preserves a loop linkage chain', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const terminalConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, terminalConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(terminalConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(
- getConnectorDeletionSpliceConnections(
- terminalConnector.id,
- [forNode, firstConnector, terminalConnector, returnNode],
- edges,
- templates,
- validateConnection
- )
- ).toEqual([
- {
- source: firstConnector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- ]);
- });
-
- it('rejects a connector loop linkage chain that creates a cycle', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, firstConnector.id, CONNECTOR_INPUT_HANDLE),
- ];
-
- expect(
- validateConnection(
- {
- source: firstConnector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: secondConnector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [forNode, firstConnector, secondConnector],
- edges,
- { ...templates, for: for_loop },
- null
- )
- ).toBe('nodes.connectionWouldCreateCycle');
- });
-
- it('rejects an unresolved connector linkage alias for an already-owned ForReturn', () => {
- const connector = buildConnectorNode('connector-1');
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const existingForNode = buildNode(for_loop);
- const existingReturnNode = buildNode(for_return);
- const edges = [buildLoopLinkageEdge(existingForNode.id, returnNode.id)];
-
- expect(
- validateConnection(
- {
- source: connector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- [connector, forNode, returnNode, existingForNode, existingReturnNode],
- edges,
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageDuplicate');
- });
-
- it('rejects a connector linkage alias reused by a second ForReturn', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const firstReturnNode = buildNode(for_return);
- const secondReturnNode = buildNode(for_return);
- const edges = [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, firstReturnNode.id, 'loop_linkage'),
- ];
-
- expect(
- validateConnection(
- {
- source: connector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: secondReturnNode.id,
- targetHandle: 'loop_linkage',
- },
- [forNode, connector, firstReturnNode, secondReturnNode],
- edges,
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageInvalid');
- });
-
- it('rejects a connector linkage alias that shares a ForReturn with another alias', () => {
- const firstForNode = buildNode(for_loop);
- const secondForNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const edges = [
- buildEdge(firstForNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ];
-
- expect(
- validateConnection(
- {
- source: secondForNode.id,
- sourceHandle: 'loop_linkage',
- target: secondConnector.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- [firstForNode, secondForNode, firstConnector, secondConnector, returnNode],
- edges,
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageDuplicate');
- });
-
- it('rejects a loop linkage connector reused for ordinary data', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const targetNode = buildNode(sub);
- const edges = [buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE)];
-
- expect(
- validateConnection(
- {
- source: connector.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: targetNode.id,
- targetHandle: 'a',
- },
- [forNode, connector, targetNode],
- edges,
- { ...templates, for: for_loop },
- null
- )
- ).toBe('nodes.forLoopLinkageInvalid');
- });
-
- it('rejects linkage connections that do not join For and ForReturn', () => {
- const sourceNode = buildNode(add);
- const returnNode = buildNode(for_return);
-
- expect(
- validateConnection(
- {
- source: sourceNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- [sourceNode, returnNode],
- [],
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageInvalid');
- });
-
- it('rejects linkage connections that duplicate either endpoint', () => {
- const firstForNode = buildNode(for_loop);
- const secondForNode = buildNode(for_loop);
- const firstReturnNode = buildNode(for_return);
- const secondReturnNode = buildNode(for_return);
- const existingEdge = buildLoopLinkageEdge(firstForNode.id, firstReturnNode.id);
- const nodes = [firstForNode, secondForNode, firstReturnNode, secondReturnNode];
-
- expect(
- validateConnection(
- {
- source: firstForNode.id,
- sourceHandle: 'loop_linkage',
- target: secondReturnNode.id,
- targetHandle: 'loop_linkage',
- },
- nodes,
- [existingEdge],
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageDuplicate');
-
- expect(
- validateConnection(
- {
- source: secondForNode.id,
- sourceHandle: 'loop_linkage',
- target: firstReturnNode.id,
- targetHandle: 'loop_linkage',
- },
- nodes,
- [existingEdge],
- templates,
- null
- )
- ).toBe('nodes.forLoopLinkageDuplicate');
- });
- });
-
- describe('loop output scopes', () => {
- const loopTemplates = { for: for_loop, for_return };
- const loopSinkTemplate: InvocationTemplate = {
- ...for_return,
- title: 'Loop Sink',
- type: 'loop_sink',
- outputType: 'loop_sink_output',
- outputs: {},
- };
-
- it('rejects a final-scoped output connected into an existing iteration body', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const nodes = [forNode, returnNode];
- const edges = [buildEdge(forNode.id, 'item', returnNode.id, 'output')];
- const connection = {
- source: forNode.id,
- sourceHandle: 'final_state',
- target: returnNode.id,
- targetHandle: 'state',
- };
-
- expect(validateConnection(connection, nodes, edges, loopTemplates, null)).toEqual(
- 'nodes.loopOutputScopeConflict'
- );
- });
-
- it('rejects an iteration-scoped output that makes an existing final output part of the body', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const nodes = [forNode, returnNode];
- const edges = [buildEdge(forNode.id, 'final_state', returnNode.id, 'state')];
- const connection = {
- source: forNode.id,
- sourceHandle: 'item',
- target: returnNode.id,
- targetHandle: 'output',
- };
-
- expect(validateConnection(connection, nodes, edges, loopTemplates, null)).toEqual(
- 'nodes.loopOutputScopeConflict'
- );
- });
-
- it('rejects a final-scoped output connected to a descendant of an iteration body node', () => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(ifTemplate);
- const returnNode = buildNode(for_return);
- const nodes = [forNode, bodyNode, returnNode];
- const edges = [
- buildEdge(forNode.id, 'item', bodyNode.id, 'true_input'),
- buildEdge(bodyNode.id, 'value', returnNode.id, 'output'),
- ];
- const connection = {
- source: forNode.id,
- sourceHandle: 'final_state',
- target: returnNode.id,
- targetHandle: 'state',
- };
-
- expect(validateConnection(connection, nodes, edges, { ...loopTemplates, if: ifTemplate }, null)).toEqual(
- 'nodes.loopOutputScopeConflict'
- );
- });
-
- it('rejects a final-scoped output routed into the iteration body through a connector', () => {
- const forNode = buildNode(for_loop);
- const connectorNode = buildConnectorNode('connector');
- const returnNode = buildNode(for_return);
- const nodes = [forNode, connectorNode, returnNode];
- const edges = [
- buildEdge(forNode.id, 'item', returnNode.id, 'output'),
- buildEdge(forNode.id, 'final_state', connectorNode.id, CONNECTOR_INPUT_HANDLE),
- ];
- const connection = {
- source: connectorNode.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'state',
- };
-
- expect(validateConnection(connection, nodes, edges, loopTemplates, null)).toEqual(
- 'nodes.loopOutputScopeConflict'
- );
- });
-
- it('rejects a final-scoped output that reaches the iteration body through downstream nodes', () => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(ifTemplate);
- const downstreamNode = buildNode(ifTemplate);
- const downstreamNode2 = buildNode(ifTemplate);
- const returnNode = buildNode(for_return);
- const nodes = [forNode, bodyNode, downstreamNode, downstreamNode2, returnNode];
- const edges = [
- buildEdge(forNode.id, 'item', bodyNode.id, 'true_input'),
- buildEdge(bodyNode.id, 'value', returnNode.id, 'output'),
- buildEdge(downstreamNode.id, 'value', downstreamNode2.id, 'true_input'),
- buildEdge(downstreamNode2.id, 'value', returnNode.id, 'state'),
- ];
- const connection = {
- source: forNode.id,
- sourceHandle: 'final_state',
- target: downstreamNode.id,
- targetHandle: 'true_input',
- };
-
- expect(validateConnection(connection, nodes, edges, { ...loopTemplates, if: ifTemplate }, null)).toEqual(
- 'nodes.loopOutputScopeConflict'
- );
- });
-
- it('accepts iteration-scoped outputs within the body', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const nodes = [forNode, returnNode];
- const edges = [buildEdge(forNode.id, 'item', returnNode.id, 'output')];
- const connection = {
- source: forNode.id,
- sourceHandle: 'state',
- target: returnNode.id,
- targetHandle: 'state',
- };
-
- expect(validateConnection(connection, nodes, edges, loopTemplates, null)).toBeNull();
- });
-
- it('accepts final-scoped outputs outside the iteration body', () => {
- const forNode = buildNode(for_loop);
- const bodyReturnNode = buildNode(for_return);
- const afterLoopNode = buildNode(for_loop);
- const nodes = [forNode, bodyReturnNode, afterLoopNode];
- const edges = [buildEdge(forNode.id, 'item', bodyReturnNode.id, 'output')];
- const connection = {
- source: forNode.id,
- sourceHandle: 'final_state',
- target: afterLoopNode.id,
- targetHandle: 'state',
- };
-
- expect(validateConnection(connection, nodes, edges, loopTemplates, null)).toBeNull();
- });
-
- it.each([
- ['iteration', 'final', 'extension'],
- ['final', 'iteration', 'extension'],
- ['extension', 'final', 'iteration'],
- ] as const)('rejects scope overlap regardless of incremental edge order: %s, %s, %s', (...order) => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(ifTemplate);
- const afterLoopNode = buildNode(loopSinkTemplate);
- const nodes = [forNode, bodyNode, afterLoopNode];
- const edgeByName = {
- iteration: buildEdge(forNode.id, 'item', bodyNode.id, 'true_input'),
- final: buildEdge(forNode.id, 'final_state', afterLoopNode.id, 'state'),
- extension: buildEdge(bodyNode.id, 'value', afterLoopNode.id, 'output'),
- };
- const templates = {
- ...loopTemplates,
- if: ifTemplate,
- loop_sink: loopSinkTemplate,
- };
- const acceptedEdges: AnyEdge[] = [];
- const results = order.map((name) => {
- const edge = edgeByName[name];
- if (edge.type !== 'default' || !edge.sourceHandle || !edge.targetHandle) {
- throw new Error('Expected a default edge with field handles');
- }
- const result = validateConnection(
- {
- source: edge.source,
- sourceHandle: edge.sourceHandle,
- target: edge.target,
- targetHandle: edge.targetHandle,
- },
- nodes,
- acceptedEdges,
- templates,
- null
- );
- if (result === null) {
- acceptedEdges.push(edge);
- }
- return result;
- });
-
- expect(results).toContain('nodes.loopOutputScopeConflict');
- });
-
- it('allows an unrelated connection when the graph already contains a scope conflict', () => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(ifTemplate);
- const afterLoopNode = buildNode(loopSinkTemplate);
- const addNode = buildNode(add);
- const subNode = buildNode(sub);
- const nodes = [forNode, bodyNode, afterLoopNode, addNode, subNode];
- const edges = [
- buildEdge(forNode.id, 'item', bodyNode.id, 'true_input'),
- buildEdge(forNode.id, 'final_state', afterLoopNode.id, 'state'),
- buildEdge(bodyNode.id, 'value', afterLoopNode.id, 'output'),
- ];
- const templates = {
- ...loopTemplates,
- add,
- sub,
- if: ifTemplate,
- loop_sink: loopSinkTemplate,
- };
- const connection = {
- source: addNode.id,
- sourceHandle: 'value',
- target: subNode.id,
- targetHandle: 'a',
- };
-
- expect(validateConnection(connection, nodes, edges, templates, null)).toBeNull();
- });
- });
-
it('should reject mismatched types between if node branch inputs', () => {
const n1 = buildNode(add);
const n2 = buildNode(img_resize);
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.ts b/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.ts
index 5d2a88fd0b..710e49de7c 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/validateConnection.ts
@@ -5,19 +5,15 @@ import {
CONNECTOR_INPUT_HANDLE,
CONNECTOR_OUTPUT_HANDLE,
resolveConnectorSource,
- resolveLoopLinkagePath,
} from 'features/nodes/store/util/connectorTopology';
import { getCollectItemType } from 'features/nodes/store/util/getCollectItemType';
import { getHasCycles } from 'features/nodes/store/util/getHasCycles';
import { validateConnectionTypes } from 'features/nodes/store/util/validateConnectionTypes';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
import type { FieldType } from 'features/nodes/types/field';
import type { AnyEdge, AnyNode, InvocationNode } from 'features/nodes/types/invocation';
import { getInvocationNodeInputTemplate, isConnectorNode, isInvocationNode } from 'features/nodes/types/invocation';
import type { SetNonNullable } from 'type-fest';
-import { isLoopLinkageEdge } from './reactFlowUtil';
-
type Connection = SetNonNullable<NullableConnection>;
type ValidateConnectionFunc = (
@@ -199,182 +195,6 @@ const getEffectiveSourceForEdge = (
return getEffectiveSource(edge.source, edge.sourceHandle, nodes, edges, templates);
};
-const getOutputScopeConflicts = (nodes: AnyNode[], edges: AnyEdge[], templates: Templates) => {
- const nodeById = new Map(nodes.map((node) => [node.id, node]));
- const connectorInputById = new Map<string, AnyEdge>();
- const scopedOutputByEndpoint = new Map<string, { nodeId: string; scope: 'iteration' | 'final' }>();
-
- for (const node of nodes) {
- if (!isInvocationNode(node)) {
- continue;
- }
- const template = templates[node.data.type];
- if (!template) {
- continue;
- }
- for (const output of Object.values(template.outputs)) {
- if (output.output_scope) {
- scopedOutputByEndpoint.set(`${node.id}\0${output.name}`, {
- nodeId: node.id,
- scope: output.output_scope,
- });
- }
- }
- }
-
- if (scopedOutputByEndpoint.size === 0) {
- return new Set<string>();
- }
-
- for (const edge of edges) {
- if (
- edge.type === 'default' &&
- edge.targetHandle === CONNECTOR_INPUT_HANDLE &&
- !connectorInputById.has(edge.target)
- ) {
- connectorInputById.set(edge.target, edge);
- }
- }
-
- type ScopedOutput = { nodeId: string; scope: 'iteration' | 'final' };
- const scopedOutputCache = new Map<string, ScopedOutput | null>();
- const resolveScopedOutput = (
- sourceId: string,
- sourceHandle: string,
- visited = new Set<string>()
- ): ScopedOutput | null => {
- const endpoint = `${sourceId}\0${sourceHandle}`;
- const cached = scopedOutputCache.get(endpoint);
- if (cached !== undefined) {
- return cached;
- }
-
- const directScopedOutput = scopedOutputByEndpoint.get(endpoint);
- if (directScopedOutput) {
- scopedOutputCache.set(endpoint, directScopedOutput);
- return directScopedOutput;
- }
-
- const sourceNode = nodeById.get(sourceId);
- if (
- !sourceNode ||
- !isConnectorNode(sourceNode) ||
- sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- visited.has(sourceId)
- ) {
- scopedOutputCache.set(endpoint, null);
- return null;
- }
-
- visited.add(sourceId);
- const connectorInput = connectorInputById.get(sourceId);
- if (connectorInput?.type !== 'default' || typeof connectorInput.sourceHandle !== 'string') {
- scopedOutputCache.set(endpoint, null);
- return null;
- }
-
- const scopedOutput = resolveScopedOutput(connectorInput.source, connectorInput.sourceHandle, visited);
- scopedOutputCache.set(endpoint, scopedOutput);
- return scopedOutput;
- };
-
- const targetsByScopeByNode = new Map<string, { iterationTargets: Set<string>; finalTargets: Set<string> }>();
- const targetsBySource = new Map<string, Set<string>>();
- for (const edge of edges) {
- if (edge.type !== 'default' || typeof edge.sourceHandle !== 'string') {
- continue;
- }
-
- const targets = targetsBySource.get(edge.source) ?? new Set<string>();
- targets.add(edge.target);
- targetsBySource.set(edge.source, targets);
-
- const scopedOutput = resolveScopedOutput(edge.source, edge.sourceHandle);
- if (!scopedOutput) {
- continue;
- }
- const targetsByScope = targetsByScopeByNode.get(scopedOutput.nodeId) ?? {
- iterationTargets: new Set<string>(),
- finalTargets: new Set<string>(),
- };
- if (scopedOutput.scope === 'iteration') {
- targetsByScope.iterationTargets.add(edge.target);
- } else {
- targetsByScope.finalTargets.add(edge.target);
- }
- targetsByScopeByNode.set(scopedOutput.nodeId, targetsByScope);
- }
-
- const conflicts = new Set<string>();
- for (const [nodeId, { iterationTargets, finalTargets }] of targetsByScopeByNode) {
- const reachableBodyNodes = new Set(iterationTargets);
- const pendingBodyNodes = [...iterationTargets];
- while (pendingBodyNodes.length > 0) {
- const currentNodeId = pendingBodyNodes.pop();
- if (!currentNodeId) {
- continue;
- }
-
- for (const targetNodeId of targetsBySource.get(currentNodeId) ?? []) {
- if (reachableBodyNodes.has(targetNodeId)) {
- continue;
- }
- reachableBodyNodes.add(targetNodeId);
- pendingBodyNodes.push(targetNodeId);
- }
- }
-
- const reachableFinalNodes = new Set(finalTargets);
- const pendingFinalNodes = [...finalTargets];
- while (pendingFinalNodes.length > 0) {
- const currentNodeId = pendingFinalNodes.pop();
- if (!currentNodeId) {
- continue;
- }
-
- for (const targetNodeId of targetsBySource.get(currentNodeId) ?? []) {
- if (reachableFinalNodes.has(targetNodeId)) {
- continue;
- }
- reachableFinalNodes.add(targetNodeId);
- pendingFinalNodes.push(targetNodeId);
- }
- }
-
- for (const targetId of reachableFinalNodes) {
- if (reachableBodyNodes.has(targetId)) {
- conflicts.add(`${nodeId}\0${targetId}`);
- }
- }
- }
-
- return conflicts;
-};
-
-const hasOutputScopeConflict = (connection: Connection, nodes: AnyNode[], edges: AnyEdge[], templates: Templates) => {
- const existingConflicts = getOutputScopeConflicts(nodes, edges, templates);
- const candidateEdge: AnyEdge = {
- ...connection,
- id: '__candidate_connection__',
- type: 'default',
- };
- const stagedConflicts = getOutputScopeConflicts(nodes, [...edges, candidateEdge], templates);
- return [...stagedConflicts].some((conflict) => !existingConflicts.has(conflict));
-};
-
-const getResolvedLoopLinkages = (nodes: AnyNode[], edges: AnyEdge[]) =>
- edges.flatMap((edge) => {
- if (
- edge.type !== 'default' ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- return [];
- }
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- return path ? [path] : [];
- });
-
/**
* Validates a connection between two fields
* @returns A translation key for an error if the connection is invalid, otherwise null
@@ -387,204 +207,6 @@ export const validateConnection: ValidateConnectionFunc = (
ignoreEdge,
strict = true
): string | null => {
- const sourceNode = nodes.find((node) => node.id === c.source);
- const targetNode = nodes.find((node) => node.id === c.target);
- const filteredEdges = edges.filter((edge) => edge.id !== ignoreEdge?.id);
- const resolvedConnectorSource =
- sourceNode && isConnectorNode(sourceNode) && c.sourceHandle === CONNECTOR_OUTPUT_HANDLE
- ? resolveConnectorSource(sourceNode.id, nodes, filteredEdges)
- : null;
- const hasConnectorLoopLinkage =
- c.sourceHandle === CONNECTOR_OUTPUT_HANDLE &&
- c.targetHandle === CONNECTOR_INPUT_HANDLE &&
- isConnectorNode(sourceNode) &&
- isConnectorNode(targetNode) &&
- resolvedConnectorSource?.fieldName === LOOP_LINKAGE_FIELD;
- const hasLoopLinkageHandle =
- c.sourceHandle === LOOP_LINKAGE_FIELD || c.targetHandle === LOOP_LINKAGE_FIELD || hasConnectorLoopLinkage;
- if (hasLoopLinkageHandle) {
- if (!sourceNode || !targetNode) {
- return 'nodes.missingNode';
- }
-
- if (
- c.sourceHandle === LOOP_LINKAGE_FIELD &&
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- isConnectorNode(targetNode) &&
- c.targetHandle === CONNECTOR_INPUT_HANDLE
- ) {
- if (
- filteredEdges.some(
- (edge) =>
- edge.type === 'default' && edge.target === targetNode.id && edge.targetHandle === CONNECTOR_INPUT_HANDLE
- )
- ) {
- return 'nodes.inputMayOnlyHaveOneConnection';
- }
- if (
- filteredEdges.some(
- (edge) =>
- edge.source === c.source &&
- ((edge.type === 'loop_linkage' && edge.sourceHandle === LOOP_LINKAGE_FIELD) ||
- (edge.type === 'default' && edge.sourceHandle === LOOP_LINKAGE_FIELD))
- )
- ) {
- return 'nodes.forLoopLinkageDuplicate';
- }
-
- const candidateEdge = { ...c, id: '__candidate_loop_linkage__', type: 'default' } satisfies AnyEdge;
- const stagedEdges = [...filteredEdges, candidateEdge];
- if (getHasCycles(c.source, c.target, nodes, stagedEdges)) {
- return 'nodes.connectionWouldCreateCycle';
- }
- const terminalTargetEdges = getConnectorTerminalTargetEdges(targetNode.id, nodes, stagedEdges);
- for (const terminalTargetEdge of terminalTargetEdges) {
- const terminalNode = nodes.find((node) => node.id === terminalTargetEdge.target);
- if (
- !terminalNode ||
- !isInvocationNode(terminalNode) ||
- terminalNode.data.type !== 'for_return' ||
- terminalTargetEdge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !resolveLoopLinkagePath(terminalTargetEdge, nodes, stagedEdges)
- ) {
- return 'nodes.forLoopLinkageInvalid';
- }
- }
-
- const candidatePaths = getResolvedLoopLinkages(nodes, stagedEdges).filter((path) =>
- path.edgeIds.includes(candidateEdge.id)
- );
- if (candidatePaths.length > 1) {
- return 'nodes.forLoopLinkageInvalid';
- }
- const candidatePath = candidatePaths[0];
- if (
- candidatePath &&
- (filteredEdges.some(
- (edge) =>
- isLoopLinkageEdge(edge) &&
- (edge.source === candidatePath.forNodeId || edge.target === candidatePath.returnNodeId)
- ) ||
- getResolvedLoopLinkages(nodes, filteredEdges).some(
- (existingPath) =>
- existingPath.forNodeId === candidatePath.forNodeId ||
- existingPath.returnNodeId === candidatePath.returnNodeId
- ))
- ) {
- return 'nodes.forLoopLinkageDuplicate';
- }
- return null;
- }
-
- if (hasConnectorLoopLinkage) {
- if (filteredEdges.some(getTargetEqualityPredicate(c))) {
- return 'nodes.inputMayOnlyHaveOneConnection';
- }
-
- const candidateEdge = { ...c, id: '__candidate_loop_linkage__', type: 'default' } satisfies AnyEdge;
- const stagedEdges = [...filteredEdges, candidateEdge];
- if (getHasCycles(c.source, c.target, nodes, stagedEdges)) {
- return 'nodes.connectionWouldCreateCycle';
- }
- const terminalTargetEdges = getConnectorTerminalTargetEdges(targetNode.id, nodes, stagedEdges);
- for (const terminalTargetEdge of terminalTargetEdges) {
- const terminalNode = nodes.find((node) => node.id === terminalTargetEdge.target);
- if (
- !terminalNode ||
- !isInvocationNode(terminalNode) ||
- terminalNode.data.type !== 'for_return' ||
- terminalTargetEdge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !resolveLoopLinkagePath(terminalTargetEdge, nodes, stagedEdges)
- ) {
- return 'nodes.forLoopLinkageInvalid';
- }
- }
-
- const candidatePaths = getResolvedLoopLinkages(nodes, stagedEdges).filter((path) =>
- path.edgeIds.includes(candidateEdge.id)
- );
- if (candidatePaths.length > 1) {
- return 'nodes.forLoopLinkageInvalid';
- }
-
- const candidatePath = candidatePaths[0];
- if (
- candidatePath &&
- (filteredEdges.some(
- (edge) =>
- isLoopLinkageEdge(edge) &&
- (edge.source === candidatePath.forNodeId || edge.target === candidatePath.returnNodeId)
- ) ||
- getResolvedLoopLinkages(nodes, filteredEdges).some(
- (existingPath) =>
- existingPath.forNodeId === candidatePath.forNodeId ||
- existingPath.returnNodeId === candidatePath.returnNodeId
- ))
- ) {
- return 'nodes.forLoopLinkageDuplicate';
- }
- return null;
- }
-
- if (
- isConnectorNode(sourceNode) &&
- sourceNode &&
- c.sourceHandle === CONNECTOR_OUTPUT_HANDLE &&
- isInvocationNode(targetNode) &&
- targetNode.data.type === 'for_return' &&
- c.targetHandle === LOOP_LINKAGE_FIELD
- ) {
- if (
- filteredEdges.some((edge) => isLoopLinkageEdge(edge) && edge.target === targetNode.id) ||
- getResolvedLoopLinkages(nodes, filteredEdges).some((path) => path.returnNodeId === targetNode.id)
- ) {
- return 'nodes.forLoopLinkageDuplicate';
- }
- const resolvedSource = resolveConnectorSource(sourceNode.id, nodes, filteredEdges);
- if (resolvedSource && resolvedSource.fieldName !== LOOP_LINKAGE_FIELD) {
- return 'nodes.forLoopLinkageInvalid';
- }
-
- const candidateEdge = { ...c, id: '__candidate_loop_linkage__', type: 'default' } satisfies AnyEdge;
- const stagedEdges = [...filteredEdges, candidateEdge];
- const path = resolveLoopLinkagePath(candidateEdge, nodes, stagedEdges);
- if (!path) {
- // A connector can be wired to ForReturn before its upstream source is attached.
- return resolvedSource ? 'nodes.forLoopLinkageInvalid' : null;
- }
-
- const hasDuplicateLinkage = filteredEdges.some(
- (edge) => isLoopLinkageEdge(edge) && (edge.source === path.forNodeId || edge.target === path.returnNodeId)
- );
- const hasDuplicateConnectorPath = getResolvedLoopLinkages(nodes, filteredEdges).some(
- (existingPath) => existingPath.forNodeId === path.forNodeId || existingPath.returnNodeId === path.returnNodeId
- );
- if (hasDuplicateLinkage || hasDuplicateConnectorPath) {
- return 'nodes.forLoopLinkageDuplicate';
- }
- return null;
- }
-
- if (
- c.sourceHandle === LOOP_LINKAGE_FIELD &&
- c.targetHandle === LOOP_LINKAGE_FIELD &&
- isInvocationNode(sourceNode) &&
- sourceNode.data.type === 'for' &&
- isInvocationNode(targetNode) &&
- targetNode.data.type === 'for_return'
- ) {
- if (
- filteredEdges.some((edge) => isLoopLinkageEdge(edge) && (edge.source === c.source || edge.target === c.target))
- ) {
- return 'nodes.forLoopLinkageDuplicate';
- }
- return null;
- }
-
- return 'nodes.forLoopLinkageInvalid';
- }
-
if (c.source === c.target) {
return 'nodes.cannotConnectToSelf';
}
@@ -713,14 +335,6 @@ export const validateConnection: ValidateConnectionFunc = (
const { node: resolvedSourceNode, handle: sourceHandle, fieldTemplate: sourceFieldTemplate } = effectiveSource;
- if (sourceHandle === LOOP_LINKAGE_FIELD) {
- return 'nodes.forLoopLinkageInvalid';
- }
-
- if (hasOutputScopeConflict(c, nodes, filteredEdges, templates)) {
- return 'nodes.loopOutputScopeConflict';
- }
-
if (targetNode.data.type === 'collect' && c.targetHandle === 'item') {
// Collect nodes shouldn't mix and match field types.
const collectItemType = getCollectItemType(templates, nodes, filteredEdges, targetNode.id);
diff --git a/invokeai/frontend/web/src/features/nodes/store/util/validateConnectionTypes.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/validateConnectionTypes.test.ts
index 2bb7ca05f2..fc9ce27cb9 100644
--- a/invokeai/frontend/web/src/features/nodes/store/util/validateConnectionTypes.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/store/util/validateConnectionTypes.test.ts
@@ -109,24 +109,6 @@ describe(validateConnectionTypes.name, () => {
});
});
- describe('LoopState', () => {
- it('should accept LoopState connections', () => {
- const r = validateConnectionTypes(
- { name: 'LoopState', cardinality: 'SINGLE', batch: false },
- { name: 'LoopState', cardinality: 'SINGLE', batch: false }
- );
- expect(r).toBe(true);
- });
-
- it('should reject LoopState connections to other field types', () => {
- const r = validateConnectionTypes(
- { name: 'LoopState', cardinality: 'SINGLE', batch: false },
- { name: 'IntegerField', cardinality: 'SINGLE', batch: false }
- );
- expect(r).toBe(false);
- });
- });
-
describe('SINGLE_OR_COLLECTION', () => {
it('should accept any SINGLE of same type to SINGLE_OR_COLLECTION', () => {
const r = validateConnectionTypes(
diff --git a/invokeai/frontend/web/src/features/nodes/types/constants.ts b/invokeai/frontend/web/src/features/nodes/types/constants.ts
index ebda317daf..7f8b8891f4 100644
--- a/invokeai/frontend/web/src/features/nodes/types/constants.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/constants.ts
@@ -5,9 +5,6 @@ import type { AnyNode } from 'features/nodes/types/invocation';
*/
export const HANDLE_TOOLTIP_OPEN_DELAY = 500;
-/** The non-executable association between a For and its matching ForReturn. */
-export const LOOP_LINKAGE_FIELD = 'loop_linkage';
-
/**
* The width of a node in the UI in pixels.
*/
diff --git a/invokeai/frontend/web/src/features/nodes/types/field.ts b/invokeai/frontend/web/src/features/nodes/types/field.ts
index ca81335f7d..abcba64496 100644
--- a/invokeai/frontend/web/src/features/nodes/types/field.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/field.ts
@@ -52,7 +52,6 @@ import {
// #region Base schemas & misc
const zFieldInput = z.enum(['connection', 'direct', 'any']);
-const zFieldOutputScope = z.enum(['iteration', 'final']);
const zFieldUIComponent = z.enum(['none', 'textarea', 'slider', 'video-frame-index']);
const zFieldInputInstanceBase = z.object({
name: z.string().trim().min(1),
@@ -82,7 +81,6 @@ const zFieldInputTemplateBase = zFieldTemplateBase.extend({
});
const zFieldOutputTemplateBase = zFieldTemplateBase.extend({
fieldKind: z.literal('output'),
- output_scope: zFieldOutputScope.nullish(),
});
const SINGLE = 'SINGLE' as const;
diff --git a/invokeai/frontend/web/src/features/nodes/types/invocation.ts b/invokeai/frontend/web/src/features/nodes/types/invocation.ts
index 05d6b45ed7..4013e2518c 100644
--- a/invokeai/frontend/web/src/features/nodes/types/invocation.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/invocation.ts
@@ -161,14 +161,6 @@ const zDefaultInvocationNodeEdge = z.custom<Edge<Record<string, never>, 'default
);
export type DefaultInvocationNodeEdge = z.infer<typeof zDefaultInvocationNodeEdge>;
-const zLoopLinkageInvocationNodeEdgeValidationSchema = z.looseObject({
- type: z.literal('loop_linkage'),
-});
-const zLoopLinkageInvocationNodeEdge = z.custom<Edge<Record<string, never>, 'loop_linkage'>>(
- (val) => zLoopLinkageInvocationNodeEdgeValidationSchema.safeParse(val).success
-);
-export type LoopLinkageInvocationNodeEdge = z.infer<typeof zLoopLinkageInvocationNodeEdge>;
-
const zInvocationNodeEdgeCollapsedData = z.object({
count: z.number().int().min(1),
});
@@ -182,11 +174,7 @@ const zCollapsedInvocationNodeEdge = z.custom<Edge<InvocationNodeEdgeCollapsedDa
(val) => zInvocationNodeEdgeCollapsedValidationSchema.safeParse(val).success
);
export type CollapsedInvocationNodeEdge = z.infer<typeof zCollapsedInvocationNodeEdge>;
-export const zAnyEdge = z.union([
- zDefaultInvocationNodeEdge,
- zLoopLinkageInvocationNodeEdge,
- zCollapsedInvocationNodeEdge,
-]);
+export const zAnyEdge = z.union([zDefaultInvocationNodeEdge, zCollapsedInvocationNodeEdge]);
export type AnyEdge = z.infer<typeof zAnyEdge>;
// #endregion
diff --git a/invokeai/frontend/web/src/features/nodes/types/openapi.ts b/invokeai/frontend/web/src/features/nodes/types/openapi.ts
index a77b13a0b6..5945f44ac1 100644
--- a/invokeai/frontend/web/src/features/nodes/types/openapi.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/openapi.ts
@@ -39,9 +39,7 @@ type InvocationOutputSchemaObject = Omit<OpenAPIV3_1.SchemaObject, 'properties'>
};
};
-export type InvocationInputFieldSchema = OpenAPIV3_1.SchemaObject & InputFieldJSONSchemaExtra;
-export type InvocationOutputFieldSchema = OpenAPIV3_1.SchemaObject & OutputFieldJSONSchemaExtra;
-export type InvocationFieldSchema = InvocationInputFieldSchema | InvocationOutputFieldSchema;
+export type InvocationFieldSchema = OpenAPIV3_1.SchemaObject & InputFieldJSONSchemaExtra;
export type OpenAPIV3_1SchemaOrRef = OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject;
@@ -79,11 +77,6 @@ export const isInvocationOutputSchemaObject = (
obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject | InvocationOutputSchemaObject
): obj is InvocationOutputSchemaObject => 'class' in obj && obj.class === 'output';
-export const isInvocationInputFieldSchema = (
+export const isInvocationFieldSchema = (
obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject
-): obj is InvocationInputFieldSchema =>
- 'field_kind' in obj && ['input', 'internal', 'node_attribute'].includes(String(obj.field_kind));
-
-export const isInvocationOutputFieldSchema = (
- obj: OpenAPIV3_1.ReferenceObject | OpenAPIV3_1.SchemaObject
-): obj is InvocationOutputFieldSchema => 'field_kind' in obj && obj.field_kind === 'output';
+): obj is InvocationFieldSchema => 'field_kind' in obj;
diff --git a/invokeai/frontend/web/src/features/nodes/types/workflow.ts b/invokeai/frontend/web/src/features/nodes/types/workflow.ts
index 0b47b19b04..bfb7b92b18 100644
--- a/invokeai/frontend/web/src/features/nodes/types/workflow.ts
+++ b/invokeai/frontend/web/src/features/nodes/types/workflow.ts
@@ -57,15 +57,10 @@ const zWorkflowEdgeDefault = zWorkflowEdgeBase.extend({
targetHandle: z.string().trim().min(1),
hidden: z.boolean().optional(),
});
-const zWorkflowEdgeLoopLinkage = zWorkflowEdgeBase.extend({
- type: z.literal('loop_linkage'),
- sourceHandle: z.string().trim().min(1),
- targetHandle: z.string().trim().min(1),
-});
const zWorkflowEdgeCollapsed = zWorkflowEdgeBase.extend({
type: z.literal('collapsed'),
});
-const zWorkflowEdge = z.union([zWorkflowEdgeDefault, zWorkflowEdgeLoopLinkage, zWorkflowEdgeCollapsed]);
+const zWorkflowEdge = z.union([zWorkflowEdgeDefault, zWorkflowEdgeCollapsed]);
// #endregion
// #region Workflow Builder
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.test.ts b/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.test.ts
index 1c92f04b30..ea772a16bf 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.test.ts
@@ -1,17 +1,7 @@
import { deepClone } from 'common/util/deepClone';
import { callSavedWorkflowDynamicFieldsChanged, nodesSliceConfig } from 'features/nodes/store/nodesSlice';
import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from 'features/nodes/store/util/connectorTopology';
-import {
- add,
- buildEdge,
- buildLoopLinkageEdge,
- buildNode,
- for_loop,
- for_return,
- img_resize,
- sub,
- templates,
-} from 'features/nodes/store/util/testUtils';
+import { add, buildEdge, buildNode, img_resize, sub, templates } from 'features/nodes/store/util/testUtils';
import type { IntegerFieldInputTemplate } from 'features/nodes/types/field';
import { zInvocationNodeData } from 'features/nodes/types/invocation';
import { describe, expect, it } from 'vitest';
@@ -83,188 +73,6 @@ const buildState = (nodes: unknown[], edges: unknown[]) =>
}) as unknown as Parameters<typeof buildNodesGraph>[0];
describe('buildNodesGraph', () => {
- it('rejects an invalid For loop before queue submission', () => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(add);
- const state = buildState([forNode, bodyNode], [buildEdge(forNode.id, 'item', bodyNode.id, 'a')]);
-
- expect(() => buildNodesGraph(state, { ...templates, for: for_loop })).toThrow('nodes.forLoopLinkageMissing');
- });
-
- it('preserves the explicit loop linkage in a simple For graph', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const state = buildState(
- [forNode, returnNode],
- [buildEdge(forNode.id, 'item', returnNode.id, 'output'), buildLoopLinkageEdge(forNode.id, returnNode.id)]
- );
-
- const graph = buildNodesGraph(state, { ...templates, for: for_loop, for_return });
-
- expect(graph.edges).toEqual([
- expect.objectContaining({
- type: 'default',
- source: { node_id: forNode.id, field: 'item' },
- destination: { node_id: returnNode.id, field: 'output' },
- }),
- expect.objectContaining({
- type: 'loop_linkage',
- source: { node_id: forNode.id, field: 'loop_linkage' },
- destination: { node_id: returnNode.id, field: 'loop_linkage' },
- }),
- ]);
- });
-
- it('canonicalizes connector loop linkage into one direct execution edge', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const returnNode = buildNode(for_return);
- const state = buildState(
- [forNode, connector, returnNode],
- [
- buildEdge(forNode.id, 'item', returnNode.id, 'output'),
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ]
- );
-
- const graph = buildNodesGraph(state, { ...templates, for: for_loop, for_return });
-
- expect(graph.edges).toEqual([
- expect.objectContaining({
- type: 'default',
- source: { node_id: forNode.id, field: 'item' },
- destination: { node_id: returnNode.id, field: 'output' },
- }),
- expect.objectContaining({
- type: 'loop_linkage',
- source: { node_id: forNode.id, field: 'loop_linkage' },
- destination: { node_id: returnNode.id, field: 'loop_linkage' },
- }),
- ]);
- });
-
- it('canonicalizes a chained connector loop linkage into one direct execution edge', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const state = buildState(
- [forNode, firstConnector, secondConnector, returnNode],
- [
- buildEdge(forNode.id, 'item', returnNode.id, 'output'),
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, secondConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ]
- );
-
- const graph = buildNodesGraph(state, { ...templates, for: for_loop, for_return });
-
- expect(graph.edges).toContainEqual(
- expect.objectContaining({
- type: 'loop_linkage',
- source: { node_id: forNode.id, field: 'loop_linkage' },
- destination: { node_id: returnNode.id, field: 'loop_linkage' },
- })
- );
- expect(graph.edges).toHaveLength(2);
- });
-
- it('rejects a connector loop linkage that branches to multiple ForReturns', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const firstReturnNode = buildNode(for_return);
- const secondReturnNode = buildNode(for_return);
- const state = buildState(
- [forNode, connector, firstReturnNode, secondReturnNode],
- [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, firstReturnNode.id, 'loop_linkage'),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, secondReturnNode.id, 'loop_linkage'),
- ]
- );
-
- expect(() => buildNodesGraph(state, { ...templates, for: for_loop, for_return })).toThrow(
- 'nodes.forLoopLinkageInvalid'
- );
- });
-
- it('rejects a loop linkage connector reused for ordinary data before a ForReturn is attached', () => {
- const forNode = buildNode(for_loop);
- const connector = buildConnectorNode('connector-1');
- const targetNode = buildNode(sub);
- const state = buildState(
- [forNode, connector, targetNode],
- [
- buildEdge(forNode.id, 'loop_linkage', connector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(connector.id, CONNECTOR_OUTPUT_HANDLE, targetNode.id, 'a'),
- ]
- );
-
- expect(() => buildNodesGraph(state, { ...templates, for: for_loop })).toThrow('nodes.forLoopLinkageInvalid');
- });
-
- it('rejects connector loop linkages that share a ForReturn', () => {
- const forNode = buildNode(for_loop);
- const firstConnector = buildConnectorNode('connector-1');
- const secondConnector = buildConnectorNode('connector-2');
- const returnNode = buildNode(for_return);
- const state = buildState(
- [forNode, firstConnector, secondConnector, returnNode],
- [
- buildEdge(forNode.id, 'loop_linkage', firstConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(firstConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- buildEdge(forNode.id, 'loop_linkage', secondConnector.id, CONNECTOR_INPUT_HANDLE),
- buildEdge(secondConnector.id, CONNECTOR_OUTPUT_HANDLE, returnNode.id, 'loop_linkage'),
- ]
- );
-
- expect(() => buildNodesGraph(state, { ...templates, for: for_loop, for_return })).toThrow(
- 'nodes.forLoopLinkageDuplicate'
- );
- });
-
- it('normalizes loop linkage handles when an edge is missing its linkage type', () => {
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
- const state = buildState(
- [forNode, returnNode],
- [
- buildEdge(forNode.id, 'item', returnNode.id, 'output'),
- buildEdge(forNode.id, 'loop_linkage', returnNode.id, 'loop_linkage'),
- ]
- );
-
- const graph = buildNodesGraph(state, { ...templates, for: for_loop, for_return });
-
- expect(graph.edges).toEqual([
- expect.objectContaining({
- type: 'default',
- source: { node_id: forNode.id, field: 'item' },
- destination: { node_id: returnNode.id, field: 'output' },
- }),
- expect.objectContaining({
- type: 'loop_linkage',
- source: { node_id: forNode.id, field: 'loop_linkage' },
- destination: { node_id: returnNode.id, field: 'loop_linkage' },
- }),
- ]);
- });
-
- it('continues to omit collapsed edges while normalizing linkage edges', () => {
- const sourceNode = buildNode(add);
- const targetNode = buildNode(add);
- const state = buildState(
- [sourceNode, targetNode],
- [{ ...buildEdge(sourceNode.id, 'value', targetNode.id, 'a'), type: 'collapsed', data: { count: 1 } }]
- );
-
- const graph = buildNodesGraph(state, templates);
-
- expect(graph.edges).toEqual([]);
- });
-
it('serializes dynamic saved workflow inputs into workflow_inputs', () => {
const state = nodesSliceConfig.getInitialState();
const node = buildNode(callSavedWorkflowTemplate);
@@ -353,7 +161,6 @@ describe('buildNodesGraph', () => {
workflow_inputs: {},
});
expect(graph.edges).toContainEqual({
- type: 'default',
source: { node_id: sourceNode.id, field: 'value' },
destination: { node_id: callNode.id, field: 'saved_workflow_input::node-1::a' },
});
@@ -416,7 +223,6 @@ describe('buildNodesGraph', () => {
expect(graph.nodes).not.toHaveProperty(connector.id);
expect(graph.edges).toEqual([
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: target.id, field: 'a' },
},
@@ -441,7 +247,6 @@ describe('buildNodesGraph', () => {
expect(graph.edges).toEqual([
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: target.id, field: 'a' },
},
@@ -466,12 +271,10 @@ describe('buildNodesGraph', () => {
expect(graph.edges).toEqual([
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: targetA.id, field: 'a' },
},
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: targetB.id, field: 'width' },
},
@@ -506,7 +309,6 @@ describe('buildNodesGraph', () => {
expect(graph.edges).toEqual([
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: target.id, field: 'a' },
},
@@ -535,7 +337,6 @@ describe('buildNodesGraph', () => {
expect(graph.edges).toEqual([
{
- type: 'default',
source: { node_id: source.id, field: 'value' },
destination: { node_id: target.id, field: 'a' },
},
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.ts
index dde7ad8099..47e4d779c2 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/buildNodesGraph.ts
@@ -4,15 +4,8 @@ import { omit, reduce } from 'es-toolkit/compat';
import { selectAutoAddBoardId } from 'features/gallery/store/gallerySelectors';
import { selectNodesSlice } from 'features/nodes/store/selectors';
import type { Templates } from 'features/nodes/store/types';
-import {
- CONNECTOR_INPUT_HANDLE,
- CONNECTOR_OUTPUT_HANDLE,
- resolveConnectorSource,
- resolveLoopLinkagePath,
-} from 'features/nodes/store/util/connectorTopology';
-import { isLoopLinkageEdge } from 'features/nodes/store/util/reactFlowUtil';
+import { resolveConnectorSource } from 'features/nodes/store/util/connectorTopology';
import type { BoardField } from 'features/nodes/types/common';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
import { nodeAcceptsExtraInputs } from 'features/nodes/types/extraInputs';
import type { BoardFieldInputInstance } from 'features/nodes/types/field';
import { isBoardFieldInputInstance, isBoardFieldInputTemplate } from 'features/nodes/types/field';
@@ -22,8 +15,6 @@ import {
isExecutableNode,
isInvocationNode,
} from 'features/nodes/types/invocation';
-import { validateForLoopGraph } from 'features/nodes/util/graph/validateForLoopGraph';
-import { t } from 'i18next';
import type { AnyInvocation, Graph } from 'services/api/types';
import { v4 as uuidv4 } from 'uuid';
@@ -97,7 +88,6 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
}
return inputsAccumulator;
}
-
if (isBoardFieldInputTemplate(fieldTemplate) && isBoardFieldInputInstance(input)) {
inputsAccumulator[name] = getBoardField(input, state);
} else {
@@ -134,57 +124,9 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
const filteredNodeIds = filteredNodes.map(({ id }) => id);
- for (const edge of edges) {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- continue;
- }
-
- const resolvedSource = resolveConnectorSource(edge.source, nodes, edges);
- if (!resolvedSource || resolvedSource.fieldName !== LOOP_LINKAGE_FIELD) {
- continue;
- }
-
- const targetNode = nodes.find((node) => node.id === edge.target);
- if (isConnectorNode(targetNode) && edge.targetHandle === CONNECTOR_INPUT_HANDLE) {
- continue;
- }
- if (
- isInvocationNode(targetNode) &&
- targetNode.data.type === 'for_return' &&
- edge.targetHandle === LOOP_LINKAGE_FIELD
- ) {
- continue;
- }
- throw new Error(t('nodes.forLoopLinkageInvalid') || 'nodes.forLoopLinkageInvalid');
- }
-
- const connectorLoopLinkagePaths = edges.flatMap((edge) => {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- return [];
- }
-
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- if (!path) {
- throw new Error(t('nodes.forLoopLinkageInvalid') || 'nodes.forLoopLinkageInvalid');
- }
- return [path];
- });
- const connectorLoopLinkageEdgeIds = new Set(connectorLoopLinkagePaths.flatMap((path) => path.edgeIds));
-
// skip out the "dummy" edges between collapsed nodes
const flattenedEdges = edges
- .filter(
- (edge) => edge.type !== 'collapsed' && !isLoopLinkageEdge(edge) && !connectorLoopLinkageEdgeIds.has(edge.id)
- )
+ .filter((edge) => edge.type === 'default')
.flatMap((edge) => {
const targetNode = nodes.find((node) => node.id === edge.target);
if (!targetNode || !isInvocationNode(targetNode) || !isExecutableNode(targetNode)) {
@@ -232,21 +174,6 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
);
});
- const loopLinkageEdges = edges.filter(isLoopLinkageEdge).filter((edge) => {
- const sourceNode = nodes.find((node) => node.id === edge.source);
- const targetNode = nodes.find((node) => node.id === edge.target);
- return Boolean(
- sourceNode &&
- targetNode &&
- isInvocationNode(sourceNode) &&
- isInvocationNode(targetNode) &&
- isExecutableNode(sourceNode) &&
- isExecutableNode(targetNode) &&
- filteredNodeIds.includes(sourceNode.id) &&
- filteredNodeIds.includes(targetNode.id)
- );
- });
-
// Reduce the node editor edges into invocation graph edges
const parsedEdges = flattenedEdges.reduce<NonNullable<Graph['edges']>>((edgesAccumulator, edge) => {
const { source, target, sourceHandle, targetHandle } = edge;
@@ -258,7 +185,6 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
// Format the edges and add to the edges array
edgesAccumulator.push({
- type: 'default',
source: {
node_id: source,
field: sourceHandle,
@@ -272,47 +198,6 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
return edgesAccumulator;
}, []);
- loopLinkageEdges.forEach((edge) => {
- if (!edge.sourceHandle || !edge.targetHandle) {
- log.warn(
- {
- edgeId: edge.id,
- source: edge.source,
- sourceHandle: edge.sourceHandle,
- target: edge.target,
- targetHandle: edge.targetHandle,
- },
- 'Missing source or target handle for loop linkage edge'
- );
- return;
- }
- parsedEdges.push({
- type: 'loop_linkage',
- source: {
- node_id: edge.source,
- field: edge.sourceHandle,
- },
- destination: {
- node_id: edge.target,
- field: edge.targetHandle,
- },
- });
- });
-
- connectorLoopLinkagePaths.forEach(({ forNodeId, returnNodeId }) => {
- parsedEdges.push({
- type: 'loop_linkage',
- source: {
- node_id: forNodeId,
- field: LOOP_LINKAGE_FIELD,
- },
- destination: {
- node_id: returnNodeId,
- field: LOOP_LINKAGE_FIELD,
- },
- });
- });
-
/**
* Omit all inputs that have edges connected.
*
@@ -323,9 +208,6 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
* even though the actual value that will be used comes from the connection.
*/
parsedEdges.forEach((edge) => {
- if (edge.type !== 'default') {
- return;
- }
const destination_node = parsedNodes[edge.destination.node_id];
if (!destination_node) {
return;
@@ -351,10 +233,5 @@ export const buildNodesGraph = (state: RootState, templates: Templates): Require
edges: parsedEdges,
};
- const forLoopError = validateForLoopGraph(graph);
- if (forLoopError !== null) {
- throw new Error(t(forLoopError) || forLoopError);
- }
-
return graph;
};
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/generation/Graph.ts b/invokeai/frontend/web/src/features/nodes/util/graph/generation/Graph.ts
index c912d0800c..db94b946e8 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graph/generation/Graph.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/graph/generation/Graph.ts
@@ -125,7 +125,7 @@ export class Graph {
});
}
- Object.assign(node, changes as object);
+ Object.assign(node, changes);
return node;
}
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.test.ts b/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.test.ts
deleted file mode 100644
index 1ba01ff1bf..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.test.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from 'features/nodes/store/util/connectorTopology';
-import {
- add,
- buildEdge,
- buildLoopLinkageEdge,
- buildNode,
- for_loop,
- for_return,
-} from 'features/nodes/store/util/testUtils';
-import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import { describe, expect, it } from 'vitest';
-
-import { getForLoopBodyBoundaries } from './loopBodyBoundary';
-
-const setNodeId = (node: AnyNode, id: string): AnyNode => {
- node.id = id;
- node.data.id = id;
- return node;
-};
-
-const edge = (source: string, sourceHandle: string, target: string, targetHandle: string): AnyEdge =>
- buildEdge(source, sourceHandle, target, targetHandle);
-
-const connector = (id: string): AnyNode => ({
- id,
- type: 'connector',
- position: { x: 0, y: 0 },
- data: { id, type: 'connector', label: 'Connector', isOpen: true },
-});
-
-describe(getForLoopBodyBoundaries.name, () => {
- it('resolves a body using its explicit loop linkage', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, returnNode],
- [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- buildLoopLinkageEdge('for', 'return'),
- ]
- );
-
- expect(boundaries).toEqual([
- expect.objectContaining({
- forNodeId: 'for',
- returnNodeId: 'return',
- bodyNodeIds: ['for', 'body', 'return'],
- status: 'complete',
- }),
- ]);
- });
-
- it('resolves a body using a connector loop linkage alias', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const connectorNode = connector('connector');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, connectorNode, returnNode],
- [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- edge('for', 'loop_linkage', 'connector', CONNECTOR_INPUT_HANDLE),
- edge('connector', CONNECTOR_OUTPUT_HANDLE, 'return', 'loop_linkage'),
- ]
- );
-
- expect(boundaries).toEqual([
- expect.objectContaining({
- forNodeId: 'for',
- returnNodeId: 'return',
- bodyNodeIds: ['for', 'body', 'connector', 'return'],
- status: 'complete',
- }),
- ]);
- });
-
- it('includes every connector in a loop linkage alias chain', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const firstConnector = connector('connector-a');
- const secondConnector = connector('connector-b');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, firstConnector, secondConnector, returnNode],
- [
- edge('for', 'loop_linkage', 'connector-a', CONNECTOR_INPUT_HANDLE),
- edge('connector-a', CONNECTOR_OUTPUT_HANDLE, 'connector-b', CONNECTOR_INPUT_HANDLE),
- edge('connector-b', CONNECTOR_OUTPUT_HANDLE, 'return', 'loop_linkage'),
- ]
- );
-
- expect(boundaries[0]?.bodyNodeIds).toEqual(['for', 'connector-a', 'connector-b', 'return']);
- });
-
- it('reports missing loop linkage even when the data path is complete', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, returnNode],
- [edge('for', 'item', 'body', 'a'), edge('body', 'value', 'return', 'output')]
- );
-
- expect(boundaries[0]).toEqual(
- expect.objectContaining({ forNodeId: 'for', returnNodeId: 'return', status: 'missing_linkage' })
- );
- });
-
- it('reports a linkage whose return is detached from the body', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, returnNode],
- [edge('for', 'item', 'body', 'a'), buildLoopLinkageEdge('for', 'return')]
- );
-
- expect(boundaries[0]).toEqual(
- expect.objectContaining({ forNodeId: 'for', returnNodeId: 'return', status: 'invalid_linkage' })
- );
- expect(boundaries).toHaveLength(1);
- });
-
- it('reports duplicate linkage edges', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, returnNode],
- [
- edge('for', 'item', 'return', 'output'),
- buildLoopLinkageEdge('for', 'return'),
- { ...buildLoopLinkageEdge('for', 'return'), id: 'duplicate-linkage' },
- ]
- );
-
- expect(boundaries[0]).toEqual(expect.objectContaining({ status: 'duplicate_linkage' }));
- });
-
- it('reports duplicate linkage ownership from multiple For nodes', () => {
- const firstForNode = setNodeId(buildNode(for_loop), 'first-for');
- const secondForNode = setNodeId(buildNode(for_loop), 'second-for');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [firstForNode, secondForNode, returnNode],
- [
- edge('first-for', 'item', 'return', 'output'),
- edge('second-for', 'item', 'return', 'output'),
- buildLoopLinkageEdge('first-for', 'return'),
- buildLoopLinkageEdge('second-for', 'return'),
- ]
- );
-
- expect(boundaries).toEqual([
- expect.objectContaining({ forNodeId: 'first-for', status: 'duplicate_linkage' }),
- expect.objectContaining({ forNodeId: 'second-for', status: 'duplicate_linkage' }),
- ]);
- });
-
- it('does not include final-scoped For outputs in the body boundary', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const returnNode = setNodeId(buildNode(for_return), 'return');
- const afterNode = setNodeId(buildNode(add), 'after');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, returnNode, afterNode],
- [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- edge('for', 'output_collection', 'after', 'a'),
- buildLoopLinkageEdge('for', 'return'),
- ]
- );
-
- expect(boundaries[0]?.bodyNodeIds).toEqual(['for', 'body', 'return']);
- });
-
- it('ignores loop linkage when finding executable paths', () => {
- const forNode = setNodeId(buildNode(for_loop), 'for');
- const bodyNode = setNodeId(buildNode(add), 'body');
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- const boundaries = getForLoopBodyBoundaries(
- [forNode, bodyNode, returnNode],
- [buildLoopLinkageEdge('for', 'return')]
- );
-
- expect(boundaries[0]).toEqual(expect.objectContaining({ status: 'invalid_linkage' }));
- });
-
- it('reports an unlinked ForReturn as an orphan boundary', () => {
- const returnNode = setNodeId(buildNode(for_return), 'return');
-
- expect(getForLoopBodyBoundaries([returnNode], [])).toEqual([
- expect.objectContaining({
- forNodeId: undefined,
- returnNodeId: 'return',
- bodyNodeIds: ['return'],
- status: 'orphan_return',
- }),
- ]);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.ts b/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.ts
deleted file mode 100644
index 660a59b8ba..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/graph/loopBodyBoundary.ts
+++ /dev/null
@@ -1,219 +0,0 @@
-import { CONNECTOR_OUTPUT_HANDLE, resolveLoopLinkagePath } from 'features/nodes/store/util/connectorTopology';
-import { isLoopLinkageEdge } from 'features/nodes/store/util/reactFlowUtil';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
-import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import { isConnectorNode, isInvocationNode } from 'features/nodes/types/invocation';
-
-const ITERATION_OUTPUT_FIELDS = new Set(['item', 'index', 'total', 'state']);
-
-export type LoopBodyBoundaryStatus =
- | 'complete'
- | 'missing_linkage'
- | 'invalid_linkage'
- | 'duplicate_linkage'
- | 'missing_return'
- | 'multiple_returns'
- | 'orphan_return';
-
-type LoopBodyBoundary = {
- forNodeId?: string;
- returnNodeId?: string;
- bodyNodeIds: string[];
- status: LoopBodyBoundaryStatus;
-};
-
-const getReachableNodeIds = (startIds: string[], outgoing: Map<string, string[]>): Set<string> => {
- const visited = new Set<string>();
- const pending = [...startIds];
- while (pending.length > 0) {
- const nodeId = pending.pop();
- if (nodeId === undefined || visited.has(nodeId)) {
- continue;
- }
- visited.add(nodeId);
- pending.push(...(outgoing.get(nodeId) ?? []));
- }
- return visited;
-};
-
-const getBoundaryNodeIds = (
- nodes: AnyNode[],
- reachableNodeIds: Set<string>,
- returnNodeId: string | undefined,
- incoming: Map<string, string[]>,
- additionalNodeIds: Set<string> = new Set()
-): string[] => {
- const bodyNodeIds = returnNodeId
- ? new Set([...getReachableNodeIds([returnNodeId], incoming)].filter((nodeId) => reachableNodeIds.has(nodeId)))
- : new Set(reachableNodeIds);
- if (returnNodeId) {
- bodyNodeIds.add(returnNodeId);
- }
- additionalNodeIds.forEach((nodeId) => bodyNodeIds.add(nodeId));
- return nodes.filter((node) => bodyNodeIds.has(node.id)).map((node) => node.id);
-};
-
-export const getForLoopBodyBoundaries = (nodes: AnyNode[], edges: AnyEdge[]): LoopBodyBoundary[] => {
- const nodesById = new Map(nodes.map((node) => [node.id, node]));
- const resolvedConnectorLinkages = edges.flatMap((edge) => {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- return [];
- }
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- return path ? [path] : [];
- });
- const resolvedConnectorLinkageEdgeIds = new Set(resolvedConnectorLinkages.flatMap((path) => path.edgeIds));
- const resolvedConnectorNodeIdsByForId = new Map<string, string[]>();
- for (const path of resolvedConnectorLinkages) {
- resolvedConnectorNodeIdsByForId.set(path.forNodeId, [
- ...(resolvedConnectorNodeIdsByForId.get(path.forNodeId) ?? []),
- ...path.connectorNodeIds,
- ]);
- }
- const executableEdges = edges.filter(
- (edge) => !isLoopLinkageEdge(edge) && !resolvedConnectorLinkageEdgeIds.has(edge.id)
- );
- const linkageEdges = [
- ...edges.filter(isLoopLinkageEdge),
- ...resolvedConnectorLinkages.map(
- ({ forNodeId, returnNodeId }) =>
- ({
- id: `resolved-loop-linkage-${forNodeId}-${returnNodeId}`,
- type: 'loop_linkage' as const,
- source: forNodeId,
- sourceHandle: LOOP_LINKAGE_FIELD,
- target: returnNodeId,
- targetHandle: LOOP_LINKAGE_FIELD,
- }) satisfies AnyEdge
- ),
- ];
- const outgoing = new Map<string, string[]>();
- const incoming = new Map<string, string[]>();
-
- for (const edge of executableEdges) {
- if (!nodesById.has(edge.source) || !nodesById.has(edge.target)) {
- continue;
- }
- outgoing.set(edge.source, [...(outgoing.get(edge.source) ?? []), edge.target]);
- incoming.set(edge.target, [...(incoming.get(edge.target) ?? []), edge.source]);
- }
-
- const linkedReturnByForId = new Map<string, string>();
- const linkedForByReturnId = new Map<string, string>();
- const duplicateForIds = new Set<string>();
- const duplicateReturnIds = new Set<string>();
- const invalidForIds = new Set<string>();
- const invalidReturnIds = new Set<string>();
-
- for (const edge of linkageEdges) {
- const sourceNode = nodesById.get(edge.source);
- const targetNode = nodesById.get(edge.target);
- if (
- edge.sourceHandle !== LOOP_LINKAGE_FIELD ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isInvocationNode(sourceNode) ||
- sourceNode.data.type !== 'for' ||
- !isInvocationNode(targetNode) ||
- targetNode.data.type !== 'for_return'
- ) {
- if (sourceNode?.type === 'invocation' && sourceNode.data.type === 'for') {
- invalidForIds.add(sourceNode.id);
- }
- if (targetNode?.type === 'invocation' && targetNode.data.type === 'for_return') {
- invalidReturnIds.add(targetNode.id);
- }
- continue;
- }
- if (linkedReturnByForId.has(sourceNode.id)) {
- duplicateForIds.add(sourceNode.id);
- } else {
- linkedReturnByForId.set(sourceNode.id, targetNode.id);
- }
- if (linkedForByReturnId.has(targetNode.id)) {
- duplicateReturnIds.add(targetNode.id);
- } else {
- linkedForByReturnId.set(targetNode.id, sourceNode.id);
- }
- }
-
- const reachableReturnIds = new Set<string>();
- const forBoundaries = nodes
- .filter((node) => isInvocationNode(node) && node.data.type === 'for')
- .map((forNode) => {
- const iterationTargets = executableEdges
- .filter(
- (edge) =>
- edge.source === forNode.id &&
- typeof edge.sourceHandle === 'string' &&
- ITERATION_OUTPUT_FIELDS.has(edge.sourceHandle)
- )
- .map((edge) => edge.target);
- const reachableNodeIds = getReachableNodeIds(iterationTargets, outgoing);
- const reachableReturnNodes = nodes.filter(
- (node) => reachableNodeIds.has(node.id) && isInvocationNode(node) && node.data.type === 'for_return'
- );
- reachableReturnNodes.forEach((node) => reachableReturnIds.add(node.id));
-
- const linkedReturnId = linkedReturnByForId.get(forNode.id);
- const returnNodeId =
- linkedReturnId ?? (reachableReturnNodes.length === 1 ? reachableReturnNodes[0]?.id : undefined);
- let status: LoopBodyBoundaryStatus;
- if (duplicateForIds.has(forNode.id) || (linkedReturnId !== undefined && duplicateReturnIds.has(linkedReturnId))) {
- status = 'duplicate_linkage';
- } else if (invalidForIds.has(forNode.id)) {
- status = 'invalid_linkage';
- } else if (linkedReturnId === undefined) {
- status = 'missing_linkage';
- } else if (!reachableNodeIds.has(linkedReturnId)) {
- status = 'invalid_linkage';
- } else if (reachableReturnNodes.length === 0) {
- status = 'missing_return';
- } else if (reachableReturnNodes.length > 1) {
- status = 'multiple_returns';
- } else {
- status = 'complete';
- }
-
- return {
- forNodeId: forNode.id,
- ...(returnNodeId ? { returnNodeId } : {}),
- bodyNodeIds: [
- forNode.id,
- ...getBoundaryNodeIds(
- nodes,
- reachableNodeIds,
- returnNodeId,
- incoming,
- new Set(resolvedConnectorNodeIdsByForId.get(forNode.id))
- ).filter((id) => id !== forNode.id),
- ],
- status,
- };
- });
-
- const orphanReturnBoundaries = nodes
- .filter(
- (node) =>
- isInvocationNode(node) &&
- node.data.type === 'for_return' &&
- !linkedForByReturnId.has(node.id) &&
- (!reachableReturnIds.has(node.id) || invalidReturnIds.has(node.id))
- )
- .map((returnNode) => ({
- forNodeId: linkedForByReturnId.get(returnNode.id),
- returnNodeId: returnNode.id,
- bodyNodeIds: [returnNode.id],
- status: duplicateReturnIds.has(returnNode.id)
- ? ('duplicate_linkage' as const)
- : invalidReturnIds.has(returnNode.id)
- ? ('invalid_linkage' as const)
- : ('orphan_return' as const),
- }));
-
- return [...forBoundaries, ...orphanReturnBoundaries];
-};
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.test.ts b/invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.test.ts
deleted file mode 100644
index a42437da1d..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.test.ts
+++ /dev/null
@@ -1,604 +0,0 @@
-import type { Graph } from 'services/api/types';
-import { describe, expect, it } from 'vitest';
-
-import { validateForLoopGraph } from './validateForLoopGraph';
-
-type TestNode = { id: string; type: string };
-type TestEdge = {
- type?: 'default' | 'loop_linkage';
- source: { node_id: string; field: string };
- destination: { node_id: string; field: string };
-};
-
-const buildGraph = (nodes: TestNode[], edges: TestEdge[]): Graph =>
- ({
- id: 'graph',
- nodes: Object.fromEntries(nodes.map((node) => [node.id, node])),
- edges,
- }) as unknown as Graph;
-
-const edge = (source: string, sourceField: string, destination: string, destinationField: string): TestEdge => ({
- type: 'default',
- source: { node_id: source, field: sourceField },
- destination: { node_id: destination, field: destinationField },
-});
-
-const linkage = (source: string, destination: string): TestEdge => ({
- type: 'loop_linkage',
- source: { node_id: source, field: 'loop_linkage' },
- destination: { node_id: destination, field: 'loop_linkage' },
-});
-
-describe(validateForLoopGraph.name, () => {
- it('accepts a valid For body', () => {
- const graph = buildGraph(
- [
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- { id: 'after', type: 'collect' },
- ],
- [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- edge('for', 'output_collection', 'after', 'item'),
- linkage('for', 'return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it('requires an explicit loop linkage', () => {
- const graph = buildGraph(
- [
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- [edge('for', 'item', 'body', 'a'), edge('body', 'value', 'return', 'output')]
- );
-
- expect(validateForLoopGraph(graph)).toBe('nodes.forLoopLinkageMissing');
- });
-
- it('rejects a linkage with the wrong endpoint fields', () => {
- const graph = buildGraph(
- [
- { id: 'source', type: 'add' },
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- {
- type: 'loop_linkage',
- source: { node_id: 'for', field: 'item' },
- destination: { node_id: 'return', field: 'loop_linkage' },
- },
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBe('nodes.forLoopLinkageInvalid');
- });
-
- it('rejects an internal Iterate predicate branch without scalar aggregation', () => {
- const graph = buildGraph(
- [
- { id: 'for', type: 'for' },
- { id: 'iterate', type: 'iterate' },
- { id: 'body', type: 'add' },
- { id: 'condition', type: 'add' },
- { id: 'collect', type: 'collect' },
- { id: 'return', type: 'for_return' },
- ],
- [
- edge('for', 'item', 'iterate', 'collection'),
- edge('iterate', 'item', 'body', 'a'),
- edge('iterate', 'item', 'condition', 'value'),
- edge('body', 'value', 'collect', 'item'),
- edge('collect', 'collection', 'return', 'output'),
- edge('condition', 'value', 'return', 'continue_condition'),
- linkage('for', 'return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBe('nodes.forLoopIterateUnsupported');
- });
-
- it('accepts one nested For whose final collection closes the outer body', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-body', type: 'add' },
- { id: 'inner-condition', type: 'add' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-body', 'value'),
- edge('inner', 'item', 'inner-condition', 'value'),
- edge('inner-body', 'value', 'inner-return', 'output'),
- edge('inner-condition', 'value', 'inner-return', 'continue_condition'),
- edge('inner', 'output_collection', 'outer-return', 'output'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it('accepts nested ForReturn state produced by the inner body', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-body', type: 'add' },
- { id: 'inner-state', type: 'add' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-body', 'value'),
- edge('inner', 'state', 'inner-state', 'state'),
- edge('inner', 'item', 'inner-state', 'value'),
- edge('inner-body', 'value', 'inner-return', 'output'),
- edge('inner-state', 'state', 'inner-return', 'state'),
- edge('inner', 'output_collection', 'outer-return', 'output'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it('rejects an outer nested ForReturn condition from an external scope', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-body', type: 'add' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- { id: 'external-condition', type: 'add' },
- ],
- [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-body', 'value'),
- edge('inner-body', 'value', 'inner-return', 'output'),
- edge('inner', 'output_collection', 'outer-return', 'output'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- edge('external-condition', 'value', 'outer-return', 'continue_condition'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBe('nodes.forLoopNestedUnsupported');
- });
-
- it('accepts deeper nested For boundaries when each boundary has one child', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'outer-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'leaf', type: 'for' },
- { id: 'leaf-body', type: 'add' },
- { id: 'leaf-return', type: 'for_return' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'outer-collection', 'value'),
- edge('outer-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'leaf', 'collection'),
- edge('leaf', 'item', 'leaf-body', 'value'),
- edge('leaf-body', 'value', 'leaf-return', 'output'),
- edge('leaf', 'output_collection', 'inner-return', 'output'),
- edge('inner', 'output_collection', 'outer-return', 'output'),
- linkage('leaf', 'leaf-return'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it('accepts a nested For with an outer continuation after the inner final output', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-body', type: 'add' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'continuation', type: 'add' },
- { id: 'continuation-tail', type: 'add' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-body', 'value'),
- edge('inner-body', 'value', 'inner-return', 'output'),
- edge('inner', 'output_collection', 'continuation', 'value'),
- edge('continuation', 'value', 'continuation-tail', 'value'),
- edge('continuation-tail', 'value', 'outer-return', 'output'),
- edge('continuation-tail', 'value', 'outer-return', 'continue_condition'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it('rejects a nested continuation branch that does not reach the outer ForReturn', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'inner-body', type: 'add' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'continuation', type: 'add' },
- { id: 'dead-branch', type: 'add' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'inner-body', 'value'),
- edge('inner-body', 'value', 'inner-return', 'output'),
- edge('inner', 'output_collection', 'continuation', 'value'),
- edge('continuation', 'value', 'outer-return', 'output'),
- edge('continuation', 'value', 'dead-branch', 'value'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBe('nodes.forLoopNestedUnsupported');
- });
-
- it('accepts independent nested For children with an explicit fan-in continuation', () => {
- const graph = buildGraph(
- [
- { id: 'outer', type: 'for' },
- { id: 'first', type: 'for' },
- { id: 'second', type: 'for' },
- { id: 'first-body', type: 'add' },
- { id: 'second-body', type: 'add' },
- { id: 'first-return', type: 'for_return' },
- { id: 'second-return', type: 'for_return' },
- { id: 'fan-in', type: 'add' },
- { id: 'outer-return', type: 'for_return' },
- ],
- [
- edge('outer', 'item', 'first', 'collection'),
- edge('outer', 'item', 'second', 'collection'),
- edge('first', 'item', 'first-body', 'value'),
- edge('first-body', 'value', 'first-return', 'output'),
- edge('second', 'item', 'second-body', 'value'),
- edge('second-body', 'value', 'second-return', 'output'),
- edge('first', 'output_collection', 'fan-in', 'first'),
- edge('second', 'output_collection', 'fan-in', 'second'),
- edge('fan-in', 'value', 'outer-return', 'output'),
- linkage('first', 'first-return'),
- linkage('second', 'second-return'),
- linkage('outer', 'outer-return'),
- ]
- );
-
- expect(validateForLoopGraph(graph)).toBeNull();
- });
-
- it.each([
- {
- name: 'missing loop linkage',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [edge('for', 'item', 'return', 'output')],
- expected: 'nodes.forLoopLinkageMissing',
- },
- {
- name: 'duplicate loop linkage',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [edge('for', 'item', 'return', 'output'), linkage('for', 'return'), linkage('for', 'return')],
- expected: 'nodes.forLoopLinkageDuplicate',
- },
- {
- name: 'duplicate For collection inputs',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'add' },
- { id: 'second', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('first', 'value', 'for', 'collection'),
- edge('second', 'value', 'for', 'collection'),
- edge('for', 'item', 'return', 'output'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopInputCount',
- },
- {
- name: 'duplicate For state inputs',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'add' },
- { id: 'second', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('first', 'value', 'for', 'state'),
- edge('second', 'value', 'for', 'state'),
- edge('for', 'item', 'return', 'output'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopInputCount',
- },
- {
- name: 'duplicate ForReturn outputs',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'add' },
- { id: 'second', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'return', 'output'),
- edge('first', 'value', 'return', 'output'),
- edge('second', 'value', 'return', 'output'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forReturnInputCount',
- },
- {
- name: 'duplicate ForReturn state inputs',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'add' },
- { id: 'second', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'return', 'output'),
- edge('first', 'value', 'return', 'state'),
- edge('second', 'value', 'return', 'state'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forReturnInputCount',
- },
- {
- name: 'duplicate ForReturn continue conditions',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'add' },
- { id: 'second', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'return', 'output'),
- edge('first', 'value', 'return', 'continue_condition'),
- edge('second', 'value', 'return', 'continue_condition'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forReturnInputCount',
- },
- ])('rejects $name', ({ nodes, edges, expected }) => {
- expect(validateForLoopGraph(buildGraph(nodes, edges))).toBe(expected);
- });
-
- it.each([
- {
- name: 'missing iteration output',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [linkage('for', 'return')],
- expected: 'nodes.forLoopMissingIterationOutput',
- },
- {
- name: 'missing ForReturn',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- ],
- edges: [edge('for', 'item', 'body', 'a')],
- expected: 'nodes.forLoopLinkageMissing',
- },
- {
- name: 'multiple ForReturn nodes',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'first', type: 'for_return' },
- { id: 'second', type: 'for_return' },
- ],
- edges: [edge('for', 'item', 'first', 'output'), edge('for', 'state', 'second', 'state'), linkage('for', 'first')],
- expected: 'nodes.forLoopLinkageMissing',
- },
- {
- name: 'unterminated body branch',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- { id: 'escape', type: 'add' },
- ],
- edges: [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- edge('for', 'state', 'escape', 'a'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopUnterminatedBody',
- },
- {
- name: 'nested For',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'nested', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'nested', 'collection'),
- edge('nested', 'item', 'return', 'output'),
- linkage('nested', 'return'),
- ],
- expected: 'nodes.forLoopLinkageMissing',
- },
- {
- name: 'multiple direct nested For children',
- nodes: [
- { id: 'outer', type: 'for' },
- { id: 'first', type: 'for' },
- { id: 'second', type: 'for' },
- { id: 'first-return', type: 'for_return' },
- { id: 'second-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- ],
- edges: [
- edge('outer', 'item', 'first', 'collection'),
- edge('outer', 'item', 'second', 'collection'),
- edge('first', 'item', 'first-return', 'output'),
- edge('second', 'item', 'second-return', 'output'),
- edge('first', 'output_collection', 'outer-return', 'output'),
- linkage('first', 'first-return'),
- linkage('second', 'second-return'),
- linkage('outer', 'outer-return'),
- ],
- expected: 'nodes.forLoopNestedUnsupported',
- },
- {
- name: 'mixed nested For and Iterate body',
- nodes: [
- { id: 'outer', type: 'for' },
- { id: 'inner-collection', type: 'add' },
- { id: 'inner', type: 'for' },
- { id: 'iterate-collection', type: 'add' },
- { id: 'iterate', type: 'iterate' },
- { id: 'body', type: 'add' },
- { id: 'collect', type: 'collect' },
- { id: 'inner-return', type: 'for_return' },
- { id: 'outer-return', type: 'for_return' },
- ],
- edges: [
- edge('outer', 'item', 'inner-collection', 'value'),
- edge('inner-collection', 'value', 'inner', 'collection'),
- edge('inner', 'item', 'iterate-collection', 'value'),
- edge('iterate-collection', 'value', 'iterate', 'collection'),
- edge('iterate', 'item', 'body', 'value'),
- edge('body', 'value', 'collect', 'item'),
- edge('collect', 'collection', 'inner-return', 'output'),
- edge('inner', 'output_collection', 'outer-return', 'output'),
- linkage('inner', 'inner-return'),
- linkage('outer', 'outer-return'),
- ],
- expected: 'nodes.forLoopNestedUnsupported',
- },
- {
- name: 'body Iterate',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'iterate', type: 'iterate' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'iterate', 'collection'),
- edge('iterate', 'item', 'return', 'output'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopIterateUnsupported',
- },
- {
- name: 'iterator-derived external body input',
- nodes: [
- { id: 'collection', type: 'integer_collection' },
- { id: 'iterate', type: 'iterate' },
- { id: 'external', type: 'add' },
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('collection', 'collection', 'iterate', 'collection'),
- edge('iterate', 'item', 'external', 'a'),
- edge('for', 'item', 'body', 'a'),
- edge('external', 'value', 'body', 'b'),
- edge('body', 'value', 'return', 'output'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopIteratorInputUnsupported',
- },
- {
- name: 'final output feeding body',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('for', 'item', 'return', 'output'),
- edge('for', 'final_state', 'return', 'state'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopFinalOutputInBody',
- },
- {
- name: 'body output escaping before ForReturn',
- nodes: [
- { id: 'for', type: 'for' },
- { id: 'body', type: 'add' },
- { id: 'return', type: 'for_return' },
- { id: 'escape', type: 'add' },
- ],
- edges: [
- edge('for', 'item', 'body', 'a'),
- edge('body', 'value', 'return', 'output'),
- edge('body', 'value', 'escape', 'a'),
- linkage('for', 'return'),
- ],
- expected: 'nodes.forLoopUnterminatedBody',
- },
- {
- name: 'ForReturn shared by two loops',
- nodes: [
- { id: 'first', type: 'for' },
- { id: 'second', type: 'for' },
- { id: 'return', type: 'for_return' },
- ],
- edges: [
- edge('first', 'item', 'return', 'output'),
- edge('second', 'item', 'return', 'output'),
- linkage('first', 'return'),
- linkage('second', 'return'),
- ],
- expected: 'nodes.forLoopLinkageDuplicate',
- },
- ])('rejects $name', ({ nodes, edges, expected }) => {
- expect(validateForLoopGraph(buildGraph(nodes, edges))).toBe(expected);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.test.ts b/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.test.ts
deleted file mode 100644
index 4cea157b14..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.test.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { for_return } from 'features/nodes/store/util/testUtils';
-import type { FieldOutputTemplate } from 'features/nodes/types/field';
-import { getOutputFieldNamesByScope } from 'features/nodes/util/node/getOutputFieldNamesByScope';
-import { describe, expect, it } from 'vitest';
-
-const buildOutput = (
- name: string,
- output_scope: FieldOutputTemplate['output_scope'],
- ui_order: number,
- ui_hidden = false
-): FieldOutputTemplate => ({
- fieldKind: 'output',
- name,
- title: name,
- description: name,
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- ui_hidden,
- ui_order,
- output_scope,
-});
-
-describe(getOutputFieldNamesByScope.name, () => {
- it('sorts visible output fields and partitions them by scope', () => {
- const fields = [
- buildOutput('output_collection', 'final', 3),
- buildOutput('hidden_iteration_value', 'iteration', 0, true),
- buildOutput('value', null, 2),
- buildOutput('item', 'iteration', 1),
- ];
-
- expect(getOutputFieldNamesByScope(fields)).toEqual({
- all: ['item', 'value', 'output_collection'],
- unscoped: ['value'],
- iteration: ['item'],
- final: ['output_collection'],
- });
- });
-
- it('hides ForReturn scheduler outputs from the node UI', () => {
- expect(getOutputFieldNamesByScope(Object.values(for_return.outputs))).toEqual({
- all: [],
- unscoped: [],
- iteration: [],
- final: [],
- });
- expect(for_return.inputs.output?.ui_hidden).toBe(false);
- expect(for_return.inputs.state?.ui_hidden).toBe(false);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.ts b/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.ts
deleted file mode 100644
index 7ac3970738..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldNamesByScope.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { FieldOutputTemplate } from 'features/nodes/types/field';
-import { getSortedFilteredFieldNames } from 'features/nodes/util/node/getSortedFilteredFieldNames';
-
-export type OutputFieldNamesByScope = {
- all: string[];
- unscoped: string[];
- iteration: string[];
- final: string[];
-};
-
-export const getOutputFieldNamesByScope = (fields: FieldOutputTemplate[]): OutputFieldNamesByScope => {
- const all = getSortedFilteredFieldNames(fields);
- const fieldsByName = new Map(fields.map((field) => [field.name, field]));
-
- return {
- all,
- unscoped: all.filter((name) => !fieldsByName.get(name)?.output_scope),
- iteration: all.filter((name) => fieldsByName.get(name)?.output_scope === 'iteration'),
- final: all.filter((name) => fieldsByName.get(name)?.output_scope === 'final'),
- };
-};
diff --git a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.test.ts b/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.test.ts
deleted file mode 100644
index 619f590f77..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.test.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { getOutputFieldRows } from 'features/nodes/util/node/getOutputFieldRows';
-import { describe, expect, it } from 'vitest';
-
-describe(getOutputFieldRows.name, () => {
- it('returns ordinary outputs without section headers', () => {
- expect(
- getOutputFieldRows({
- all: ['value', 'metadata'],
- unscoped: ['value', 'metadata'],
- iteration: [],
- final: [],
- })
- ).toEqual([
- { type: 'field', fieldName: 'value' },
- { type: 'field', fieldName: 'metadata' },
- ]);
- });
-
- it('groups scoped outputs under iteration and final section headers', () => {
- expect(
- getOutputFieldRows({
- all: ['value', 'item', 'state', 'output_collection', 'final_state'],
- unscoped: ['value'],
- iteration: ['item', 'state'],
- final: ['output_collection', 'final_state'],
- })
- ).toEqual([
- { type: 'field', fieldName: 'value' },
- { type: 'header', scope: 'iteration' },
- { type: 'field', fieldName: 'item' },
- { type: 'field', fieldName: 'state' },
- { type: 'header', scope: 'final' },
- { type: 'field', fieldName: 'output_collection' },
- { type: 'field', fieldName: 'final_state' },
- ]);
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.ts b/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.ts
deleted file mode 100644
index c39d8e44ed..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/node/getOutputFieldRows.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { OutputFieldNamesByScope } from 'features/nodes/util/node/getOutputFieldNamesByScope';
-
-type OutputFieldRow = { type: 'field'; fieldName: string } | { type: 'header'; scope: 'iteration' | 'final' };
-
-const getFieldRows = (fieldNames: string[]): OutputFieldRow[] =>
- fieldNames.map((fieldName) => ({ type: 'field', fieldName }));
-
-export const getOutputFieldRows = (fieldNames: OutputFieldNamesByScope): OutputFieldRow[] => {
- if (fieldNames.iteration.length === 0 && fieldNames.final.length === 0) {
- return getFieldRows(fieldNames.all);
- }
-
- const rows = getFieldRows(fieldNames.unscoped);
- if (fieldNames.iteration.length > 0) {
- rows.push({ type: 'header', scope: 'iteration' }, ...getFieldRows(fieldNames.iteration));
- }
- if (fieldNames.final.length > 0) {
- rows.push({ type: 'header', scope: 'final' }, ...getFieldRows(fieldNames.final));
- }
- return rows;
-};
diff --git a/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts b/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts
index e648b86f39..ca1b397a91 100644
--- a/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts
@@ -18,7 +18,7 @@ type UpdateNodeOptions = {
export const getConnectedInputNames = (nodeId: string, edges: ConnectedInputEdge[]): Set<string> =>
new Set(
edges.flatMap((edge) =>
- edge.type !== 'loop_linkage' && edge.target === nodeId && edge.targetHandle ? [edge.targetHandle] : []
+ edge.type === 'default' && edge.target === nodeId && edge.targetHandle ? [edge.targetHandle] : []
)
);
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
index c5d660779c..4c0e4130e7 100644
--- a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldInputTemplate.ts
@@ -46,17 +46,13 @@ import {
isStatefulFieldType,
isStringCollectionFieldType,
} from 'features/nodes/types/field';
-import type { InvocationInputFieldSchema } from 'features/nodes/types/openapi';
+import type { InvocationFieldSchema } from 'features/nodes/types/openapi';
import { isSchemaObject } from 'features/nodes/types/openapi';
import { t } from 'i18next';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type FieldInputTemplateBuilder<T extends FieldInputTemplate = any> = // valid `any`!
- (arg: {
- schemaObject: InvocationInputFieldSchema;
- baseField: Omit<T, 'type' | 'default'>;
- fieldType: T['type'];
- }) => T;
+ (arg: { schemaObject: InvocationFieldSchema; baseField: Omit<T, 'type' | 'default'>; fieldType: T['type'] }) => T;
const buildIntegerFieldInputTemplate: FieldInputTemplateBuilder<IntegerFieldInputTemplate> = ({
schemaObject,
@@ -629,7 +625,7 @@ const TEMPLATE_BUILDER_MAP: Record<StatefulFieldType['name'], FieldInputTemplate
};
export const buildFieldInputTemplate = (
- fieldSchema: InvocationInputFieldSchema,
+ fieldSchema: InvocationFieldSchema,
fieldName: string,
fieldType: FieldType
): FieldInputTemplate => {
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.test.ts b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.test.ts
deleted file mode 100644
index d3b8ea05cd..0000000000
--- a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import type { FieldType } from 'features/nodes/types/field';
-import type { InvocationOutputFieldSchema } from 'features/nodes/types/openapi';
-import { buildFieldOutputTemplate } from 'features/nodes/util/schema/buildFieldOutputTemplate';
-import { describe, expect, it } from 'vitest';
-
-const fieldType: FieldType = {
- name: 'StringField',
- cardinality: 'SINGLE',
- batch: false,
-};
-
-describe('buildFieldOutputTemplate', () => {
- it('preserves output scope metadata', () => {
- const fieldSchema = {
- field_kind: 'output',
- title: 'Item',
- description: 'The current item',
- ui_hidden: false,
- output_scope: 'iteration',
- } as InvocationOutputFieldSchema;
-
- const template = buildFieldOutputTemplate(fieldSchema, 'item', fieldType);
-
- expect(template.output_scope).toBe('iteration');
- });
-});
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.ts b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.ts
index 50ee9f161a..960af9395b 100644
--- a/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/schema/buildFieldOutputTemplate.ts
@@ -1,13 +1,13 @@
import { startCase } from 'es-toolkit/compat';
import type { FieldOutputTemplate, FieldType } from 'features/nodes/types/field';
-import type { InvocationOutputFieldSchema } from 'features/nodes/types/openapi';
+import type { InvocationFieldSchema } from 'features/nodes/types/openapi';
export const buildFieldOutputTemplate = (
- fieldSchema: InvocationOutputFieldSchema,
+ fieldSchema: InvocationFieldSchema,
fieldName: string,
fieldType: FieldType
): FieldOutputTemplate => {
- const { title, description, ui_hidden, ui_type, ui_order, output_scope } = fieldSchema;
+ const { title, description, ui_hidden, ui_type, ui_order } = fieldSchema;
const template: FieldOutputTemplate = {
fieldKind: 'output',
@@ -18,7 +18,6 @@ export const buildFieldOutputTemplate = (
ui_hidden,
ui_type,
ui_order,
- output_scope,
};
return template;
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.test.ts b/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.test.ts
index eb31e5d0ac..1317f973dd 100644
--- a/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.test.ts
@@ -1,26 +1,9 @@
import { omit, pick } from 'es-toolkit/compat';
-import {
- call_saved_workflow,
- for_loop,
- for_return,
- schema,
- templates,
- workflow_return,
-} from 'features/nodes/store/util/testUtils';
-import type { InvocationTemplate } from 'features/nodes/types/invocation';
+import { call_saved_workflow, schema, templates, workflow_return } from 'features/nodes/store/util/testUtils';
import { parseSchema } from 'features/nodes/util/schema/parseSchema';
-import type { OpenAPIV3_1 } from 'openapi-types';
import { describe, expect, it } from 'vitest';
-import generatedSchemaJSON from '../../../../../openapi.json?raw';
-
const stripUndefinedDeep = <T>(value: T): T => JSON.parse(JSON.stringify(value)) as T;
-const normalizeInputUiHidden = (template: InvocationTemplate): InvocationTemplate => ({
- ...template,
- inputs: Object.fromEntries(
- Object.entries(template.inputs).map(([name, input]) => [name, { ...input, ui_hidden: input.ui_hidden ?? false }])
- ),
-});
describe('parseSchema', () => {
it('should parse the schema', () => {
@@ -63,67 +46,4 @@ describe('parseSchema', () => {
expect(collectionInput.type.name).toBe('CollectionField');
expect(collectionInput.ui_type).toBe('CollectionField');
});
- it('should keep the loop test templates aligned with the generated schema', () => {
- const generatedSchema = JSON.parse(generatedSchemaJSON) as OpenAPIV3_1.Document;
- const parsed = parseSchema(generatedSchema, ['for', 'for_return']);
-
- expect(
- stripUndefinedDeep(
- Object.fromEntries(Object.entries(parsed).map(([type, template]) => [type, normalizeInputUiHidden(template)]))
- )
- ).toEqual(
- stripUndefinedDeep({
- for: normalizeInputUiHidden(for_loop),
- for_return: normalizeInputUiHidden(for_return),
- })
- );
-
- // Keep this explicit check so the generated schema and hand-maintained loop fixture cannot drift together.
- expect(parsed.for_return?.version).toBe('1.3.2');
- expect(parsed.for_return?.inputs.continue_condition).toMatchObject({
- input: 'any',
- required: false,
- default: true,
- type: { name: 'BooleanField' },
- });
- });
- it('should expose state_set.value as an AnyField connection input', () => {
- const generatedSchema = JSON.parse(generatedSchemaJSON) as OpenAPIV3_1.Document;
- const parsed = parseSchema(generatedSchema, ['state_set']);
- const valueInput = parsed.state_set?.inputs.value;
-
- expect(valueInput).toMatchObject({
- input: 'connection',
- ui_type: 'AnyField',
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- });
- expect(valueInput?.default).toBeUndefined();
- });
- it('should expose state_get.default and value as AnyField connections', () => {
- const generatedSchema = JSON.parse(generatedSchemaJSON) as OpenAPIV3_1.Document;
- const parsed = parseSchema(generatedSchema, ['state_get']);
- const template = parsed.state_get;
-
- expect(template?.inputs.default).toMatchObject({
- input: 'connection',
- ui_type: 'AnyField',
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- });
- expect(template?.inputs.default?.default).toBeUndefined();
- expect(template?.outputs.value).toMatchObject({
- ui_type: 'AnyField',
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- });
- });
- it('should expose state_merge.values as an AnyField connection input', () => {
- const generatedSchema = JSON.parse(generatedSchemaJSON) as OpenAPIV3_1.Document;
- const parsed = parseSchema(generatedSchema, ['state_merge']);
- const valuesInput = parsed.state_merge?.inputs.values;
-
- expect(valuesInput).toMatchObject({
- input: 'connection',
- ui_type: 'AnyField',
- type: { name: 'AnyField', cardinality: 'SINGLE', batch: false },
- });
- });
});
diff --git a/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.ts b/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.ts
index 659ad82389..47be2c62ec 100644
--- a/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/schema/parseSchema.ts
@@ -14,8 +14,7 @@ import {
import type { InvocationTemplate } from 'features/nodes/types/invocation';
import type { InvocationFieldSchema, InvocationSchemaObject } from 'features/nodes/types/openapi';
import {
- isInvocationInputFieldSchema,
- isInvocationOutputFieldSchema,
+ isInvocationFieldSchema,
isInvocationOutputSchemaObject,
isInvocationSchemaObject,
} from 'features/nodes/types/openapi';
@@ -43,9 +42,6 @@ const isReservedInputField = (nodeType: string, fieldName: string) => {
if (nodeType === 'iterate' && fieldName === 'index') {
return true;
}
- if (nodeType === 'for' && fieldName === 'index') {
- return true;
- }
return false;
};
@@ -130,7 +126,7 @@ export const parseSchema = (
return inputsAccumulator;
}
- if (!isInvocationInputFieldSchema(property)) {
+ if (!isInvocationFieldSchema(property)) {
log.warn({ node: type, field: propertyName, schema: parseify(property) }, 'Unhandled input property');
return inputsAccumulator;
}
@@ -207,7 +203,7 @@ export const parseSchema = (
return outputsAccumulator;
}
- if (!isInvocationOutputFieldSchema(property)) {
+ if (!isInvocationFieldSchema(property)) {
log.warn({ node: type, field: propertyName, schema: parseify(property) }, 'Unhandled output property');
return outputsAccumulator;
}
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.test.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.test.ts
index 42c8a32911..c7bdd80ace 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.test.ts
@@ -1,40 +1,8 @@
import { getInitialWorkflow } from 'features/nodes/store/nodesSlice';
-import { buildEdge, buildNode, call_saved_workflow, for_loop, for_return } from 'features/nodes/store/util/testUtils';
+import { buildNode, call_saved_workflow } from 'features/nodes/store/util/testUtils';
import { describe, expect, it } from 'vitest';
describe('buildWorkflowFast', () => {
- it('serializes loop linkage handles as loop_linkage edges even when the edge type is stale', async () => {
- Object.assign(globalThis, {
- window: {
- location: {
- origin: 'http://localhost',
- },
- },
- });
-
- const { buildWorkflowFast } = await import('features/nodes/util/workflow/buildWorkflow');
- const forNode = buildNode(for_loop);
- const returnNode = buildNode(for_return);
-
- const workflow = buildWorkflowFast({
- _version: 1,
- formFieldInitialValues: {},
- ...getInitialWorkflow(),
- nodes: [forNode, returnNode],
- edges: [buildEdge(forNode.id, 'loop_linkage', returnNode.id, 'loop_linkage')],
- });
-
- expect(workflow.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
it('persists the selected workflow id for call_saved_workflow nodes', async () => {
Object.assign(globalThis, {
window: {
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.ts
index 2ed98d4475..6d35fdf3f4 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/buildWorkflow.ts
@@ -5,7 +5,6 @@ import { parseify } from 'common/util/serialize';
import { pick } from 'es-toolkit/compat';
import { selectNodesSlice } from 'features/nodes/store/selectors';
import type { NodesState } from 'features/nodes/store/types';
-import { getEdgeTypeFromHandles } from 'features/nodes/store/util/reactFlowUtil';
import { isConnectorNode, isInvocationNode, isNotesNode } from 'features/nodes/types/invocation';
import type { WorkflowV3 } from 'features/nodes/types/workflow';
import { zWorkflowV3 } from 'features/nodes/types/workflow';
@@ -53,14 +52,9 @@ export const buildWorkflowFast = (nodesState: NodesState): WorkflowV3 => {
}
for (const edge of edges) {
- if ((edge.type === 'default' || edge.type === 'loop_linkage') && edge.sourceHandle && edge.targetHandle) {
- const { id, source, target, sourceHandle, targetHandle, hidden } = edge;
- const type = edge.type === 'loop_linkage' ? 'loop_linkage' : getEdgeTypeFromHandles(sourceHandle, targetHandle);
- if (type === 'loop_linkage') {
- newWorkflow.edges.push({ id, type, source, target, sourceHandle, targetHandle });
- } else {
- newWorkflow.edges.push({ id, type, source, target, sourceHandle, targetHandle, hidden });
- }
+ if (edge.type === 'default' && edge.sourceHandle && edge.targetHandle) {
+ const { id, type, source, target, sourceHandle, targetHandle, hidden } = edge;
+ newWorkflow.edges.push({ id, type, source, target, sourceHandle, targetHandle, hidden });
} else if (edge.type === 'collapsed') {
const { id, type, source, target } = edge;
newWorkflow.edges.push({ id, type, source, target });
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.test.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.test.ts
index 8837a1df0a..18c30d486b 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.test.ts
@@ -1,14 +1,11 @@
import { $templates } from 'features/nodes/store/nodesSlice';
import type { Templates } from 'features/nodes/store/types';
-import { for_loop, for_return } from 'features/nodes/store/util/testUtils';
import type { InvocationTemplate } from 'features/nodes/types/invocation';
import { isWorkflowInvocationNode } from 'features/nodes/types/workflow';
-import { buildNodesGraph } from 'features/nodes/util/graph/buildNodesGraph';
-import { getOutputFieldNamesByScope } from 'features/nodes/util/node/getOutputFieldNamesByScope';
-import { graphToWorkflow } from 'features/nodes/util/workflow/graphToWorkflow';
import type { NonNullableGraph } from 'services/api/types';
import { afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest';
+import { graphToWorkflow } from './graphToWorkflow';
import { parseAndMigrateWorkflow } from './migrations';
// Minimal templates needed to render the user's graph. We use the same shape
@@ -236,10 +233,9 @@ const imageCollectionTemplate = {
describe('graphToWorkflow', () => {
const originalTemplates = $templates.get();
- const loopTemplates: Templates = { for: for_loop, for_return };
beforeEach(() => {
- $templates.set({ image_collection: imageCollectionTemplate, ...loopTemplates });
+ $templates.set({ image_collection: imageCollectionTemplate });
});
afterEach(() => {
@@ -302,134 +298,4 @@ describe('graphToWorkflow', () => {
expect(node.data.inputs.images?.value).toBeUndefined();
expect(node.data.inputs.collection?.value).toEqual(images);
});
-
- it('round-trips For and ForReturn nodes and resolves scoped outputs from their templates', () => {
- const graph = {
- id: 'graph',
- nodes: {
- for: {
- id: 'for',
- type: 'for',
- collection: ['alpha', 'beta'],
- state: null,
- index: -1,
- },
- return: {
- id: 'return',
- type: 'for_return',
- output: null,
- state: null,
- continue_condition: null,
- },
- },
- edges: [
- {
- type: 'default',
- source: { node_id: 'for', field: 'item' },
- destination: { node_id: 'return', field: 'output' },
- },
- {
- type: 'loop_linkage',
- source: { node_id: 'for', field: 'loop_linkage' },
- destination: { node_id: 'return', field: 'loop_linkage' },
- },
- ],
- } satisfies NonNullableGraph;
-
- const workflow = graphToWorkflow(graph, false);
- const forNode = workflow.nodes.find((node) => node.id === 'for');
- const returnNode = workflow.nodes.find((node) => node.id === 'return');
- if (!isWorkflowInvocationNode(forNode) || !isWorkflowInvocationNode(returnNode)) {
- throw new Error('Expected For and ForReturn invocation nodes');
- }
-
- expect(forNode.data.inputs.collection?.value).toEqual(['alpha', 'beta']);
- expect(forNode.data.inputs.state?.value).toBeNull();
- expect(forNode.data.inputs.index).toBeUndefined();
- expect(returnNode.data.inputs.continue_condition?.value).toBeNull();
- expect(returnNode.data.inputs.state?.value).toBeNull();
- expect(workflow.edges).toHaveLength(2);
- expect(workflow.edges[0]).toMatchObject({
- type: 'default',
- source: 'for',
- sourceHandle: 'item',
- target: 'return',
- targetHandle: 'output',
- });
- expect(workflow.edges[1]).toMatchObject({
- type: 'loop_linkage',
- source: 'for',
- sourceHandle: 'loop_linkage',
- target: 'return',
- targetHandle: 'loop_linkage',
- });
- const resolvedForTemplate = loopTemplates[forNode.data.type];
- if (!resolvedForTemplate) {
- throw new Error('Expected the round-tripped For node type to resolve its template');
- }
- expect(getOutputFieldNamesByScope(Object.values(resolvedForTemplate.outputs))).toEqual({
- all: ['loop_linkage', 'item', 'index', 'total', 'state', 'output_collection', 'final_state'],
- unscoped: ['loop_linkage'],
- iteration: ['item', 'index', 'total', 'state'],
- final: ['output_collection', 'final_state'],
- });
-
- const rootState = {
- nodes: {
- past: [],
- future: [],
- present: {
- _version: 1,
- formFieldInitialValues: {},
- ...workflow,
- },
- },
- gallery: {
- autoAddBoardId: 'none',
- },
- } as never;
- const rebuiltGraph = buildNodesGraph(rootState, loopTemplates);
-
- expect(rebuiltGraph.nodes.for).toMatchObject({
- type: 'for',
- collection: ['alpha', 'beta'],
- state: null,
- });
- expect(rebuiltGraph.nodes.return).toMatchObject({
- type: 'for_return',
- state: null,
- continue_condition: null,
- });
- expect(rebuiltGraph.edges).toEqual(graph.edges);
- });
-
- it('normalizes a default graph edge between loop linkage fields', () => {
- const workflow = graphToWorkflow(
- {
- id: 'graph',
- nodes: {
- for: { id: 'for', type: 'for', collection: [], state: null },
- return: { id: 'return', type: 'for_return', output: null, state: null, continue_condition: true },
- },
- edges: [
- {
- type: 'default',
- source: { node_id: 'for', field: 'loop_linkage' },
- destination: { node_id: 'return', field: 'loop_linkage' },
- },
- ],
- } satisfies NonNullableGraph,
- false
- );
-
- expect(workflow.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- source: 'for',
- sourceHandle: 'loop_linkage',
- target: 'return',
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
});
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.ts
index 037f464631..a55e13e094 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/graphToWorkflow.ts
@@ -2,7 +2,6 @@ import * as dagre from '@dagrejs/dagre';
import { logger } from 'app/logging/logger';
import { forEach } from 'es-toolkit/compat';
import { $templates } from 'features/nodes/store/nodesSlice';
-import { getEdgeTypeFromHandles } from 'features/nodes/store/util/reactFlowUtil';
import { NODE_WIDTH } from 'features/nodes/types/constants';
import { nodeAcceptsExtraInputs } from 'features/nodes/types/extraInputs';
import type { FieldInputInstance, FieldInputTemplate } from 'features/nodes/types/field';
@@ -123,10 +122,7 @@ export const graphToWorkflow = (graph: NonNullableGraph, autoLayout = true): Wor
forEach(graph.edges, (edge) => {
workflow.edges.push({
id: uuidv4(), // we don't have edge IDs in the graph
- type:
- edge.type === 'loop_linkage'
- ? 'loop_linkage'
- : getEdgeTypeFromHandles(edge.source.field, edge.destination.field),
+ type: 'default',
source: edge.source.node_id,
sourceHandle: edge.source.field,
target: edge.destination.node_id,
@@ -171,11 +167,9 @@ export const graphToWorkflow = (graph: NonNullableGraph, autoLayout = true): Wor
dagreGraph.setNode(node.id, { width, height });
});
- graph.edges
- .filter((edge) => edge.type !== 'loop_linkage')
- .forEach((edge) => {
- dagreGraph.setEdge(edge.source.node_id, edge.destination.node_id);
- });
+ graph.edges.forEach((edge) => {
+ dagreGraph.setEdge(edge.source.node_id, edge.destination.node_id);
+ });
// This does the magic
dagre.layout(dagreGraph);
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.test.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.test.ts
index 0316f9cd76..7d5abf34e5 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.test.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.test.ts
@@ -4,8 +4,6 @@ import { CONNECTOR_INPUT_HANDLE, CONNECTOR_OUTPUT_HANDLE } from 'features/nodes/
import {
add,
call_saved_workflow,
- for_loop,
- for_return,
img_resize,
main_model_loader,
workflow_return,
@@ -701,236 +699,4 @@ describe('validateWorkflow', () => {
expect(validationResult.warnings.length).toBe(1);
});
-
- it('should remove the internal For index from a loaded workflow', async () => {
- const forNode = buildInvocationNode({ x: 0, y: 0 }, for_loop);
- forNode.data.inputs.index = {
- name: 'index',
- label: '',
- description: '',
- value: -1,
- };
- const workflow: WorkflowV3 = {
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- form: getDefaultForm(),
- meta: { version: '4.0.0', category: 'user' },
- nodes: [forNode],
- edges: [],
- };
-
- const validationResult = await validateWorkflow({
- workflow,
- templates: { for: for_loop },
- checkImageAccess: resolveTrue,
- checkVideoAccess: resolveTrue,
- checkBoardAccess: resolveTrue,
- checkModelAccess: resolveTrue,
- });
-
- expect(validationResult.warnings).toEqual([]);
- expect(validationResult.workflow.nodes[0]?.type).toBe('invocation');
- if (validationResult.workflow.nodes[0]?.type !== 'invocation') {
- throw new Error('expected an invocation node');
- }
- expect(validationResult.workflow.nodes[0].data.inputs.index).toBeUndefined();
- });
-
- it('should remove malformed loop linkage edges instead of treating them as data edges', async () => {
- const forNode = buildInvocationNode({ x: 0, y: 0 }, for_loop);
- const returnNode = buildInvocationNode({ x: 0, y: 0 }, for_return);
- const workflow: WorkflowV3 = {
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- form: getDefaultForm(),
- meta: { version: '4.0.0', category: 'user' },
- nodes: [forNode, returnNode],
- edges: [
- {
- id: 'malformed-loop-linkage',
- type: 'loop_linkage',
- source: forNode.id,
- sourceHandle: 'item',
- target: returnNode.id,
- targetHandle: 'output',
- },
- ],
- };
-
- const validationResult = await validateWorkflow({
- workflow,
- templates: { for: for_loop, for_return },
- checkImageAccess: resolveTrue,
- checkVideoAccess: resolveTrue,
- checkBoardAccess: resolveTrue,
- checkModelAccess: resolveTrue,
- });
-
- expect(validationResult.workflow.edges).toEqual([]);
- expect(validationResult.warnings).toHaveLength(1);
- });
-
- it('should normalize a stale default edge between loop linkage handles', async () => {
- const forNode = buildInvocationNode({ x: 0, y: 0 }, for_loop);
- const returnNode = buildInvocationNode({ x: 0, y: 0 }, for_return);
- const workflow: WorkflowV3 = {
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- form: getDefaultForm(),
- meta: { version: '4.0.0', category: 'user' },
- nodes: [forNode, returnNode],
- edges: [
- {
- id: 'stale-loop-linkage',
- type: 'default',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- ],
- };
-
- const validationResult = await validateWorkflow({
- workflow,
- templates: { for: for_loop, for_return },
- checkImageAccess: resolveTrue,
- checkVideoAccess: resolveTrue,
- checkBoardAccess: resolveTrue,
- checkModelAccess: resolveTrue,
- });
-
- expect(validationResult.warnings).toEqual([]);
- expect(validationResult.workflow.edges).toEqual([
- expect.objectContaining({
- type: 'loop_linkage',
- sourceHandle: 'loop_linkage',
- targetHandle: 'loop_linkage',
- }),
- ]);
- });
-
- it('should preserve a connector loop linkage alias regardless of edge order', async () => {
- const forNode = buildInvocationNode({ x: 0, y: 0 }, for_loop);
- const connectorNode = buildConnectorNode('connector-1');
- const returnNode = buildInvocationNode({ x: 0, y: 0 }, for_return);
- const workflow: WorkflowV3 = {
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- form: getDefaultForm(),
- meta: { version: '4.0.0', category: 'user' },
- nodes: [forNode, connectorNode, returnNode],
- edges: [
- {
- id: 'linkage-output',
- type: 'default',
- source: connectorNode.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- {
- id: 'linkage-input',
- type: 'default',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: connectorNode.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- ],
- };
-
- const validationResult = await validateWorkflow({
- workflow,
- templates: { for: for_loop, for_return },
- checkImageAccess: resolveTrue,
- checkVideoAccess: resolveTrue,
- checkBoardAccess: resolveTrue,
- checkModelAccess: resolveTrue,
- });
-
- expect(validationResult.warnings).toEqual([]);
- expect(validationResult.workflow.edges).toEqual(workflow.edges);
- });
-
- it('should remove a connector alias that duplicates a direct linkage regardless of edge order', async () => {
- const forNode = buildInvocationNode({ x: 0, y: 0 }, for_loop);
- const connectorNode = buildConnectorNode('connector-1');
- const returnNode = buildInvocationNode({ x: 0, y: 0 }, for_return);
- const directLinkage = {
- id: 'direct-linkage',
- type: 'loop_linkage' as const,
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- };
- const workflow: WorkflowV3 = {
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- form: getDefaultForm(),
- meta: { version: '4.0.0', category: 'user' },
- nodes: [forNode, connectorNode, returnNode],
- edges: [
- {
- id: 'linkage-output',
- type: 'default',
- source: connectorNode.id,
- sourceHandle: CONNECTOR_OUTPUT_HANDLE,
- target: returnNode.id,
- targetHandle: 'loop_linkage',
- },
- directLinkage,
- {
- id: 'linkage-input',
- type: 'default',
- source: forNode.id,
- sourceHandle: 'loop_linkage',
- target: connectorNode.id,
- targetHandle: CONNECTOR_INPUT_HANDLE,
- },
- ],
- };
-
- const validationResult = await validateWorkflow({
- workflow,
- templates: { for: for_loop, for_return },
- checkImageAccess: resolveTrue,
- checkVideoAccess: resolveTrue,
- checkBoardAccess: resolveTrue,
- checkModelAccess: resolveTrue,
- });
-
- expect(validationResult.workflow.edges).toEqual([directLinkage]);
- });
});
diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts
index 53fc025d43..4775b2cfc4 100644
--- a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts
+++ b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts
@@ -3,14 +3,7 @@ import { getSavedWorkflowDynamicFields } from 'features/nodes/components/flow/no
import { addElement, getIsFormEmpty } from 'features/nodes/components/sidePanel/builder/form-manipulation';
import { CALL_SAVED_WORKFLOW_DYNAMIC_FIELD_PREFIX } from 'features/nodes/store/nodesSlice';
import type { Templates } from 'features/nodes/store/types';
-import {
- CONNECTOR_OUTPUT_HANDLE,
- resolveConnectorSource,
- resolveLoopLinkagePath,
-} from 'features/nodes/store/util/connectorTopology';
-import { getEdgeTypeFromHandles, isLoopLinkageEdge } from 'features/nodes/store/util/reactFlowUtil';
import { validateConnection } from 'features/nodes/store/util/validateConnection';
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
import { nodeAcceptsExtraInputs } from 'features/nodes/types/extraInputs';
import {
isBoardFieldInputInstance,
@@ -20,7 +13,7 @@ import {
isModelIdentifierFieldInputInstance,
isVideoFieldInputInstance,
} from 'features/nodes/types/field';
-import { getInvocationNodeInputTemplate, isConnectorNode } from 'features/nodes/types/invocation';
+import { getInvocationNodeInputTemplate } from 'features/nodes/types/invocation';
import type { WorkflowV3 } from 'features/nodes/types/workflow';
import {
buildNodeFieldElement,
@@ -157,12 +150,7 @@ export const validateWorkflow = async (args: ValidateWorkflowArgs): Promise<Vali
await refreshCallSavedWorkflowDynamicInputs({ workflow: _workflow, templates, getWorkflow, warnings });
- for (const rawEdge of edges) {
- const edge =
- rawEdge.type === 'default' &&
- getEdgeTypeFromHandles(rawEdge.sourceHandle, rawEdge.targetHandle) === 'loop_linkage'
- ? { ...rawEdge, type: 'loop_linkage' as const }
- : rawEdge;
+ for (const edge of edges) {
// Validate each edge. If the edge is invalid, we must remove it to prevent runtime errors with reactflow.
const sourceNode = nodes.find(({ id }) => id === edge.source);
const targetNode = nodes.find(({ id }) => id === edge.target);
@@ -218,19 +206,6 @@ export const validateWorkflow = async (args: ValidateWorkflowArgs): Promise<Vali
);
}
- if (
- !issues.length &&
- edge.type === 'loop_linkage' &&
- (edge.sourceHandle !== LOOP_LINKAGE_FIELD ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- sourceNode?.type !== 'invocation' ||
- sourceNode.data.type !== 'for' ||
- targetNode?.type !== 'invocation' ||
- targetNode.data.type !== 'for_return')
- ) {
- issues.push(t('nodes.forLoopLinkageInvalid'));
- }
-
if (
targetNode &&
isWorkflowInvocationNode(targetNode) &&
@@ -247,7 +222,7 @@ export const validateWorkflow = async (args: ValidateWorkflowArgs): Promise<Vali
);
}
- if (!issues.length && (edge.type === 'default' || edge.type === 'loop_linkage')) {
+ if (!issues.length && edge.type === 'default') {
const connectionError = validateConnection(edge, nodes, validEdges, templates, null, true);
if (connectionError) {
issues.push(connectionError);
@@ -268,54 +243,7 @@ export const validateWorkflow = async (args: ValidateWorkflowArgs): Promise<Vali
}
// Remove invalid edges before node updates so migrations only trust surviving connections.
- const invalidConnectorLinkageEdgeIds = new Set<string>();
- const linkedForIds = new Set(validEdges.filter(isLoopLinkageEdge).map((edge) => edge.source));
- const linkedReturnIds = new Set(validEdges.filter(isLoopLinkageEdge).map((edge) => edge.target));
- for (const edge of edges) {
- if (
- edge.type !== 'default' ||
- edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
- edge.targetHandle !== LOOP_LINKAGE_FIELD ||
- !isConnectorNode(nodes.find((node) => node.id === edge.source))
- ) {
- continue;
- }
-
- const resolvedSource = resolveConnectorSource(edge.source, nodes, edges);
- if (!resolvedSource) {
- continue;
- }
-
- const path = resolveLoopLinkagePath(edge, nodes, edges);
- if (!path) {
- invalidConnectorLinkageEdgeIds.add(edge.id);
- warnings.push({
- message: t('nodes.deletedInvalidEdge', {
- source: `${edge.source}.${edge.sourceHandle}`,
- target: `${edge.target}.${edge.targetHandle}`,
- }),
- issues: [t('nodes.forLoopLinkageInvalid')],
- data: edge,
- });
- continue;
- }
- if (linkedForIds.has(path.forNodeId) || linkedReturnIds.has(path.returnNodeId)) {
- path.edgeIds.forEach((edgeId) => invalidConnectorLinkageEdgeIds.add(edgeId));
- warnings.push({
- message: t('nodes.deletedInvalidEdge', {
- source: `${edge.source}.${edge.sourceHandle}`,
- target: `${edge.target}.${edge.targetHandle}`,
- }),
- issues: [t('nodes.forLoopLinkageDuplicate')],
- data: edge,
- });
- continue;
- }
- linkedForIds.add(path.forNodeId);
- linkedReturnIds.add(path.returnNodeId);
- }
-
- _workflow.edges = validEdges.filter((edge) => !invalidConnectorLinkageEdgeIds.has(edge.id));
+ _workflow.edges = validEdges;
for (const node of nodes) {
if (!isWorkflowInvocationNode(node)) {
@@ -355,12 +283,6 @@ export const validateWorkflow = async (args: ValidateWorkflowArgs): Promise<Vali
}
}
- // Prepared For executions carry an internal index input that is not part of the editable workflow template.
- // Strip it when loading so an execution artifact cannot become an "unexpected field" in the editor.
- if (node.data.type === 'for') {
- delete node.data.inputs.index;
- }
-
for (const input of Object.values(node.data.inputs)) {
const fieldTemplate = getInvocationNodeInputTemplate(node.data, template, input.name);
diff --git a/invokeai/frontend/web/src/features/queue/store/readiness.test.ts b/invokeai/frontend/web/src/features/queue/store/readiness.test.ts
index 4fdaa659f2..ca81039bf9 100644
--- a/invokeai/frontend/web/src/features/queue/store/readiness.test.ts
+++ b/invokeai/frontend/web/src/features/queue/store/readiness.test.ts
@@ -8,22 +8,13 @@ vi.mock('i18next', () => ({
default: {
t: (key: string) => key,
},
- t: (key: string) => key,
}));
-import type { AppStore } from 'app/store/store';
import type { ParamsState, RefImagesState } from 'features/controlLayers/store/types';
import type { DynamicPromptsState } from 'features/dynamicPrompts/store/dynamicPromptsSlice';
-import type { NodesState } from 'features/nodes/store/types';
-import { add, buildEdge, buildNode, for_loop, templates } from 'features/nodes/store/util/testUtils';
-import type { WorkflowSettingsState } from 'features/nodes/store/workflowSettingsSlice';
import type { AnyModelConfig, MainModelConfig } from 'services/api/types';
-import {
- getReasonsWhyCannotEnqueueCanvasTab,
- getReasonsWhyCannotEnqueueGenerateTab,
- getReasonsWhyCannotEnqueueWorkflowsTab,
-} from './readiness';
+import { getReasonsWhyCannotEnqueueCanvasTab, getReasonsWhyCannotEnqueueGenerateTab } from './readiness';
// --- Fixtures ---
@@ -253,58 +244,6 @@ describe('FLUX.2 Klein readiness checks – generate tab', () => {
});
});
-describe('workflow readiness checks', () => {
- it('blocks Invoke when the workflow graph has an invalid For topology', async () => {
- const forNode = buildNode(for_loop);
- const bodyNode = buildNode(add);
- const nodesState = {
- _version: 1,
- nodes: [forNode, bodyNode],
- edges: [buildEdge(forNode.id, 'item', bodyNode.id, 'a')],
- formFieldInitialValues: {},
- id: undefined,
- name: '',
- author: '',
- description: '',
- version: '',
- contact: '',
- tags: '',
- notes: '',
- exposedFields: [],
- meta: { version: '4.0.0', category: 'user' },
- form: {
- rootElementId: 'root',
- elements: {
- root: {
- id: 'root',
- type: 'container',
- data: { layout: 'column', children: [] },
- },
- },
- },
- } as unknown as NodesState;
- const rootState = {
- nodes: { present: nodesState },
- gallery: { autoAddBoardId: 'none', selection: [] },
- };
- const store = {
- dispatch: vi.fn(),
- getState: () => rootState,
- } as unknown as AppStore;
-
- const reasons = await getReasonsWhyCannotEnqueueWorkflowsTab({
- dispatch: store.dispatch,
- nodesState,
- workflowSettingsState: { shouldValidateGraph: true } as WorkflowSettingsState,
- isConnected: true,
- templates: { ...templates, for: for_loop },
- store,
- });
-
- expect(reasons).toContainEqual({ content: 'nodes.forLoopLinkageMissing' });
- });
-});
-
describe('FLUX.2 Klein SDNQ pipeline readiness checks', () => {
it('generate: no errors for a full SDNQ pipeline (self-contained) with no component sources', () => {
const reasons = getReasonsWhyCannotEnqueueGenerateTab(buildGenerateTabArg({ model: flux2SdnqPipelineModel }));
diff --git a/invokeai/frontend/web/src/features/queue/store/readiness.ts b/invokeai/frontend/web/src/features/queue/store/readiness.ts
index d8a9226baf..6de630b747 100644
--- a/invokeai/frontend/web/src/features/queue/store/readiness.ts
+++ b/invokeai/frontend/web/src/features/queue/store/readiness.ts
@@ -40,7 +40,6 @@ import { getInvocationNodeErrors } from 'features/nodes/store/util/fieldValidato
import type { WorkflowSettingsState } from 'features/nodes/store/workflowSettingsSlice';
import { selectWorkflowSettingsSlice } from 'features/nodes/store/workflowSettingsSlice';
import { isBatchNode, isExecutableNode, isInvocationNode } from 'features/nodes/types/invocation';
-import { buildNodesGraph } from 'features/nodes/util/graph/buildNodesGraph';
import { resolveBatchValue } from 'features/nodes/util/node/resolveBatchValue';
import type { UpscaleState } from 'features/parameters/store/upscaleSlice';
import { selectUpscaleSlice } from 'features/parameters/store/upscaleSlice';
@@ -198,7 +197,6 @@ const debouncedUpdateReasons = debounce(async (arg: UpdateReasonsArg) => {
workflowSettingsState: workflowSettings,
isConnected,
templates,
- store,
});
$reasonsWhyCannotEnqueue.set(reasons);
} else if (tab === 'upscaling') {
@@ -616,30 +614,20 @@ export const getReasonsWhyCannotEnqueueGenerateTab = (arg: {
return reasons;
};
-export const getReasonsWhyCannotEnqueueWorkflowsTab = async (arg: {
+const getReasonsWhyCannotEnqueueWorkflowsTab = async (arg: {
dispatch: AppDispatch;
nodesState: NodesState;
workflowSettingsState: WorkflowSettingsState;
isConnected: boolean;
templates: Templates;
- store: AppStore;
}): Promise<Reason[]> => {
- const { dispatch, nodesState, workflowSettingsState, isConnected, templates, store } = arg;
+ const { dispatch, nodesState, workflowSettingsState, isConnected, templates } = arg;
const reasons: Reason[] = [];
if (!isConnected) {
reasons.push(disconnectedReason(i18n.t));
}
- // Queue submission always builds and validates this graph, regardless of the optional field
- // validation setting. Run the same validation here so an invalid loop cannot leave Invoke
- // enabled only to fail inside the click handler.
- try {
- buildNodesGraph(store.getState(), templates);
- } catch (error) {
- reasons.push({ content: error instanceof Error ? error.message : String(error) });
- }
-
if (workflowSettingsState.shouldValidateGraph) {
const { nodes, edges } = nodesState;
const invocationNodes = nodes.filter(isInvocationNode);
diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts
index 7219615714..308287d9ec 100644
--- a/invokeai/frontend/web/src/services/api/schema.ts
+++ b/invokeai/frontend/web/src/services/api/schema.ts
@@ -7425,171 +7425,6 @@ export type components = {
*/
type: "collect_output";
};
- /**
- * Cartesian Product of Collections
- * @description Emits every pair formed by one item from each collection, up to 100,000 pairs.
- */
- CollectionCartesianInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * First
- * @description The first collection
- * @default []
- */
- first?: unknown[];
- /**
- * Second
- * @description The second collection
- * @default []
- */
- second?: unknown[];
- /**
- * type
- * @default collection_cartesian
- * @constant
- */
- type: "collection_cartesian";
- };
- /** CollectionCartesianInvocationOutput */
- CollectionCartesianInvocationOutput: {
- /**
- * Collection
- * @description The Cartesian product pairs
- */
- collection: unknown[];
- /**
- * type
- * @default collection_cartesian_output
- * @constant
- */
- type: "collection_cartesian_output";
- };
- /**
- * Concatenate Collections
- * @description Concatenates two collections in left-to-right order.
- */
- CollectionConcatInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * First
- * @description The first collection
- * @default []
- */
- first?: unknown[];
- /**
- * Second
- * @description The second collection
- * @default []
- */
- second?: unknown[];
- /**
- * type
- * @default collection_concat
- * @constant
- */
- type: "collection_concat";
- };
- /** CollectionConcatInvocationOutput */
- CollectionConcatInvocationOutput: {
- /**
- * Collection
- * @description The concatenated collection
- */
- collection: unknown[];
- /**
- * type
- * @default collection_concat_output
- * @constant
- */
- type: "collection_concat_output";
- };
- /**
- * Zip Collections
- * @description Pairs items at matching positions from two equally sized collections.
- */
- CollectionZipInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * First
- * @description The first collection
- * @default []
- */
- first?: unknown[];
- /**
- * Second
- * @description The second collection
- * @default []
- */
- second?: unknown[];
- /**
- * type
- * @default collection_zip
- * @constant
- */
- type: "collection_zip";
- };
- /** CollectionZipInvocationOutput */
- CollectionZipInvocationOutput: {
- /**
- * Collection
- * @description The positional pairs
- */
- collection: unknown[];
- /**
- * type
- * @default collection_zip_output
- * @constant
- */
- type: "collection_zip_output";
- };
/**
* ColorCollectionOutput
* @description Base class for nodes that output a collection of colors
@@ -10774,13 +10609,6 @@ export type components = {
};
/** Edge */
Edge: {
- /**
- * Type
- * @description The kind of relationship represented by this edge
- * @default default
- * @enum {string}
- */
- type?: "default" | "loop_linkage";
/** @description The connection for the edge's from node and field */
source: components["schemas"]["EdgeConnection"];
/** @description The connection for the edge's to node and field */
@@ -14724,164 +14552,6 @@ export type components = {
* @enum {string}
*/
FluxVariantType: "schnell" | "dev" | "dev_fill";
- /** ForInvocation */
- ForInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * Collection
- * @description The list of items to iterate over
- * @default []
- */
- collection?: unknown[];
- /**
- * @description Optional initial loop state
- * @default null
- */
- state?: components["schemas"]["LoopState"] | null;
- /**
- * Index
- * @description The internal iteration index for a prepared For execution node
- * @default -1
- */
- index?: number;
- /**
- * type
- * @default for
- * @constant
- */
- type: "for";
- };
- /** ForInvocationOutput */
- ForInvocationOutput: {
- /**
- * Loop Linkage
- * @description The loop linkage to the matching ForReturn
- */
- loop_linkage: unknown;
- /**
- * Collection Item
- * @description The item for the current loop iteration, or None when the collection is empty
- * @default null
- */
- item: unknown | null;
- /**
- * Index
- * @description The index for the current loop iteration
- */
- index: number;
- /**
- * Total
- * @description The total number of items in the loop collection
- */
- total: number;
- /**
- * State
- * @description The state for the current loop iteration
- */
- state: components["schemas"]["LoopState"];
- /**
- * Output Collection
- * @description The collected loop body outputs
- */
- output_collection: unknown[];
- /**
- * Final State
- * @description The final loop state
- */
- final_state: components["schemas"]["LoopState"];
- /**
- * type
- * @default for_output
- * @constant
- */
- type: "for_output";
- };
- /** ForReturnInvocation */
- ForReturnInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * Loop Linkage
- * @description The loop linkage from the matching For
- * @default null
- */
- loop_linkage?: unknown | null;
- /**
- * Output
- * @description The output item to append to the loop output collection
- * @default null
- */
- output?: unknown | null;
- /**
- * @description The state to pass to the next loop iteration
- * @default null
- */
- state?: components["schemas"]["LoopState"] | null;
- /**
- * Continue Condition
- * @description Whether to schedule the next loop iteration; false finalizes the loop
- * @default true
- */
- continue_condition?: boolean | null;
- /**
- * type
- * @default for_return
- * @constant
- */
- type: "for_return";
- };
- /** ForReturnInvocationOutput */
- ForReturnInvocationOutput: {
- /**
- * Output
- * @description The output item to append to the loop output collection
- * @default null
- */
- output: unknown | null;
- /**
- * State
- * @description The state to pass to the next loop iteration
- * @default null
- */
- state: components["schemas"]["LoopState"] | null;
- /**
- * type
- * @default for_return_output
- * @constant
- */
- type: "for_return_output";
- };
/** FoundModel */
FoundModel: {
/**
@@ -15589,7 +15259,7 @@ export type components = {
* @description The nodes in this graph
*/
nodes?: {
- [key: string]: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CollectionCartesianInvocation"] | components["schemas"]["CollectionConcatInvocation"] | components["schemas"]["CollectionZipInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["ForInvocation"] | components["schemas"]["ForReturnInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StateEmptyInvocation"] | components["schemas"]["StateGetInvocation"] | components["schemas"]["StateMergeInvocation"] | components["schemas"]["StateSetInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ [key: string]: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
};
/**
* Edges
@@ -15626,7 +15296,7 @@ export type components = {
* @description The results of node executions
*/
results: {
- [key: string]: components["schemas"]["AnimaConditioningOutput"] | components["schemas"]["AnimaLLLiteOutput"] | components["schemas"]["AnimaLoRALoaderOutput"] | components["schemas"]["AnimaModelLoaderOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["BoundingBoxCollectionOutput"] | components["schemas"]["BoundingBoxOutput"] | components["schemas"]["CLIPOutput"] | components["schemas"]["CLIPSkipInvocationOutput"] | components["schemas"]["CalculateImageTilesOutput"] | components["schemas"]["CogView4ConditioningOutput"] | components["schemas"]["CogView4ModelLoaderOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["CollectionCartesianInvocationOutput"] | components["schemas"]["CollectionConcatInvocationOutput"] | components["schemas"]["CollectionZipInvocationOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["ErnieImageConditioningOutput"] | components["schemas"]["ErnieImageModelLoaderOutput"] | components["schemas"]["ExtractVideoRangeOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FloatGeneratorOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["Flux2DevLoRALoaderOutput"] | components["schemas"]["Flux2DevModelLoaderOutput"] | components["schemas"]["Flux2KleinLoRALoaderOutput"] | components["schemas"]["Flux2KleinModelLoaderOutput"] | components["schemas"]["FluxConditioningCollectionOutput"] | components["schemas"]["FluxConditioningOutput"] | components["schemas"]["FluxControlLoRALoaderOutput"] | components["schemas"]["FluxControlNetOutput"] | components["schemas"]["FluxFillOutput"] | components["schemas"]["FluxKontextOutput"] | components["schemas"]["FluxLoRALoaderOutput"] | components["schemas"]["FluxModelLoaderOutput"] | components["schemas"]["FluxReduxOutput"] | components["schemas"]["ForInvocationOutput"] | components["schemas"]["ForReturnInvocationOutput"] | components["schemas"]["Gemma2EncoderOutput"] | components["schemas"]["GradientMaskOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["IdealSizeOutput"] | components["schemas"]["Ideogram4ConditioningOutput"] | components["schemas"]["Ideogram4ModelLoaderOutput"] | components["schemas"]["IfInvocationOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ImageGeneratorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ImagePanelCoordinateOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["IntegerGeneratorOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["Krea2ConditioningOutput"] | components["schemas"]["Krea2LoRALoaderOutput"] | components["schemas"]["Krea2ModelLoaderOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["LatentsMetaOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["LoRALoaderOutput"] | components["schemas"]["LoRASelectorOutput"] | components["schemas"]["LoopStateOutput"] | components["schemas"]["LoopStateValueOutput"] | components["schemas"]["MDControlListOutput"] | components["schemas"]["MDIPAdapterListOutput"] | components["schemas"]["MDT2IAdapterListOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["MetadataItemOutput"] | components["schemas"]["MetadataOutput"] | components["schemas"]["MetadataToLorasCollectionOutput"] | components["schemas"]["MetadataToModelOutput"] | components["schemas"]["MetadataToSDXLModelOutput"] | components["schemas"]["MiniMaxH3ConditioningOutput"] | components["schemas"]["MiniMaxH3DenoiseOutput"] | components["schemas"]["MiniMaxH3FrameConditioningOutput"] | components["schemas"]["MiniMaxH3LoRACollectionLoaderOutput"] | components["schemas"]["MiniMaxH3LoRALoaderOutput"] | components["schemas"]["MiniMaxH3ModelLoaderOutput"] | components["schemas"]["MiniMaxH3ReferenceConditioningOutput"] | components["schemas"]["MiniMaxH3ReferenceMediaOutput"] | components["schemas"]["ModelIdentifierOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["PBRMapsOutput"] | components["schemas"]["PairTileImageOutput"] | components["schemas"]["PiDDecoderOutput"] | components["schemas"]["PromptTemplateOutput"] | components["schemas"]["QwenImageConditioningOutput"] | components["schemas"]["QwenImageLoRALoaderOutput"] | components["schemas"]["QwenImageModelLoaderOutput"] | components["schemas"]["SD3ConditioningOutput"] | components["schemas"]["SDXLLoRALoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["Sd3ModelLoaderOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["String2Output"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["StringGeneratorOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["TileToPropertiesOutput"] | components["schemas"]["UNetOutput"] | components["schemas"]["VAEOutput"] | components["schemas"]["VideoOutput"] | components["schemas"]["WanConditioningOutput"] | components["schemas"]["WanLoRALoaderOutput"] | components["schemas"]["WanModelLoaderOutput"] | components["schemas"]["WanRefImageOutput"] | components["schemas"]["WorkflowReturnGetOutput"] | components["schemas"]["WorkflowReturnOutput"] | components["schemas"]["WorkflowReturnValueOutput"] | components["schemas"]["ZImageConditioningOutput"] | components["schemas"]["ZImageControlOutput"] | components["schemas"]["ZImageLoRALoaderOutput"] | components["schemas"]["ZImageModelLoaderOutput"];
+ [key: string]: components["schemas"]["AnimaConditioningOutput"] | components["schemas"]["AnimaLLLiteOutput"] | components["schemas"]["AnimaLoRALoaderOutput"] | components["schemas"]["AnimaModelLoaderOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["BoundingBoxCollectionOutput"] | components["schemas"]["BoundingBoxOutput"] | components["schemas"]["CLIPOutput"] | components["schemas"]["CLIPSkipInvocationOutput"] | components["schemas"]["CalculateImageTilesOutput"] | components["schemas"]["CogView4ConditioningOutput"] | components["schemas"]["CogView4ModelLoaderOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["ErnieImageConditioningOutput"] | components["schemas"]["ErnieImageModelLoaderOutput"] | components["schemas"]["ExtractVideoRangeOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FloatGeneratorOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["Flux2DevLoRALoaderOutput"] | components["schemas"]["Flux2DevModelLoaderOutput"] | components["schemas"]["Flux2KleinLoRALoaderOutput"] | components["schemas"]["Flux2KleinModelLoaderOutput"] | components["schemas"]["FluxConditioningCollectionOutput"] | components["schemas"]["FluxConditioningOutput"] | components["schemas"]["FluxControlLoRALoaderOutput"] | components["schemas"]["FluxControlNetOutput"] | components["schemas"]["FluxFillOutput"] | components["schemas"]["FluxKontextOutput"] | components["schemas"]["FluxLoRALoaderOutput"] | components["schemas"]["FluxModelLoaderOutput"] | components["schemas"]["FluxReduxOutput"] | components["schemas"]["Gemma2EncoderOutput"] | components["schemas"]["GradientMaskOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["IdealSizeOutput"] | components["schemas"]["Ideogram4ConditioningOutput"] | components["schemas"]["Ideogram4ModelLoaderOutput"] | components["schemas"]["IfInvocationOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ImageGeneratorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ImagePanelCoordinateOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["IntegerGeneratorOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["Krea2ConditioningOutput"] | components["schemas"]["Krea2LoRALoaderOutput"] | components["schemas"]["Krea2ModelLoaderOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["LatentsMetaOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["LoRALoaderOutput"] | components["schemas"]["LoRASelectorOutput"] | components["schemas"]["MDControlListOutput"] | components["schemas"]["MDIPAdapterListOutput"] | components["schemas"]["MDT2IAdapterListOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["MetadataItemOutput"] | components["schemas"]["MetadataOutput"] | components["schemas"]["MetadataToLorasCollectionOutput"] | components["schemas"]["MetadataToModelOutput"] | components["schemas"]["MetadataToSDXLModelOutput"] | components["schemas"]["MiniMaxH3ConditioningOutput"] | components["schemas"]["MiniMaxH3DenoiseOutput"] | components["schemas"]["MiniMaxH3FrameConditioningOutput"] | components["schemas"]["MiniMaxH3LoRACollectionLoaderOutput"] | components["schemas"]["MiniMaxH3LoRALoaderOutput"] | components["schemas"]["MiniMaxH3ModelLoaderOutput"] | components["schemas"]["MiniMaxH3ReferenceConditioningOutput"] | components["schemas"]["MiniMaxH3ReferenceMediaOutput"] | components["schemas"]["ModelIdentifierOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["PBRMapsOutput"] | components["schemas"]["PairTileImageOutput"] | components["schemas"]["PiDDecoderOutput"] | components["schemas"]["PromptTemplateOutput"] | components["schemas"]["QwenImageConditioningOutput"] | components["schemas"]["QwenImageLoRALoaderOutput"] | components["schemas"]["QwenImageModelLoaderOutput"] | components["schemas"]["SD3ConditioningOutput"] | components["schemas"]["SDXLLoRALoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["Sd3ModelLoaderOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["String2Output"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["StringGeneratorOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["TileToPropertiesOutput"] | components["schemas"]["UNetOutput"] | components["schemas"]["VAEOutput"] | components["schemas"]["VideoOutput"] | components["schemas"]["WanConditioningOutput"] | components["schemas"]["WanLoRALoaderOutput"] | components["schemas"]["WanModelLoaderOutput"] | components["schemas"]["WanRefImageOutput"] | components["schemas"]["WorkflowReturnGetOutput"] | components["schemas"]["WorkflowReturnOutput"] | components["schemas"]["WorkflowReturnValueOutput"] | components["schemas"]["ZImageConditioningOutput"] | components["schemas"]["ZImageControlOutput"] | components["schemas"]["ZImageLoRALoaderOutput"] | components["schemas"]["ZImageModelLoaderOutput"];
};
/**
* Errors
@@ -15673,19 +15343,6 @@ export type components = {
source_prepared_mapping: {
[key: string]: string[];
};
- /**
- * Finalized Loop Nodes
- * @description Legacy set of top-level loop source nodes whose final outputs have been materialized
- */
- finalized_loop_nodes: string[];
- /**
- * Finalized Loop Contexts
- * @description The finalized loop source and parent iteration contexts
- */
- finalized_loop_contexts?: [
- string,
- number[]
- ][];
/**
* Prepared Iteration Paths
* @description The iteration coordinates of each prepared execution node
@@ -19790,7 +19447,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CollectionCartesianInvocation"] | components["schemas"]["CollectionConcatInvocation"] | components["schemas"]["CollectionZipInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["ForInvocation"] | components["schemas"]["ForReturnInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StateEmptyInvocation"] | components["schemas"]["StateGetInvocation"] | components["schemas"]["StateMergeInvocation"] | components["schemas"]["StateSetInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -19800,7 +19457,7 @@ export type components = {
* Result
* @description The result of the invocation
*/
- result: components["schemas"]["AnimaConditioningOutput"] | components["schemas"]["AnimaLLLiteOutput"] | components["schemas"]["AnimaLoRALoaderOutput"] | components["schemas"]["AnimaModelLoaderOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["BoundingBoxCollectionOutput"] | components["schemas"]["BoundingBoxOutput"] | components["schemas"]["CLIPOutput"] | components["schemas"]["CLIPSkipInvocationOutput"] | components["schemas"]["CalculateImageTilesOutput"] | components["schemas"]["CogView4ConditioningOutput"] | components["schemas"]["CogView4ModelLoaderOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["CollectionCartesianInvocationOutput"] | components["schemas"]["CollectionConcatInvocationOutput"] | components["schemas"]["CollectionZipInvocationOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["ErnieImageConditioningOutput"] | components["schemas"]["ErnieImageModelLoaderOutput"] | components["schemas"]["ExtractVideoRangeOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FloatGeneratorOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["Flux2DevLoRALoaderOutput"] | components["schemas"]["Flux2DevModelLoaderOutput"] | components["schemas"]["Flux2KleinLoRALoaderOutput"] | components["schemas"]["Flux2KleinModelLoaderOutput"] | components["schemas"]["FluxConditioningCollectionOutput"] | components["schemas"]["FluxConditioningOutput"] | components["schemas"]["FluxControlLoRALoaderOutput"] | components["schemas"]["FluxControlNetOutput"] | components["schemas"]["FluxFillOutput"] | components["schemas"]["FluxKontextOutput"] | components["schemas"]["FluxLoRALoaderOutput"] | components["schemas"]["FluxModelLoaderOutput"] | components["schemas"]["FluxReduxOutput"] | components["schemas"]["ForInvocationOutput"] | components["schemas"]["ForReturnInvocationOutput"] | components["schemas"]["Gemma2EncoderOutput"] | components["schemas"]["GradientMaskOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["IdealSizeOutput"] | components["schemas"]["Ideogram4ConditioningOutput"] | components["schemas"]["Ideogram4ModelLoaderOutput"] | components["schemas"]["IfInvocationOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ImageGeneratorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ImagePanelCoordinateOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["IntegerGeneratorOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["Krea2ConditioningOutput"] | components["schemas"]["Krea2LoRALoaderOutput"] | components["schemas"]["Krea2ModelLoaderOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["LatentsMetaOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["LoRALoaderOutput"] | components["schemas"]["LoRASelectorOutput"] | components["schemas"]["LoopStateOutput"] | components["schemas"]["LoopStateValueOutput"] | components["schemas"]["MDControlListOutput"] | components["schemas"]["MDIPAdapterListOutput"] | components["schemas"]["MDT2IAdapterListOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["MetadataItemOutput"] | components["schemas"]["MetadataOutput"] | components["schemas"]["MetadataToLorasCollectionOutput"] | components["schemas"]["MetadataToModelOutput"] | components["schemas"]["MetadataToSDXLModelOutput"] | components["schemas"]["MiniMaxH3ConditioningOutput"] | components["schemas"]["MiniMaxH3DenoiseOutput"] | components["schemas"]["MiniMaxH3FrameConditioningOutput"] | components["schemas"]["MiniMaxH3LoRACollectionLoaderOutput"] | components["schemas"]["MiniMaxH3LoRALoaderOutput"] | components["schemas"]["MiniMaxH3ModelLoaderOutput"] | components["schemas"]["MiniMaxH3ReferenceConditioningOutput"] | components["schemas"]["MiniMaxH3ReferenceMediaOutput"] | components["schemas"]["ModelIdentifierOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["PBRMapsOutput"] | components["schemas"]["PairTileImageOutput"] | components["schemas"]["PiDDecoderOutput"] | components["schemas"]["PromptTemplateOutput"] | components["schemas"]["QwenImageConditioningOutput"] | components["schemas"]["QwenImageLoRALoaderOutput"] | components["schemas"]["QwenImageModelLoaderOutput"] | components["schemas"]["SD3ConditioningOutput"] | components["schemas"]["SDXLLoRALoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["Sd3ModelLoaderOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["String2Output"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["StringGeneratorOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["TileToPropertiesOutput"] | components["schemas"]["UNetOutput"] | components["schemas"]["VAEOutput"] | components["schemas"]["VideoOutput"] | components["schemas"]["WanConditioningOutput"] | components["schemas"]["WanLoRALoaderOutput"] | components["schemas"]["WanModelLoaderOutput"] | components["schemas"]["WanRefImageOutput"] | components["schemas"]["WorkflowReturnGetOutput"] | components["schemas"]["WorkflowReturnOutput"] | components["schemas"]["WorkflowReturnValueOutput"] | components["schemas"]["ZImageConditioningOutput"] | components["schemas"]["ZImageControlOutput"] | components["schemas"]["ZImageLoRALoaderOutput"] | components["schemas"]["ZImageModelLoaderOutput"];
+ result: components["schemas"]["AnimaConditioningOutput"] | components["schemas"]["AnimaLLLiteOutput"] | components["schemas"]["AnimaLoRALoaderOutput"] | components["schemas"]["AnimaModelLoaderOutput"] | components["schemas"]["BooleanCollectionOutput"] | components["schemas"]["BooleanOutput"] | components["schemas"]["BoundingBoxCollectionOutput"] | components["schemas"]["BoundingBoxOutput"] | components["schemas"]["CLIPOutput"] | components["schemas"]["CLIPSkipInvocationOutput"] | components["schemas"]["CalculateImageTilesOutput"] | components["schemas"]["CogView4ConditioningOutput"] | components["schemas"]["CogView4ModelLoaderOutput"] | components["schemas"]["CollectInvocationOutput"] | components["schemas"]["ColorCollectionOutput"] | components["schemas"]["ColorOutput"] | components["schemas"]["ConditioningCollectionOutput"] | components["schemas"]["ConditioningOutput"] | components["schemas"]["ControlOutput"] | components["schemas"]["DenoiseMaskOutput"] | components["schemas"]["ErnieImageConditioningOutput"] | components["schemas"]["ErnieImageModelLoaderOutput"] | components["schemas"]["ExtractVideoRangeOutput"] | components["schemas"]["FaceMaskOutput"] | components["schemas"]["FaceOffOutput"] | components["schemas"]["FloatCollectionOutput"] | components["schemas"]["FloatGeneratorOutput"] | components["schemas"]["FloatOutput"] | components["schemas"]["Flux2DevLoRALoaderOutput"] | components["schemas"]["Flux2DevModelLoaderOutput"] | components["schemas"]["Flux2KleinLoRALoaderOutput"] | components["schemas"]["Flux2KleinModelLoaderOutput"] | components["schemas"]["FluxConditioningCollectionOutput"] | components["schemas"]["FluxConditioningOutput"] | components["schemas"]["FluxControlLoRALoaderOutput"] | components["schemas"]["FluxControlNetOutput"] | components["schemas"]["FluxFillOutput"] | components["schemas"]["FluxKontextOutput"] | components["schemas"]["FluxLoRALoaderOutput"] | components["schemas"]["FluxModelLoaderOutput"] | components["schemas"]["FluxReduxOutput"] | components["schemas"]["Gemma2EncoderOutput"] | components["schemas"]["GradientMaskOutput"] | components["schemas"]["IPAdapterOutput"] | components["schemas"]["IdealSizeOutput"] | components["schemas"]["Ideogram4ConditioningOutput"] | components["schemas"]["Ideogram4ModelLoaderOutput"] | components["schemas"]["IfInvocationOutput"] | components["schemas"]["ImageCollectionOutput"] | components["schemas"]["ImageGeneratorOutput"] | components["schemas"]["ImageOutput"] | components["schemas"]["ImagePanelCoordinateOutput"] | components["schemas"]["IntegerCollectionOutput"] | components["schemas"]["IntegerGeneratorOutput"] | components["schemas"]["IntegerOutput"] | components["schemas"]["IterateInvocationOutput"] | components["schemas"]["Krea2ConditioningOutput"] | components["schemas"]["Krea2LoRALoaderOutput"] | components["schemas"]["Krea2ModelLoaderOutput"] | components["schemas"]["LatentsCollectionOutput"] | components["schemas"]["LatentsMetaOutput"] | components["schemas"]["LatentsOutput"] | components["schemas"]["LoRALoaderOutput"] | components["schemas"]["LoRASelectorOutput"] | components["schemas"]["MDControlListOutput"] | components["schemas"]["MDIPAdapterListOutput"] | components["schemas"]["MDT2IAdapterListOutput"] | components["schemas"]["MaskOutput"] | components["schemas"]["MetadataItemOutput"] | components["schemas"]["MetadataOutput"] | components["schemas"]["MetadataToLorasCollectionOutput"] | components["schemas"]["MetadataToModelOutput"] | components["schemas"]["MetadataToSDXLModelOutput"] | components["schemas"]["MiniMaxH3ConditioningOutput"] | components["schemas"]["MiniMaxH3DenoiseOutput"] | components["schemas"]["MiniMaxH3FrameConditioningOutput"] | components["schemas"]["MiniMaxH3LoRACollectionLoaderOutput"] | components["schemas"]["MiniMaxH3LoRALoaderOutput"] | components["schemas"]["MiniMaxH3ModelLoaderOutput"] | components["schemas"]["MiniMaxH3ReferenceConditioningOutput"] | components["schemas"]["MiniMaxH3ReferenceMediaOutput"] | components["schemas"]["ModelIdentifierOutput"] | components["schemas"]["ModelLoaderOutput"] | components["schemas"]["NoiseOutput"] | components["schemas"]["PBRMapsOutput"] | components["schemas"]["PairTileImageOutput"] | components["schemas"]["PiDDecoderOutput"] | components["schemas"]["PromptTemplateOutput"] | components["schemas"]["QwenImageConditioningOutput"] | components["schemas"]["QwenImageLoRALoaderOutput"] | components["schemas"]["QwenImageModelLoaderOutput"] | components["schemas"]["SD3ConditioningOutput"] | components["schemas"]["SDXLLoRALoaderOutput"] | components["schemas"]["SDXLModelLoaderOutput"] | components["schemas"]["SDXLRefinerModelLoaderOutput"] | components["schemas"]["SchedulerOutput"] | components["schemas"]["Sd3ModelLoaderOutput"] | components["schemas"]["SeamlessModeOutput"] | components["schemas"]["String2Output"] | components["schemas"]["StringCollectionOutput"] | components["schemas"]["StringGeneratorOutput"] | components["schemas"]["StringOutput"] | components["schemas"]["StringPosNegOutput"] | components["schemas"]["T2IAdapterOutput"] | components["schemas"]["TileToPropertiesOutput"] | components["schemas"]["UNetOutput"] | components["schemas"]["VAEOutput"] | components["schemas"]["VideoOutput"] | components["schemas"]["WanConditioningOutput"] | components["schemas"]["WanLoRALoaderOutput"] | components["schemas"]["WanModelLoaderOutput"] | components["schemas"]["WanRefImageOutput"] | components["schemas"]["WorkflowReturnGetOutput"] | components["schemas"]["WorkflowReturnOutput"] | components["schemas"]["WorkflowReturnValueOutput"] | components["schemas"]["ZImageConditioningOutput"] | components["schemas"]["ZImageControlOutput"] | components["schemas"]["ZImageLoRALoaderOutput"] | components["schemas"]["ZImageModelLoaderOutput"];
};
/**
* InvocationErrorEvent
@@ -19854,7 +19511,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CollectionCartesianInvocation"] | components["schemas"]["CollectionConcatInvocation"] | components["schemas"]["CollectionZipInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["ForInvocation"] | components["schemas"]["ForReturnInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StateEmptyInvocation"] | components["schemas"]["StateGetInvocation"] | components["schemas"]["StateMergeInvocation"] | components["schemas"]["StateSetInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -19910,9 +19567,6 @@ export type components = {
cogview4_model_loader: components["schemas"]["CogView4ModelLoaderOutput"];
cogview4_text_encoder: components["schemas"]["CogView4ConditioningOutput"];
collect: components["schemas"]["CollectInvocationOutput"];
- collection_cartesian: components["schemas"]["CollectionCartesianInvocationOutput"];
- collection_concat: components["schemas"]["CollectionConcatInvocationOutput"];
- collection_zip: components["schemas"]["CollectionZipInvocationOutput"];
color: components["schemas"]["ColorOutput"];
color_correct: components["schemas"]["ImageOutput"];
color_map: components["schemas"]["ImageOutput"];
@@ -19980,8 +19634,6 @@ export type components = {
flux_text_encoder: components["schemas"]["FluxConditioningOutput"];
flux_vae_decode: components["schemas"]["ImageOutput"];
flux_vae_encode: components["schemas"]["LatentsOutput"];
- for: components["schemas"]["ForInvocationOutput"];
- for_return: components["schemas"]["ForReturnInvocationOutput"];
freeu: components["schemas"]["UNetOutput"];
gemini_image_generation: components["schemas"]["ImageCollectionOutput"];
gemma2_encoder_loader: components["schemas"]["Gemma2EncoderOutput"];
@@ -20153,10 +19805,6 @@ export type components = {
show_image: components["schemas"]["ImageOutput"];
spandrel_image_to_image: components["schemas"]["ImageOutput"];
spandrel_image_to_image_autoscale: components["schemas"]["ImageOutput"];
- state_empty: components["schemas"]["LoopStateOutput"];
- state_get: components["schemas"]["LoopStateValueOutput"];
- state_merge: components["schemas"]["LoopStateOutput"];
- state_set: components["schemas"]["LoopStateOutput"];
string: components["schemas"]["StringOutput"];
string_batch: components["schemas"]["StringOutput"];
string_collection: components["schemas"]["StringCollectionOutput"];
@@ -20259,7 +19907,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CollectionCartesianInvocation"] | components["schemas"]["CollectionConcatInvocation"] | components["schemas"]["CollectionZipInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["ForInvocation"] | components["schemas"]["ForReturnInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StateEmptyInvocation"] | components["schemas"]["StateGetInvocation"] | components["schemas"]["StateMergeInvocation"] | components["schemas"]["StateSetInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -20340,7 +19988,7 @@ export type components = {
* Invocation
* @description The ID of the invocation
*/
- invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["CollectionCartesianInvocation"] | components["schemas"]["CollectionConcatInvocation"] | components["schemas"]["CollectionZipInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["ForInvocation"] | components["schemas"]["ForReturnInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StateEmptyInvocation"] | components["schemas"]["StateGetInvocation"] | components["schemas"]["StateMergeInvocation"] | components["schemas"]["StateSetInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
+ invocation: components["schemas"]["AddInvocation"] | components["schemas"]["AlibabaCloudImageGenerationInvocation"] | components["schemas"]["AlphaMaskToTensorInvocation"] | components["schemas"]["AnimaDenoiseInvocation"] | components["schemas"]["AnimaDenoiseMetaInvocation"] | components["schemas"]["AnimaImageToLatentsInvocation"] | components["schemas"]["AnimaLLLiteInvocation"] | components["schemas"]["AnimaLatentsToImageInvocation"] | components["schemas"]["AnimaLoRACollectionLoader"] | components["schemas"]["AnimaLoRALoaderInvocation"] | components["schemas"]["AnimaModelLoaderInvocation"] | components["schemas"]["AnimaTextEncoderInvocation"] | components["schemas"]["ApplyMaskTensorToImageInvocation"] | components["schemas"]["ApplyMaskToImageInvocation"] | components["schemas"]["BlankImageInvocation"] | components["schemas"]["BlendLatentsInvocation"] | components["schemas"]["BooleanCollectionInvocation"] | components["schemas"]["BooleanInvocation"] | components["schemas"]["BoundingBoxInvocation"] | components["schemas"]["CLIPSkipInvocation"] | components["schemas"]["CV2InfillInvocation"] | components["schemas"]["CalculateImageTilesEvenSplitInvocation"] | components["schemas"]["CalculateImageTilesInvocation"] | components["schemas"]["CalculateImageTilesMinimumOverlapInvocation"] | components["schemas"]["CallSavedWorkflowInvocation"] | components["schemas"]["CannyEdgeDetectionInvocation"] | components["schemas"]["CanvasOutputInvocation"] | components["schemas"]["CanvasPasteBackInvocation"] | components["schemas"]["CanvasV2MaskAndCropInvocation"] | components["schemas"]["CenterPadCropInvocation"] | components["schemas"]["CogView4DenoiseInvocation"] | components["schemas"]["CogView4ImageToLatentsInvocation"] | components["schemas"]["CogView4LatentsToImageInvocation"] | components["schemas"]["CogView4ModelLoaderInvocation"] | components["schemas"]["CogView4TextEncoderInvocation"] | components["schemas"]["CollectInvocation"] | components["schemas"]["ColorCorrectInvocation"] | components["schemas"]["ColorInvocation"] | components["schemas"]["ColorMapInvocation"] | components["schemas"]["CompelInvocation"] | components["schemas"]["ConditioningCollectionInvocation"] | components["schemas"]["ConditioningInvocation"] | components["schemas"]["ContentShuffleInvocation"] | components["schemas"]["ControlNetInvocation"] | components["schemas"]["CoreMetadataInvocation"] | components["schemas"]["CreateDenoiseMaskInvocation"] | components["schemas"]["CreateGradientMaskInvocation"] | components["schemas"]["CropImageToBoundingBoxInvocation"] | components["schemas"]["CropLatentsCoreInvocation"] | components["schemas"]["CvInpaintInvocation"] | components["schemas"]["DWOpenposeDetectionInvocation"] | components["schemas"]["DecodeInvisibleWatermarkInvocation"] | components["schemas"]["DenoiseLatentsInvocation"] | components["schemas"]["DenoiseLatentsMetaInvocation"] | components["schemas"]["DepthAnythingDepthEstimationInvocation"] | components["schemas"]["DivideInvocation"] | components["schemas"]["DynamicPromptInvocation"] | components["schemas"]["ESRGANInvocation"] | components["schemas"]["ErnieImageDenoiseInvocation"] | components["schemas"]["ErnieImageModelLoaderInvocation"] | components["schemas"]["ErnieImagePromptEnhancerInvocation"] | components["schemas"]["ErnieImageTextEncoderInvocation"] | components["schemas"]["ErnieImageVaeDecodeInvocation"] | components["schemas"]["ExpandMaskWithFadeInvocation"] | components["schemas"]["ExtractVideoRangeInvocation"] | components["schemas"]["FLUXLoRACollectionLoader"] | components["schemas"]["FaceIdentifierInvocation"] | components["schemas"]["FaceMaskInvocation"] | components["schemas"]["FaceOffInvocation"] | components["schemas"]["FloatBatchInvocation"] | components["schemas"]["FloatCollectionInvocation"] | components["schemas"]["FloatGenerator"] | components["schemas"]["FloatInvocation"] | components["schemas"]["FloatLinearRangeInvocation"] | components["schemas"]["FloatMathInvocation"] | components["schemas"]["FloatToIntegerInvocation"] | components["schemas"]["Flux2DenoiseInvocation"] | components["schemas"]["Flux2DevLoRACollectionLoader"] | components["schemas"]["Flux2DevLoRALoaderInvocation"] | components["schemas"]["Flux2DevModelLoaderInvocation"] | components["schemas"]["Flux2DevTextEncoderInvocation"] | components["schemas"]["Flux2KleinLoRACollectionLoader"] | components["schemas"]["Flux2KleinLoRALoaderInvocation"] | components["schemas"]["Flux2KleinModelLoaderInvocation"] | components["schemas"]["Flux2KleinTextEncoderInvocation"] | components["schemas"]["Flux2PiDDecodeInvocation"] | components["schemas"]["Flux2VaeDecodeInvocation"] | components["schemas"]["Flux2VaeEncodeInvocation"] | components["schemas"]["FluxControlLoRALoaderInvocation"] | components["schemas"]["FluxControlNetInvocation"] | components["schemas"]["FluxDenoiseInvocation"] | components["schemas"]["FluxDenoiseLatentsMetaInvocation"] | components["schemas"]["FluxFillInvocation"] | components["schemas"]["FluxIPAdapterInvocation"] | components["schemas"]["FluxKontextConcatenateImagesInvocation"] | components["schemas"]["FluxKontextInvocation"] | components["schemas"]["FluxLoRALoaderInvocation"] | components["schemas"]["FluxModelLoaderInvocation"] | components["schemas"]["FluxPiDDecodeInvocation"] | components["schemas"]["FluxReduxInvocation"] | components["schemas"]["FluxTextEncoderInvocation"] | components["schemas"]["FluxVaeDecodeInvocation"] | components["schemas"]["FluxVaeEncodeInvocation"] | components["schemas"]["FreeUInvocation"] | components["schemas"]["GeminiImageGenerationInvocation"] | components["schemas"]["Gemma2EncoderLoaderInvocation"] | components["schemas"]["GetMaskBoundingBoxInvocation"] | components["schemas"]["GroundingDinoInvocation"] | components["schemas"]["HEDEdgeDetectionInvocation"] | components["schemas"]["HeuristicResizeInvocation"] | components["schemas"]["IPAdapterInvocation"] | components["schemas"]["IdealSizeInvocation"] | components["schemas"]["Ideogram4CaptionBuilderInvocation"] | components["schemas"]["Ideogram4DenoiseInvocation"] | components["schemas"]["Ideogram4LatentsToImageInvocation"] | components["schemas"]["Ideogram4ModelLoaderInvocation"] | components["schemas"]["Ideogram4TextEncoderInvocation"] | components["schemas"]["IfInvocation"] | components["schemas"]["ImageBatchInvocation"] | components["schemas"]["ImageBlurInvocation"] | components["schemas"]["ImageChannelInvocation"] | components["schemas"]["ImageChannelMultiplyInvocation"] | components["schemas"]["ImageChannelOffsetInvocation"] | components["schemas"]["ImageCollectionInvocation"] | components["schemas"]["ImageConvertInvocation"] | components["schemas"]["ImageCropInvocation"] | components["schemas"]["ImageGenerator"] | components["schemas"]["ImageHueAdjustmentInvocation"] | components["schemas"]["ImageInverseLerpInvocation"] | components["schemas"]["ImageInvocation"] | components["schemas"]["ImageLerpInvocation"] | components["schemas"]["ImageMaskToTensorInvocation"] | components["schemas"]["ImageMultiplyInvocation"] | components["schemas"]["ImageNSFWBlurInvocation"] | components["schemas"]["ImageNoiseInvocation"] | components["schemas"]["ImagePanelLayoutInvocation"] | components["schemas"]["ImagePasteInvocation"] | components["schemas"]["ImageResizeInvocation"] | components["schemas"]["ImageScaleInvocation"] | components["schemas"]["ImageToLatentsInvocation"] | components["schemas"]["ImageWatermarkInvocation"] | components["schemas"]["InfillColorInvocation"] | components["schemas"]["InfillPatchMatchInvocation"] | components["schemas"]["InfillTileInvocation"] | components["schemas"]["IntegerBatchInvocation"] | components["schemas"]["IntegerCollectionInvocation"] | components["schemas"]["IntegerGenerator"] | components["schemas"]["IntegerInvocation"] | components["schemas"]["IntegerMathInvocation"] | components["schemas"]["InvertTensorMaskInvocation"] | components["schemas"]["InvokeAdjustImageHuePlusInvocation"] | components["schemas"]["InvokeEquivalentAchromaticLightnessInvocation"] | components["schemas"]["InvokeImageBlendInvocation"] | components["schemas"]["InvokeImageCompositorInvocation"] | components["schemas"]["InvokeImageDilateOrErodeInvocation"] | components["schemas"]["InvokeImageEnhanceInvocation"] | components["schemas"]["InvokeImageValueThresholdsInvocation"] | components["schemas"]["IterateInvocation"] | components["schemas"]["Krea2ConditioningRebalanceInvocation"] | components["schemas"]["Krea2DenoiseInvocation"] | components["schemas"]["Krea2LoRACollectionLoader"] | components["schemas"]["Krea2LoRALoaderInvocation"] | components["schemas"]["Krea2ModelLoaderInvocation"] | components["schemas"]["Krea2SeedVarianceInvocation"] | components["schemas"]["Krea2TextEncoderInvocation"] | components["schemas"]["LaMaInfillInvocation"] | components["schemas"]["LatentsCollectionInvocation"] | components["schemas"]["LatentsInvocation"] | components["schemas"]["LatentsToImageInvocation"] | components["schemas"]["LineartAnimeEdgeDetectionInvocation"] | components["schemas"]["LineartEdgeDetectionInvocation"] | components["schemas"]["LlavaOnevisionVllmInvocation"] | components["schemas"]["LoRACollectionLoader"] | components["schemas"]["LoRALoaderInvocation"] | components["schemas"]["LoRASelectorInvocation"] | components["schemas"]["MLSDDetectionInvocation"] | components["schemas"]["MainModelLoaderInvocation"] | components["schemas"]["MaskCombineInvocation"] | components["schemas"]["MaskEdgeInvocation"] | components["schemas"]["MaskFromAlphaInvocation"] | components["schemas"]["MaskFromIDInvocation"] | components["schemas"]["MaskTensorToImageInvocation"] | components["schemas"]["MediaPipeFaceDetectionInvocation"] | components["schemas"]["MergeMetadataInvocation"] | components["schemas"]["MergeTilesToImageInvocation"] | components["schemas"]["MetadataFieldExtractorInvocation"] | components["schemas"]["MetadataFromImageInvocation"] | components["schemas"]["MetadataInvocation"] | components["schemas"]["MetadataItemInvocation"] | components["schemas"]["MetadataItemLinkedInvocation"] | components["schemas"]["MetadataToBoolCollectionInvocation"] | components["schemas"]["MetadataToBoolInvocation"] | components["schemas"]["MetadataToControlnetsInvocation"] | components["schemas"]["MetadataToFloatCollectionInvocation"] | components["schemas"]["MetadataToFloatInvocation"] | components["schemas"]["MetadataToIPAdaptersInvocation"] | components["schemas"]["MetadataToIntegerCollectionInvocation"] | components["schemas"]["MetadataToIntegerInvocation"] | components["schemas"]["MetadataToLorasCollectionInvocation"] | components["schemas"]["MetadataToLorasInvocation"] | components["schemas"]["MetadataToModelInvocation"] | components["schemas"]["MetadataToSDXLLorasInvocation"] | components["schemas"]["MetadataToSDXLModelInvocation"] | components["schemas"]["MetadataToSchedulerInvocation"] | components["schemas"]["MetadataToStringCollectionInvocation"] | components["schemas"]["MetadataToStringInvocation"] | components["schemas"]["MetadataToT2IAdaptersInvocation"] | components["schemas"]["MetadataToVAEInvocation"] | components["schemas"]["MiniMaxH3DenoiseInvocation"] | components["schemas"]["MiniMaxH3FrameConditioningInvocation"] | components["schemas"]["MiniMaxH3IdealDimensionsInvocation"] | components["schemas"]["MiniMaxH3ImageReferenceInvocation"] | components["schemas"]["MiniMaxH3LatentsToImageInvocation"] | components["schemas"]["MiniMaxH3LatentsToVideoInvocation"] | components["schemas"]["MiniMaxH3LoRACollectionLoader"] | components["schemas"]["MiniMaxH3LoRALoaderInvocation"] | components["schemas"]["MiniMaxH3ModelLoaderInvocation"] | components["schemas"]["MiniMaxH3ReferenceConditioningInvocation"] | components["schemas"]["MiniMaxH3TextEncoderInvocation"] | components["schemas"]["MiniMaxH3VideoReferenceInvocation"] | components["schemas"]["ModelIdentifierInvocation"] | components["schemas"]["MultiplyInvocation"] | components["schemas"]["NoiseInvocation"] | components["schemas"]["NormalMapInvocation"] | components["schemas"]["OklabUnsharpMaskInvocation"] | components["schemas"]["OklchImageHueAdjustmentInvocation"] | components["schemas"]["OpenAIImageGenerationInvocation"] | components["schemas"]["PBRMapsInvocation"] | components["schemas"]["PairTileImageInvocation"] | components["schemas"]["PasteImageIntoBoundingBoxInvocation"] | components["schemas"]["PiDDecoderLoaderInvocation"] | components["schemas"]["PiDUpscaleInvocation"] | components["schemas"]["PiDiNetEdgeDetectionInvocation"] | components["schemas"]["PromptTemplateInvocation"] | components["schemas"]["PromptsFromFileInvocation"] | components["schemas"]["QwenImageDenoiseInvocation"] | components["schemas"]["QwenImageImageToLatentsInvocation"] | components["schemas"]["QwenImageLatentsToImageInvocation"] | components["schemas"]["QwenImageLoRACollectionLoader"] | components["schemas"]["QwenImageLoRALoaderInvocation"] | components["schemas"]["QwenImageModelLoaderInvocation"] | components["schemas"]["QwenImagePiDDecodeInvocation"] | components["schemas"]["QwenImageTextEncoderInvocation"] | components["schemas"]["RandomFloatInvocation"] | components["schemas"]["RandomIntInvocation"] | components["schemas"]["RandomRangeInvocation"] | components["schemas"]["RangeInvocation"] | components["schemas"]["RangeOfSizeInvocation"] | components["schemas"]["RectangleMaskInvocation"] | components["schemas"]["ResizeLatentsInvocation"] | components["schemas"]["RoundInvocation"] | components["schemas"]["SD3DenoiseInvocation"] | components["schemas"]["SD3ImageToLatentsInvocation"] | components["schemas"]["SD3LatentsToImageInvocation"] | components["schemas"]["SD3PiDDecodeInvocation"] | components["schemas"]["SDXLCompelPromptInvocation"] | components["schemas"]["SDXLLoRACollectionLoader"] | components["schemas"]["SDXLLoRALoaderInvocation"] | components["schemas"]["SDXLModelLoaderInvocation"] | components["schemas"]["SDXLPiDDecodeInvocation"] | components["schemas"]["SDXLRefinerCompelPromptInvocation"] | components["schemas"]["SDXLRefinerModelLoaderInvocation"] | components["schemas"]["SaveImageInvocation"] | components["schemas"]["SaveImageToFileInvocation"] | components["schemas"]["ScaleLatentsInvocation"] | components["schemas"]["SchedulerInvocation"] | components["schemas"]["Sd3ModelLoaderInvocation"] | components["schemas"]["Sd3TextEncoderInvocation"] | components["schemas"]["SeamlessModeInvocation"] | components["schemas"]["SeedreamImageGenerationInvocation"] | components["schemas"]["SegmentAnythingInvocation"] | components["schemas"]["ShowImageInvocation"] | components["schemas"]["SpandrelImageToImageAutoscaleInvocation"] | components["schemas"]["SpandrelImageToImageInvocation"] | components["schemas"]["StringBatchInvocation"] | components["schemas"]["StringCollectionInvocation"] | components["schemas"]["StringGenerator"] | components["schemas"]["StringInvocation"] | components["schemas"]["StringJoinInvocation"] | components["schemas"]["StringJoinThreeInvocation"] | components["schemas"]["StringReplaceInvocation"] | components["schemas"]["StringSplitInvocation"] | components["schemas"]["StringSplitNegInvocation"] | components["schemas"]["SubtractInvocation"] | components["schemas"]["T2IAdapterInvocation"] | components["schemas"]["TextLLMInvocation"] | components["schemas"]["TextLLMWithPresetInvocation"] | components["schemas"]["TileToPropertiesInvocation"] | components["schemas"]["TiledMultiDiffusionDenoiseLatents"] | components["schemas"]["UnsharpMaskInvocation"] | components["schemas"]["VAELoaderInvocation"] | components["schemas"]["VideoConcatInvocation"] | components["schemas"]["VideoFrameExtractInvocation"] | components["schemas"]["VideoInvocation"] | components["schemas"]["WanDenoiseInvocation"] | components["schemas"]["WanI2VIdealDimensionsInvocation"] | components["schemas"]["WanImageToLatentsInvocation"] | components["schemas"]["WanLatentsToImageInvocation"] | components["schemas"]["WanLatentsToVideoInvocation"] | components["schemas"]["WanLoRACollectionLoader"] | components["schemas"]["WanLoRALoaderInvocation"] | components["schemas"]["WanModelLoaderInvocation"] | components["schemas"]["WanRefImageEncoderInvocation"] | components["schemas"]["WanTI2VIdealDimensionsInvocation"] | components["schemas"]["WanTextEncoderInvocation"] | components["schemas"]["WanVideoDenoiseInvocation"] | components["schemas"]["WorkflowReturnGetInvocation"] | components["schemas"]["WorkflowReturnInvocation"] | components["schemas"]["WorkflowReturnValueInvocation"] | components["schemas"]["ZImageControlInvocation"] | components["schemas"]["ZImageDenoiseInvocation"] | components["schemas"]["ZImageDenoiseMetaInvocation"] | components["schemas"]["ZImageImageToLatentsInvocation"] | components["schemas"]["ZImageLatentsToImageInvocation"] | components["schemas"]["ZImageLoRACollectionLoader"] | components["schemas"]["ZImageLoRALoaderInvocation"] | components["schemas"]["ZImageModelLoaderInvocation"] | components["schemas"]["ZImagePiDDecodeInvocation"] | components["schemas"]["ZImageSeedVarianceEnhancerInvocation"] | components["schemas"]["ZImageTextEncoderInvocation"];
/**
* Invocation Source Id
* @description The ID of the prepared invocation's source node
@@ -24540,39 +24188,6 @@ export type components = {
*/
success: boolean;
};
- /** LoopState */
- LoopState: {
- /** Values */
- values?: {
- [key: string]: unknown;
- };
- };
- /** LoopStateOutput */
- LoopStateOutput: {
- /** @description The loop state */
- state: components["schemas"]["LoopState"];
- /**
- * type
- * @default loop_state_output
- * @constant
- */
- type: "loop_state_output";
- };
- /** LoopStateValueOutput */
- LoopStateValueOutput: {
- /**
- * Value
- * @description The value read from the loop state, or None when the key is missing
- * @default null
- */
- value: unknown | null;
- /**
- * type
- * @default loop_state_value_output
- * @constant
- */
- type: "loop_state_value_output";
- };
/** LoraModelDefaultSettings */
LoraModelDefaultSettings: {
/**
@@ -32795,17 +32410,7 @@ export type components = {
ui_order: number | null;
/** @default null */
ui_type: components["schemas"]["UIType"] | null;
- /** @default null */
- output_scope: components["schemas"]["OutputScope"] | null;
};
- /**
- * OutputScope
- * @description The execution scope for an output field.
- * - `Iteration`: The field emits values for a loop body's current iteration.
- * - `Final`: The field emits values after a loop boundary completes.
- * @enum {string}
- */
- OutputScope: "iteration" | "final";
/**
* PBR Maps
* @description Generate Normal, Displacement and Roughness Map from a given image
@@ -38800,169 +38405,6 @@ export type components = {
*/
previous_names?: string[];
};
- /**
- * Empty Loop State
- * @description Creates an empty loop state.
- */
- StateEmptyInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * type
- * @default state_empty
- * @constant
- */
- type: "state_empty";
- };
- /**
- * Get Loop State Value
- * @description Reads a value from loop state.
- */
- StateGetInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * @description The loop state to read
- * @default null
- */
- state?: components["schemas"]["LoopState"] | null;
- /**
- * Key
- * @description The state key to read
- * @default
- */
- key?: string;
- /**
- * Default
- * @description The value to return when the key is missing
- * @default null
- */
- default?: unknown | null;
- /**
- * type
- * @default state_get
- * @constant
- */
- type: "state_get";
- };
- /**
- * Merge Loop State Values
- * @description Returns loop state with multiple values merged.
- */
- StateMergeInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * @description The loop state to update
- * @default null
- */
- state?: components["schemas"]["LoopState"] | null;
- /**
- * Values
- * @description The values to merge into the loop state. Connect an output to this input.
- * @default {}
- */
- values?: {
- [key: string]: unknown;
- };
- /**
- * type
- * @default state_merge
- * @constant
- */
- type: "state_merge";
- };
- /**
- * Set Loop State Value
- * @description Returns loop state with one value set.
- */
- StateSetInvocation: {
- /**
- * Id
- * @description The id of this instance of an invocation. Must be unique among all instances of invocations.
- */
- id: string;
- /**
- * Is Intermediate
- * @description Whether or not this is an intermediate invocation.
- * @default false
- */
- is_intermediate?: boolean;
- /**
- * Use Cache
- * @description Whether or not to use the cache
- * @default true
- */
- use_cache?: boolean;
- /**
- * @description The loop state to update
- * @default null
- */
- state?: components["schemas"]["LoopState"] | null;
- /**
- * Key
- * @description The state key to set
- * @default
- */
- key?: string;
- /**
- * Value
- * @description The value to set. Connect an output to this input.
- * @default null
- */
- value?: unknown | null;
- /**
- * type
- * @default state_set
- * @constant
- */
- type: "state_set";
- };
/**
* String2Output
* @description Base class for invocations that output two strings
@@ -41226,7 +40668,7 @@ export type components = {
*
* - Any Field
* We cannot infer the usage of `typing.Any` via schema parsing, so you *must* use `ui_type=UIType.Any` to
- * indicate that the field accepts any type. Use with caution. On inputs, this renders as a connection-only field.
+ * indicate that the field accepts any type. Use with caution. This cannot be used on outputs.
*
* - Scheduler Field
* Special handling in the UI is needed for this field, which otherwise would be parsed as a plain enum field.
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index 5d4f2c4d0d..7a6ea23367 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -1315,6 +1315,17 @@
"nodeType": "Type: {{type}}",
"nodeVersion": "Version: {{version}}",
"nodeClassification": "Classification: {{classification}}",
+ "iterationOutputs": "Iteration outputs",
+ "finalOutputs": "Final outputs",
+ "forLoopBodyBoundary": "For loop body",
+ "forLoopBodyBoundaryStatus": {
+ "missing_linkage": "missing loop linkage",
+ "invalid_linkage": "invalid loop linkage",
+ "duplicate_linkage": "duplicate loop linkage",
+ "missing_return": "missing ForReturn",
+ "multiple_returns": "multiple ForReturns",
+ "orphan_return": "orphan ForReturn"
+ },
"nodeDetailsAria": "Details for {{title}}",
"nodePackLabel": "Node pack: {{name}}",
"nodesDirectory": "Nodes Directory",
diff --git a/invokeai/frontend/webv2/src/features/generation/core/contracts.ts b/invokeai/frontend/webv2/src/features/generation/core/contracts.ts
index 7eb00f4861..8508386d55 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/contracts.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/contracts.ts
@@ -18,6 +18,7 @@ export interface BackendInvocationContract {
}
export interface BackendGraphEdgeContract {
+ type?: 'default' | 'loop_linkage';
source: { node_id: string; field: string };
destination: { node_id: string; field: string };
}
@@ -40,6 +41,7 @@ export interface GraphEdgeContract {
sourceField: string;
targetNodeId: string;
targetField: string;
+ type?: 'default' | 'loop_linkage';
}
export interface GraphContract {
diff --git a/invokeai/frontend/webv2/src/features/generation/core/graphBuilder.ts b/invokeai/frontend/webv2/src/features/generation/core/graphBuilder.ts
index 2d3a6d531e..40685d4f27 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/graphBuilder.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/graphBuilder.ts
@@ -111,6 +111,7 @@ export const toGraphContract = (backendGraph: BackendGraphContract, label: strin
sourceNodeId: edge.source.node_id,
targetField: edge.destination.field,
targetNodeId: edge.destination.node_id,
+ ...(edge.type ? { type: edge.type } : {}),
})),
id: backendGraph.id,
label,
diff --git a/invokeai/frontend/webv2/src/features/generation/core/previewGraph.ts b/invokeai/frontend/webv2/src/features/generation/core/previewGraph.ts
index 381af006d7..3d24d83f6d 100644
--- a/invokeai/frontend/webv2/src/features/generation/core/previewGraph.ts
+++ b/invokeai/frontend/webv2/src/features/generation/core/previewGraph.ts
@@ -61,6 +61,7 @@ export const stabilizeBackendGraphIds = (graph: BackendGraphContract): BackendGr
node_id: rename.get(edge.destination.node_id) ?? edge.destination.node_id,
},
source: { field: edge.source.field, node_id: rename.get(edge.source.node_id) ?? edge.source.node_id },
+ ...(edge.type ? { type: edge.type } : {}),
})),
id: 'generate-preview',
nodes: Object.fromEntries(
@@ -81,6 +82,7 @@ const toPreviewContract = (backendGraph: BackendGraphContract, label: string): G
sourceNodeId: edge.source.node_id,
targetField: edge.destination.field,
targetNodeId: edge.destination.node_id,
+ ...(edge.type ? { type: edge.type } : {}),
})),
id: backendGraph.id,
label,
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.test.ts
index 98b0e63b99..6623468000 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.test.ts
@@ -305,7 +305,7 @@ describe('compileProjectGraph', () => {
// The connected input's direct value must not be sent alongside the edge.
expect(backendGraph?.nodes[sinkId]).not.toHaveProperty('text');
expect(backendGraph?.edges).toEqual([
- { destination: { field: 'text', node_id: sinkId }, source: { field: 'out', node_id: sourceId } },
+ { destination: { field: 'text', node_id: sinkId }, source: { field: 'out', node_id: sourceId }, type: 'default' },
]);
});
@@ -365,7 +365,100 @@ describe('compileProjectGraph', () => {
});
expect(compileProjectGraph(doc, templates).backendGraph?.edges).toEqual([
- { destination: { field: 'text', node_id: sinkNode.id }, source: { field: 'out', node_id: sourceNode.id } },
+ {
+ destination: { field: 'text', node_id: sinkNode.id },
+ source: { field: 'out', node_id: sourceNode.id },
+ type: 'default',
+ },
+ ]);
+ });
+
+ it('preserves the direct loop_linkage edge type in the queue graph', () => {
+ const forTemplate: InvocationTemplate = {
+ ...template('for', {
+ collection: input('collection', {
+ default: [],
+ type: { batch: false, cardinality: 'COLLECTION', name: 'CollectionField' },
+ }),
+ }),
+ outputs: {
+ item: {
+ description: '',
+ name: 'item',
+ outputScope: 'iteration',
+ title: 'Item',
+ type: { batch: false, cardinality: 'SINGLE', name: 'CollectionItemField' },
+ },
+ loop_linkage: {
+ description: '',
+ name: 'loop_linkage',
+ title: 'Loop linkage',
+ type: { batch: false, cardinality: 'SINGLE', name: 'AnyField' },
+ },
+ output_collection: {
+ description: '',
+ name: 'output_collection',
+ outputScope: 'final',
+ title: 'Output collection',
+ type: { batch: false, cardinality: 'COLLECTION', name: 'CollectionField' },
+ },
+ },
+ };
+ const returnTemplate: InvocationTemplate = {
+ ...template('for_return', {
+ loop_linkage: input('loop_linkage', {
+ input: 'connection',
+ type: { batch: false, cardinality: 'SINGLE', name: 'AnyField' },
+ }),
+ output: input('output', {
+ input: 'any',
+ type: { batch: false, cardinality: 'SINGLE', name: 'CollectionItemField' },
+ }),
+ }),
+ outputs: {},
+ };
+ const forNode = buildInvocationNode(forTemplate, { x: 0, y: 0 });
+ const returnNode = buildInvocationNode(returnTemplate, { x: 100, y: 0 });
+ let doc = createProjectGraph('loop-compile');
+
+ doc = projectGraphReducer(doc, { node: forNode, type: 'addNode' });
+ doc = projectGraphReducer(doc, { node: returnNode, type: 'addNode' });
+ doc = projectGraphReducer(doc, {
+ edge: {
+ id: 'item',
+ source: forNode.id,
+ sourceHandle: 'item',
+ target: returnNode.id,
+ targetHandle: 'output',
+ type: 'default',
+ },
+ type: 'addEdge',
+ });
+ doc = projectGraphReducer(doc, {
+ edge: {
+ id: 'linkage',
+ source: forNode.id,
+ sourceHandle: 'loop_linkage',
+ target: returnNode.id,
+ targetHandle: 'loop_linkage',
+ type: 'loop_linkage',
+ },
+ type: 'addEdge',
+ });
+
+ const graph = compileProjectGraph(doc, { for: forTemplate, for_return: returnTemplate }).backendGraph;
+
+ expect(graph.edges).toEqual([
+ {
+ destination: { field: 'output', node_id: returnNode.id },
+ source: { field: 'item', node_id: forNode.id },
+ type: 'default',
+ },
+ {
+ destination: { field: 'loop_linkage', node_id: returnNode.id },
+ source: { field: 'loop_linkage', node_id: forNode.id },
+ type: 'loop_linkage',
+ },
]);
});
});
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.ts b/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.ts
index 611dd23fb9..682590c17e 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/buildGraph.ts
@@ -7,10 +7,9 @@ import type {
WorkflowInvocationNode,
} from './types';
-import { getResolvedWorkflowEdgesIndexed } from './connectors';
import { createWorkflowId } from './document';
import { getWorkflowFieldInvalidReason } from './fields';
-import { createWorkflowGraphIndex } from './graphIndex';
+import { getCanonicalWorkflowEdges, validateForLoopGraph } from './forLoops';
import { isInvocationNode } from './types';
import { hasAnyCycle } from './validation';
@@ -81,7 +80,7 @@ export const getProjectGraphReadiness = (
const templates = templatesSnapshot.templates;
const executableNodes = getExecutableNodes(document);
- const index = createWorkflowGraphIndex(document.nodes, document.edges);
+ const canonicalEdges = getCanonicalWorkflowEdges(document);
if (executableNodes.length === 0) {
return { canInvoke: false, reasons: ['The project graph has no nodes. Add nodes in the Workflow view.'] };
@@ -89,9 +88,9 @@ export const getProjectGraphReadiness = (
const reasons: string[] = [];
const connectedInputs = new Set(
- getResolvedWorkflowEdgesIndexed(document.edges, index, templates)
- .filter((edge) => executableNodes.some((node) => node.id === edge.target))
- .map((edge) => `${edge.target}:${edge.targetHandle}`)
+ canonicalEdges
+ .filter((edge) => executableNodes.some((node) => node.id === edge.destination.node_id))
+ .map((edge) => `${edge.destination.node_id}:${edge.destination.field}`)
);
for (const node of executableNodes) {
@@ -135,10 +134,28 @@ export const getProjectGraphReadiness = (
}
}
- if (hasAnyCycle(document.nodes, document.edges)) {
+ if (
+ hasAnyCycle(
+ document.nodes,
+ canonicalEdges.map((edge) => ({
+ id: edge.id,
+ source: edge.source.node_id,
+ sourceHandle: edge.source.field,
+ target: edge.destination.node_id,
+ targetHandle: edge.destination.field,
+ type: edge.type,
+ }))
+ )
+ ) {
reasons.push('The project graph contains a cycle.');
}
+ const forLoopError = validateForLoopGraph(document);
+
+ if (forLoopError) {
+ reasons.push(`For loop validation failed: ${forLoopError}.`);
+ }
+
return { canInvoke: reasons.length === 0, reasons };
};
@@ -155,11 +172,16 @@ export const compileProjectGraph = (
document: ProjectGraphState,
templates: InvocationTemplates
): CompiledWorkflowGraph => {
+ const forLoopError = validateForLoopGraph(document);
+
+ if (forLoopError) {
+ throw new Error(`For loop validation failed: ${forLoopError}.`);
+ }
+
const executableNodes = getExecutableNodes(document).filter((node) => templates[node.data.type] !== undefined);
const executableNodeIds = new Set(executableNodes.map((node) => node.id));
const backendGraph: WorkflowBackendGraph = { edges: [], id: createWorkflowId('workflow-graph'), nodes: {} };
- const index = createWorkflowGraphIndex(document.nodes, document.edges);
- const resolvedEdges = getResolvedWorkflowEdgesIndexed(document.edges, index, templates);
+ const resolvedEdges = getCanonicalWorkflowEdges(document);
for (const node of executableNodes) {
const template = templates[node.data.type] as NonNullable<(typeof templates)[string]>;
@@ -190,11 +212,11 @@ export const compileProjectGraph = (
const seenEdgeKeys = new Set<string>();
for (const edge of resolvedEdges) {
- if (!executableNodeIds.has(edge.source) || !executableNodeIds.has(edge.target)) {
+ if (!executableNodeIds.has(edge.source.node_id) || !executableNodeIds.has(edge.destination.node_id)) {
continue;
}
- const key = `${edge.source}:${edge.sourceHandle}->${edge.target}:${edge.targetHandle}`;
+ const key = `${edge.type}:${edge.source.node_id}:${edge.source.field}->${edge.destination.node_id}:${edge.destination.field}`;
if (seenEdgeKeys.has(key)) {
continue;
@@ -202,29 +224,31 @@ export const compileProjectGraph = (
seenEdgeKeys.add(key);
backendGraph.edges.push({
- destination: { field: edge.targetHandle, node_id: edge.target },
- source: { field: edge.sourceHandle, node_id: edge.source },
+ destination: edge.destination,
+ source: edge.source,
+ type: edge.type,
});
// A connected input always wins over a stale direct value; sending both
// would let pydantic reject the node on the ignored direct value.
- const targetNode = backendGraph.nodes[edge.target];
+ const targetNode = backendGraph.nodes[edge.destination.node_id];
if (targetNode) {
- delete targetNode[edge.targetHandle];
+ delete targetNode[edge.destination.field];
}
}
return {
backendGraph,
edges: resolvedEdges
- .filter((edge) => executableNodeIds.has(edge.source) && executableNodeIds.has(edge.target))
+ .filter((edge) => executableNodeIds.has(edge.source.node_id) && executableNodeIds.has(edge.destination.node_id))
.map((edge) => ({
id: edge.id,
- sourceField: edge.sourceHandle,
- sourceNodeId: edge.source,
- targetField: edge.targetHandle,
- targetNodeId: edge.target,
+ sourceField: edge.source.field,
+ sourceNodeId: edge.source.node_id,
+ targetField: edge.destination.field,
+ targetNodeId: edge.destination.node_id,
+ type: edge.type,
})),
id: backendGraph.id,
label: document.name || 'Workflow',
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/connectors.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/connectors.test.ts
new file mode 100644
index 0000000000..6214f6d049
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/workflow/core/connectors.test.ts
@@ -0,0 +1,280 @@
+import { describe, expect, it } from 'vitest';
+
+import type { WorkflowInvocationNode } from './types';
+
+import { getConnectorDeletionSpliceConnections } from './connectors';
+import { createProjectGraph, projectGraphReducer } from './document';
+
+const node = (id: string, type: string): WorkflowInvocationNode => ({
+ data: {
+ inputs: {},
+ isIntermediate: true,
+ isOpen: true,
+ label: '',
+ nodePack: 'invokeai',
+ notes: '',
+ type,
+ useCache: true,
+ version: '1.0.0',
+ },
+ id,
+ position: { x: 0, y: 0 },
+ type: 'invocation',
+});
+
+describe('connector deletion', () => {
+ it('reconnects ordinary data through a removed connector', () => {
+ const source = node('source', 'source');
+ const target = node('target', 'target');
+ const connector = {
+ data: { label: '' },
+ id: 'connector',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const document = {
+ ...createProjectGraph('connector-delete'),
+ nodes: [source, connector, target],
+ edges: [
+ {
+ id: 'in',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'connector',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'out',
+ source: 'connector',
+ sourceHandle: 'out',
+ target: 'target',
+ targetHandle: 'input',
+ type: 'default' as const,
+ },
+ ],
+ };
+
+ expect(getConnectorDeletionSpliceConnections('connector', document.nodes, document.edges)).toEqual([
+ {
+ id: 'splice-source-out-target-input',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'target',
+ targetHandle: 'input',
+ type: 'default',
+ },
+ ]);
+
+ const next = projectGraphReducer(document, { nodeIds: ['connector'], type: 'removeNodes' });
+ expect(next.nodes.map((candidate) => candidate.id)).toEqual(['source', 'target']);
+ expect(next.edges).toEqual([
+ {
+ id: 'splice-source-out-target-input',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'target',
+ targetHandle: 'input',
+ type: 'default',
+ },
+ ]);
+ });
+
+ it('reconnects a removed connector alias as a direct loop_linkage edge', () => {
+ const forNode = node('for', 'for');
+ const returnNode = node('return', 'for_return');
+ const connector = {
+ data: { label: '' },
+ id: 'connector',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const document = {
+ ...createProjectGraph('connector-loop-delete'),
+ nodes: [forNode, connector, returnNode],
+ edges: [
+ {
+ id: 'in',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'connector',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'out',
+ source: 'connector',
+ sourceHandle: 'out',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'default' as const,
+ },
+ ],
+ };
+
+ const next = projectGraphReducer(document, { nodeIds: ['connector'], type: 'removeNodes' });
+ expect(next.edges).toEqual([
+ {
+ id: 'splice-for-loop_linkage-return-loop_linkage',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'loop_linkage',
+ },
+ ]);
+ });
+
+ it('keeps a surviving upstream connector when deleting a downstream connector', () => {
+ const source = node('source', 'source');
+ const target = node('target', 'target');
+ const upstream = {
+ data: { label: '' },
+ id: 'upstream',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const downstream = {
+ data: { label: '' },
+ id: 'downstream',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const document = {
+ ...createProjectGraph('connector-chain-delete'),
+ nodes: [source, upstream, downstream, target],
+ edges: [
+ {
+ id: 'source-upstream',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'upstream',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'upstream-downstream',
+ source: 'upstream',
+ sourceHandle: 'out',
+ target: 'downstream',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'downstream-target',
+ source: 'downstream',
+ sourceHandle: 'out',
+ target: 'target',
+ targetHandle: 'input',
+ type: 'default' as const,
+ },
+ ],
+ };
+
+ const next = projectGraphReducer(document, { nodeIds: ['downstream'], type: 'removeNodes' });
+ expect(next.nodes.map((candidate) => candidate.id)).toEqual(['source', 'upstream', 'target']);
+ expect(next.edges).toEqual([
+ {
+ id: 'source-upstream',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'upstream',
+ targetHandle: 'in',
+ type: 'default',
+ },
+ {
+ id: 'splice-source-out-target-input',
+ source: 'source',
+ sourceHandle: 'out',
+ target: 'target',
+ targetHandle: 'input',
+ type: 'default',
+ },
+ ]);
+ });
+
+ it('preserves the loop-linkage alias when deleting one connector from a chain', () => {
+ const forNode = node('for', 'for');
+ const returnNode = node('return', 'for_return');
+ const upstream = {
+ data: { label: '' },
+ id: 'upstream',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const downstream = {
+ data: { label: '' },
+ id: 'downstream',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const document = {
+ ...createProjectGraph('connector-loop-chain-delete'),
+ nodes: [forNode, upstream, downstream, returnNode],
+ edges: [
+ {
+ id: 'for-upstream',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'upstream',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'upstream-downstream',
+ source: 'upstream',
+ sourceHandle: 'out',
+ target: 'downstream',
+ targetHandle: 'in',
+ type: 'default' as const,
+ },
+ {
+ id: 'downstream-return',
+ source: 'downstream',
+ sourceHandle: 'out',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'default' as const,
+ },
+ ],
+ };
+
+ expect(projectGraphReducer(document, { nodeIds: ['upstream'], type: 'removeNodes' }).edges).toEqual([
+ {
+ id: 'downstream-return',
+ source: 'downstream',
+ sourceHandle: 'out',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'default',
+ },
+ {
+ id: 'splice-for-loop_linkage-downstream-in',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'downstream',
+ targetHandle: 'in',
+ type: 'default',
+ },
+ ]);
+
+ expect(projectGraphReducer(document, { nodeIds: ['downstream'], type: 'removeNodes' }).edges).toEqual([
+ {
+ id: 'for-upstream',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'upstream',
+ targetHandle: 'in',
+ type: 'default',
+ },
+ {
+ id: 'splice-upstream-out-return-loop_linkage',
+ source: 'upstream',
+ sourceHandle: 'out',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'default',
+ },
+ ]);
+ });
+});
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/connectors.ts b/invokeai/frontend/webv2/src/features/workflow/core/connectors.ts
index c542800e2e..468d3c5609 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/connectors.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/connectors.ts
@@ -23,6 +23,17 @@ export interface ResolvedWorkflowEdge extends WorkflowEdge {
sourceHandle: string;
}
+export interface ResolvedLoopLinkagePath {
+ forNodeId: string;
+ returnNodeId: string;
+ edgeIds: string[];
+ connectorNodeIds: string[];
+}
+
+export interface ConnectorDeletionSpliceConnection extends WorkflowEdge {
+ type: 'default' | 'loop_linkage';
+}
+
export const getConnectorInputEdge = (connectorId: string, edges: WorkflowEdge[]): WorkflowEdge | undefined =>
edges.find(
(edge) => edge.type === 'default' && edge.target === connectorId && edge.targetHandle === CONNECTOR_INPUT_HANDLE
@@ -41,6 +52,260 @@ export const getConnectorOutputEdges = (connectorId: string, edges: WorkflowEdge
export const getConnectorOutputEdgesIndexed = (connectorId: string, index: WorkflowGraphIndex): WorkflowEdge[] =>
index.connectorOutputsById.get(connectorId) ?? [];
+/** Resolves the optional connector representation of a For-to-ForReturn linkage. */
+export const resolveLoopLinkagePath = (
+ edge: WorkflowEdge,
+ nodes: WorkflowNode[],
+ edges: WorkflowEdge[]
+): ResolvedLoopLinkagePath | null => {
+ if (edge.type !== 'default' || edge.targetHandle !== 'loop_linkage') {
+ return null;
+ }
+
+ const returnNode = nodes.find((node) => node.id === edge.target);
+
+ if (!returnNode || !isInvocationNode(returnNode) || returnNode.data.type !== 'for_return') {
+ return null;
+ }
+
+ const edgeIds = [edge.id];
+ const connectorNodeIds: string[] = [];
+ const visitedConnectors = new Set<string>();
+ let currentEdge = edge;
+
+ while (true) {
+ const sourceNode = nodes.find((node) => node.id === currentEdge.source);
+
+ if (!sourceNode) {
+ return null;
+ }
+
+ if (sourceNode && isInvocationNode(sourceNode)) {
+ if (sourceNode.data.type !== 'for' || currentEdge.sourceHandle !== 'loop_linkage') {
+ return null;
+ }
+
+ return {
+ connectorNodeIds: [...connectorNodeIds].reverse(),
+ edgeIds: [...edgeIds].reverse(),
+ forNodeId: sourceNode.id,
+ returnNodeId: returnNode.id,
+ };
+ }
+
+ if (!isConnectorNode(sourceNode) || currentEdge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE) {
+ return null;
+ }
+
+ if (visitedConnectors.has(sourceNode.id)) {
+ return null;
+ }
+
+ visitedConnectors.add(sourceNode.id);
+ connectorNodeIds.push(sourceNode.id);
+
+ const inputEdges = edges.filter(
+ (candidate) =>
+ candidate.type === 'default' &&
+ candidate.target === sourceNode.id &&
+ candidate.targetHandle === CONNECTOR_INPUT_HANDLE
+ );
+ const outputEdges = getConnectorOutputEdges(sourceNode.id, edges);
+
+ if (inputEdges.length !== 1 || outputEdges.length !== 1 || outputEdges[0]?.id !== currentEdge.id) {
+ return null;
+ }
+
+ const inputEdge = inputEdges[0];
+
+ if (!inputEdge) {
+ return null;
+ }
+
+ edgeIds.push(inputEdge.id);
+ currentEdge = inputEdge;
+ }
+};
+
+/** Returns document edges with complete connector aliases styled as loop linkages. */
+export const getEdgesWithLoopLinkageAliases = (nodes: WorkflowNode[], edges: WorkflowEdge[]): WorkflowEdge[] => {
+ const linkageEdgeIds = new Set<string>();
+
+ for (const edge of edges) {
+ const sourceNode = nodes.find((node) => node.id === edge.source);
+
+ if (
+ edge.type !== 'default' ||
+ edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
+ edge.targetHandle !== 'loop_linkage' ||
+ !sourceNode ||
+ !isConnectorNode(sourceNode)
+ ) {
+ continue;
+ }
+
+ resolveLoopLinkagePath(edge, nodes, edges)?.edgeIds.forEach((edgeId) => linkageEdgeIds.add(edgeId));
+ }
+
+ return edges.map((edge) => (linkageEdgeIds.has(edge.id) ? { ...edge, type: 'loop_linkage' } : edge));
+};
+
+const resolveConnectorDeletionSource = (
+ connectorId: string,
+ nodes: WorkflowNode[],
+ edges: WorkflowEdge[],
+ removedConnectorIds: ReadonlySet<string>
+): ResolvedConnectorSource | null => {
+ const visitedConnectorIds = new Set<string>();
+ let resolvedSource = resolveConnectorSource(connectorId, nodes, edges);
+
+ while (resolvedSource && removedConnectorIds.has(resolvedSource.nodeId)) {
+ if (visitedConnectorIds.has(resolvedSource.nodeId)) {
+ return null;
+ }
+ visitedConnectorIds.add(resolvedSource.nodeId);
+ resolvedSource = resolveConnectorSource(resolvedSource.nodeId, nodes, edges);
+ }
+
+ if (!resolvedSource) {
+ return null;
+ }
+
+ const sourceNode = nodes.find((node) => node.id === resolvedSource.nodeId);
+ if (
+ sourceNode &&
+ isInvocationNode(sourceNode) &&
+ sourceNode.data.type === 'for' &&
+ resolvedSource.fieldName === 'loop_linkage'
+ ) {
+ const outputEdges = getConnectorOutputEdges(connectorId, edges);
+ if (
+ outputEdges.length !== 1 ||
+ outputEdges.some((edge) => {
+ const targetNode = nodes.find((node) => node.id === edge.target);
+ return !(
+ (targetNode && isConnectorNode(targetNode) && edge.targetHandle === CONNECTOR_INPUT_HANDLE) ||
+ (targetNode &&
+ isInvocationNode(targetNode) &&
+ targetNode.data.type === 'for_return' &&
+ edge.targetHandle === 'loop_linkage')
+ );
+ })
+ ) {
+ return null;
+ }
+ }
+
+ const linkagePath = getResolvedLoopLinkagePathForConnector(connectorId, nodes, edges);
+ const inputEdge = getConnectorInputEdge(connectorId, edges);
+ if (linkagePath && inputEdge) {
+ return { fieldName: inputEdge.sourceHandle, nodeId: inputEdge.source, type: null };
+ }
+
+ return resolvedSource;
+};
+
+const getResolvedLoopLinkagePathForConnector = (
+ connectorId: string,
+ nodes: WorkflowNode[],
+ edges: WorkflowEdge[]
+): ResolvedLoopLinkagePath | null => {
+ for (const edge of edges) {
+ if (
+ edge.type !== 'default' ||
+ edge.sourceHandle !== CONNECTOR_OUTPUT_HANDLE ||
+ edge.targetHandle !== 'loop_linkage'
+ ) {
+ continue;
+ }
+
+ const path = resolveLoopLinkagePath(edge, nodes, edges);
+ if (path?.connectorNodeIds.includes(connectorId)) {
+ return path;
+ }
+ }
+
+ return null;
+};
+
+const getConnectorDeletionOutputEdges = (
+ connectorId: string,
+ nodes: WorkflowNode[],
+ edges: WorkflowEdge[],
+ removedConnectorIds: ReadonlySet<string>
+): WorkflowEdge[] | null => {
+ const visited = new Set<string>();
+ const outputEdges: WorkflowEdge[] = [];
+
+ const visit = (currentConnectorId: string): boolean => {
+ if (visited.has(currentConnectorId)) {
+ return false;
+ }
+
+ visited.add(currentConnectorId);
+
+ for (const edge of getConnectorOutputEdges(currentConnectorId, edges)) {
+ const targetNode = nodes.find((node) => node.id === edge.target);
+
+ if (targetNode && isConnectorNode(targetNode) && removedConnectorIds.has(targetNode.id)) {
+ if (!visit(targetNode.id)) {
+ return false;
+ }
+ } else {
+ outputEdges.push(edge);
+ }
+ }
+
+ return true;
+ };
+
+ return visit(connectorId) ? outputEdges : null;
+};
+
+/** Builds replacement edges before deleting one or more connector nodes. */
+export const getConnectorDeletionSpliceConnections = (
+ connectorId: string,
+ nodes: WorkflowNode[],
+ edges: WorkflowEdge[],
+ removedConnectorIds: ReadonlySet<string> = new Set([connectorId])
+): ConnectorDeletionSpliceConnection[] => {
+ const source = resolveConnectorDeletionSource(connectorId, nodes, edges, removedConnectorIds);
+ const outputEdges = getConnectorDeletionOutputEdges(connectorId, nodes, edges, removedConnectorIds);
+
+ if (!source || !outputEdges) {
+ return [];
+ }
+
+ const connections: ConnectorDeletionSpliceConnection[] = [];
+
+ for (const outputEdge of outputEdges) {
+ const type =
+ source.fieldName === 'loop_linkage' && outputEdge.targetHandle === 'loop_linkage' ? 'loop_linkage' : 'default';
+ const replacement = {
+ id: `splice-${source.nodeId}-${source.fieldName}-${outputEdge.target}-${outputEdge.targetHandle}`,
+ source: source.nodeId,
+ sourceHandle: source.fieldName,
+ target: outputEdge.target,
+ targetHandle: outputEdge.targetHandle,
+ type,
+ } satisfies ConnectorDeletionSpliceConnection;
+
+ if (
+ !connections.some(
+ (edge) =>
+ edge.source === replacement.source &&
+ edge.sourceHandle === replacement.sourceHandle &&
+ edge.target === replacement.target &&
+ edge.targetHandle === replacement.targetHandle
+ )
+ ) {
+ connections.push(replacement);
+ }
+ }
+
+ return connections;
+};
+
export const resolveConnectorSource = (
connectorId: string,
nodes: WorkflowNode[],
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/document.ts b/invokeai/frontend/webv2/src/features/workflow/core/document.ts
index 001af37897..cdb49fb7cb 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/document.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/document.ts
@@ -16,6 +16,7 @@ import type {
XYPosition,
} from './types';
+import { getConnectorDeletionSpliceConnections } from './connectors';
import { isInvocationNode, isNotesNode } from './types';
/**
@@ -424,9 +425,33 @@ const applyProjectGraphAction = (document: ProjectGraphState, action: ProjectGra
return document;
}
+ const removedConnectorIds = new Set(
+ document.nodes.filter((node) => removedNodeIds.has(node.id) && node.type === 'connector').map((node) => node.id)
+ );
+ const spliceEdges = [...removedConnectorIds].flatMap((connectorId) =>
+ getConnectorDeletionSpliceConnections(connectorId, document.nodes, document.edges, removedConnectorIds)
+ );
+ const remainingNodeIds = new Set(
+ document.nodes.filter((node) => !removedNodeIds.has(node.id)).map((node) => node.id)
+ );
+ const existingEdgeKeys = new Set(
+ document.edges.map((edge) => `${edge.source}:${edge.sourceHandle}->${edge.target}:${edge.targetHandle}`)
+ );
+ const edges = document.edges.filter(
+ (edge) => !removedNodeIds.has(edge.source) && !removedNodeIds.has(edge.target)
+ );
+
+ for (const edge of spliceEdges) {
+ const key = `${edge.source}:${edge.sourceHandle}->${edge.target}:${edge.targetHandle}`;
+ if (remainingNodeIds.has(edge.source) && remainingNodeIds.has(edge.target) && !existingEdgeKeys.has(key)) {
+ existingEdgeKeys.add(key);
+ edges.push(edge);
+ }
+ }
+
return {
...document,
- edges: document.edges.filter((edge) => !removedNodeIds.has(edge.source) && !removedNodeIds.has(edge.target)),
+ edges,
form: removeNodeFieldElements(document.form, removedNodeIds),
nodes: document.nodes.filter((node) => !removedNodeIds.has(node.id)),
};
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/forLoops.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/forLoops.test.ts
new file mode 100644
index 0000000000..7e7b4a83c5
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/workflow/core/forLoops.test.ts
@@ -0,0 +1,175 @@
+import { describe, expect, it } from 'vitest';
+
+import type { WorkflowEdge, WorkflowInvocationNode } from './types';
+
+import { createProjectGraph } from './document';
+import { getCanonicalWorkflowEdges, validateForLoopGraph } from './forLoops';
+
+const node = (id: string, type: string): WorkflowInvocationNode => ({
+ data: {
+ inputs: {},
+ isIntermediate: true,
+ isOpen: true,
+ label: '',
+ nodePack: 'invokeai',
+ notes: '',
+ type,
+ useCache: true,
+ version: '1.0.0',
+ },
+ id,
+ position: { x: 0, y: 0 },
+ type: 'invocation',
+});
+
+const edge = (
+ id: string,
+ source: string,
+ sourceHandle: string,
+ target: string,
+ targetHandle: string,
+ type: WorkflowEdge['type'] = 'default'
+): WorkflowEdge => ({ id, source, sourceHandle, target, targetHandle, type });
+
+const linkedGraph = () => {
+ const forNode = node('for', 'for');
+ const bodyNode = node('body', 'number');
+ const returnNode = node('return', 'for_return');
+ const document = {
+ ...createProjectGraph('for-loop-test'),
+ nodes: [forNode, bodyNode, returnNode],
+ edges: [
+ edge('iteration', 'for', 'item', 'body', 'value'),
+ edge('body-output', 'body', 'value', 'return', 'output'),
+ edge('linkage', 'for', 'loop_linkage', 'return', 'loop_linkage', 'loop_linkage'),
+ ],
+ };
+
+ return { bodyNode, document, forNode, returnNode };
+};
+
+describe('For/ForReturn graph contracts', () => {
+ it('accepts a direct loop linkage and excludes it from data-flow traversal', () => {
+ const { document } = linkedGraph();
+
+ expect(validateForLoopGraph(document)).toBeNull();
+ expect(getCanonicalWorkflowEdges(document).find((candidate) => candidate.id === 'linkage')).toMatchObject({
+ source: { field: 'loop_linkage', node_id: 'for' },
+ destination: { field: 'loop_linkage', node_id: 'return' },
+ type: 'loop_linkage',
+ });
+
+ expect(
+ validateForLoopGraph({
+ ...document,
+ edges: document.edges.map((candidate) =>
+ candidate.id === 'linkage' ? { ...candidate, type: 'default' as const } : candidate
+ ),
+ })
+ ).toBe('nodes.forLoopLinkageInvalid');
+ });
+
+ it('rejects an unlinked loop and an unsupported nested loop body', () => {
+ const { document } = linkedGraph();
+ const unlinked = { ...document, edges: document.edges.filter((candidate) => candidate.id !== 'linkage') };
+ expect(validateForLoopGraph(unlinked)).toBe('nodes.forLoopLinkageMissing');
+
+ const innerFor = node('inner-for', 'for');
+ const innerReturn = node('inner-return', 'for_return');
+ const nested = {
+ ...document,
+ nodes: [...document.nodes, innerFor, innerReturn],
+ edges: [
+ ...document.edges,
+ edge('nested', 'for', 'item', 'inner-for', 'collection'),
+ edge('inner-iteration', 'inner-for', 'item', 'inner-return', 'output'),
+ edge('inner-linkage', 'inner-for', 'loop_linkage', 'inner-return', 'loop_linkage', 'loop_linkage'),
+ ],
+ };
+ expect(validateForLoopGraph(nested)).toBe('nodes.forLoopNestedUnsupported');
+ });
+
+ it('accepts a nested For whose final collection closes the outer body', () => {
+ const document = {
+ ...createProjectGraph('nested-for-loop-test'),
+ nodes: [
+ node('outer', 'for'),
+ node('inner-collection', 'add'),
+ node('inner', 'for'),
+ node('inner-body', 'add'),
+ node('inner-condition', 'add'),
+ node('inner-return', 'for_return'),
+ node('outer-return', 'for_return'),
+ ],
+ edges: [
+ edge('outer-item', 'outer', 'item', 'inner-collection', 'value'),
+ edge('inner-collection', 'inner-collection', 'value', 'inner', 'collection'),
+ edge('inner-item', 'inner', 'item', 'inner-body', 'value'),
+ edge('inner-item-condition', 'inner', 'item', 'inner-condition', 'value'),
+ edge('inner-output', 'inner-body', 'value', 'inner-return', 'output'),
+ edge('inner-condition', 'inner-condition', 'value', 'inner-return', 'continue_condition'),
+ edge('inner-final', 'inner', 'output_collection', 'outer-return', 'output'),
+ edge('inner-linkage', 'inner', 'loop_linkage', 'inner-return', 'loop_linkage', 'loop_linkage'),
+ edge('outer-linkage', 'outer', 'loop_linkage', 'outer-return', 'loop_linkage', 'loop_linkage'),
+ ],
+ };
+
+ expect(validateForLoopGraph(document)).toBeNull();
+ });
+
+ it('rejects a nested For with an external outer continuation condition', () => {
+ const document = {
+ ...createProjectGraph('nested-for-loop-invalid-test'),
+ nodes: [
+ node('outer', 'for'),
+ node('inner-collection', 'add'),
+ node('inner', 'for'),
+ node('inner-body', 'add'),
+ node('inner-return', 'for_return'),
+ node('outer-return', 'for_return'),
+ node('external-condition', 'add'),
+ ],
+ edges: [
+ edge('outer-item', 'outer', 'item', 'inner-collection', 'value'),
+ edge('inner-collection', 'inner-collection', 'value', 'inner', 'collection'),
+ edge('inner-item', 'inner', 'item', 'inner-body', 'value'),
+ edge('inner-output', 'inner-body', 'value', 'inner-return', 'output'),
+ edge('inner-final', 'inner', 'output_collection', 'outer-return', 'output'),
+ edge('inner-linkage', 'inner', 'loop_linkage', 'inner-return', 'loop_linkage', 'loop_linkage'),
+ edge('outer-linkage', 'outer', 'loop_linkage', 'outer-return', 'loop_linkage', 'loop_linkage'),
+ edge('external-condition', 'external-condition', 'value', 'outer-return', 'continue_condition'),
+ ],
+ };
+
+ expect(validateForLoopGraph(document)).toBe('nodes.forLoopNestedUnsupported');
+ });
+
+ it('canonicalizes a complete connector alias without changing the stored edge list', () => {
+ const forNode = node('for', 'for');
+ const returnNode = node('return', 'for_return');
+ const connector = {
+ data: { label: '' },
+ id: 'connector',
+ position: { x: 0, y: 0 },
+ type: 'connector' as const,
+ };
+ const document = {
+ ...createProjectGraph('connector-loop-test'),
+ nodes: [forNode, connector, returnNode],
+ edges: [
+ edge('for-to-connector', 'for', 'loop_linkage', 'connector', 'in'),
+ edge('connector-to-return', 'connector', 'out', 'return', 'loop_linkage'),
+ ],
+ };
+
+ expect(validateForLoopGraph(document)).toBe('nodes.forLoopMissingIterationOutput');
+ expect(getCanonicalWorkflowEdges(document)).toEqual([
+ {
+ id: 'resolved-loop-linkage-for-return',
+ source: { field: 'loop_linkage', node_id: 'for' },
+ destination: { field: 'loop_linkage', node_id: 'return' },
+ type: 'loop_linkage',
+ },
+ ]);
+ });
+});
diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.ts b/invokeai/frontend/webv2/src/features/workflow/core/forLoops.ts
similarity index 60%
rename from invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.ts
rename to invokeai/frontend/webv2/src/features/workflow/core/forLoops.ts
index 39c07e65b5..6c05c9e8b3 100644
--- a/invokeai/frontend/web/src/features/nodes/util/graph/validateForLoopGraph.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/forLoops.ts
@@ -1,7 +1,10 @@
-import { LOOP_LINKAGE_FIELD } from 'features/nodes/types/constants';
-import type { Graph } from 'services/api/types';
+import type { WorkflowEdge, WorkflowNode, ProjectGraphState } from './types';
-type ForLoopGraphError =
+import { getResolvedWorkflowEdgesIndexed, resolveLoopLinkagePath } from './connectors';
+import { createWorkflowGraphIndex } from './graphIndex';
+import { isInvocationNode } from './types';
+
+export type ForLoopGraphError =
| 'nodes.forLoopMissingIterationOutput'
| 'nodes.forLoopReturnCount'
| 'nodes.forLoopUnterminatedBody'
@@ -17,75 +20,269 @@ type ForLoopGraphError =
| 'nodes.forLoopLinkageDuplicate'
| 'nodes.forReturnOwnership';
+export type LoopBodyBoundaryStatus =
+ | 'complete'
+ | 'missing_linkage'
+ | 'invalid_linkage'
+ | 'duplicate_linkage'
+ | 'missing_return'
+ | 'multiple_returns'
+ | 'orphan_return';
+
+export interface LoopBodyBoundary {
+ forNodeId?: string;
+ returnNodeId?: string;
+ bodyNodeIds: string[];
+ status: LoopBodyBoundaryStatus;
+}
+
+const LOOP_LINKAGE_FIELD = 'loop_linkage';
const ITERATION_OUTPUT_FIELDS = new Set(['item', 'index', 'total', 'state']);
const FINAL_OUTPUT_FIELDS = new Set(['output_collection', 'final_state']);
-export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null => {
- const nodes = graph.nodes ?? {};
- const allEdges = graph.edges ?? [];
- const edges = allEdges.filter((edge) => edge.type !== 'loop_linkage');
- const linkageEdges = allEdges.filter((edge) => edge.type === 'loop_linkage');
+type LoopNode = { id: string; type: string };
+type LoopEdge = {
+ id: string;
+ type: WorkflowEdge['type'];
+ source: { node_id: string; field: string };
+ destination: { node_id: string; field: string };
+};
+
+const getInvocationNodes = (nodes: WorkflowNode[]): LoopNode[] =>
+ nodes.filter(isInvocationNode).map((node) => ({ id: node.id, type: node.data.type }));
+
+/** Resolves connectors for loop validation and compilation without mutating the document. */
+export const getCanonicalWorkflowEdges = (document: Pick<ProjectGraphState, 'nodes' | 'edges'>): LoopEdge[] => {
+ const index = createWorkflowGraphIndex(document.nodes, document.edges);
+ const aliasEdgeIds = new Set<string>();
+ const aliasEdges: LoopEdge[] = [];
+
+ for (const edge of document.edges) {
+ const sourceNode = index.nodesById.get(edge.source);
+
+ if (
+ edge.type !== 'default' ||
+ edge.targetHandle !== LOOP_LINKAGE_FIELD ||
+ !sourceNode ||
+ isInvocationNode(sourceNode)
+ ) {
+ continue;
+ }
+
+ const path = resolveLoopLinkagePath(edge, document.nodes, document.edges);
+
+ if (!path) {
+ continue;
+ }
+
+ path.edgeIds.forEach((edgeId) => aliasEdgeIds.add(edgeId));
+ aliasEdges.push({
+ destination: { field: LOOP_LINKAGE_FIELD, node_id: path.returnNodeId },
+ id: `resolved-loop-linkage-${path.forNodeId}-${path.returnNodeId}`,
+ source: { field: LOOP_LINKAGE_FIELD, node_id: path.forNodeId },
+ type: 'loop_linkage',
+ });
+ }
+
+ const resolved = getResolvedWorkflowEdgesIndexed(document.edges, index).filter(
+ (edge) =>
+ !aliasEdgeIds.has(edge.id) &&
+ index.nodesById.get(edge.source) !== undefined &&
+ index.nodesById.get(edge.target) !== undefined &&
+ isInvocationNode(index.nodesById.get(edge.source) as WorkflowNode) &&
+ isInvocationNode(index.nodesById.get(edge.target) as WorkflowNode)
+ );
+
+ return [
+ ...resolved.map((edge) => ({
+ destination: { field: edge.targetHandle, node_id: edge.target },
+ id: edge.id,
+ source: { field: edge.sourceHandle, node_id: edge.source },
+ type: edge.type,
+ })),
+ ...aliasEdges,
+ ];
+};
+
+const walk = (startIds: Iterable<string>, adjacency: Map<string, string[]>): Set<string> => {
+ const visited = new Set<string>();
+ const pending = [...startIds];
+
+ while (pending.length > 0) {
+ const nodeId = pending.pop();
+
+ if (nodeId === undefined || visited.has(nodeId)) {
+ continue;
+ }
+
+ visited.add(nodeId);
+ pending.push(...(adjacency.get(nodeId) ?? []));
+ }
+
+ return visited;
+};
+
+const getBodyNodeIds = (
+ reachableNodeIds: Set<string>,
+ returnNodeId: string | undefined,
+ incoming: Map<string, string[]>
+): Set<string> => {
+ if (!returnNodeId) {
+ return new Set(reachableNodeIds);
+ }
+
+ const bodyNodeIds = new Set([...walk([returnNodeId], incoming)].filter((nodeId) => reachableNodeIds.has(nodeId)));
+ bodyNodeIds.add(returnNodeId);
+ return bodyNodeIds;
+};
+
+export const getForLoopBodyBoundaries = (nodes: WorkflowNode[], edges: WorkflowEdge[]): LoopBodyBoundary[] => {
+ const invocationNodes = nodes.filter(isInvocationNode);
+ const nodesById = new Map(invocationNodes.map((node) => [node.id, node]));
+ const canonicalEdges = getCanonicalWorkflowEdges({ nodes, edges });
+ const dataEdges = canonicalEdges.filter((edge) => edge.type !== 'loop_linkage');
const outgoing = new Map<string, string[]>();
const incoming = new Map<string, string[]>();
- for (const edge of edges) {
- const sourceId = edge.source.node_id;
- const destinationId = edge.destination.node_id;
- outgoing.set(sourceId, [...(outgoing.get(sourceId) ?? []), destinationId]);
- incoming.set(destinationId, [...(incoming.get(destinationId) ?? []), sourceId]);
+ for (const edge of dataEdges) {
+ outgoing.set(edge.source.node_id, [...(outgoing.get(edge.source.node_id) ?? []), edge.destination.node_id]);
+ incoming.set(edge.destination.node_id, [...(incoming.get(edge.destination.node_id) ?? []), edge.source.node_id]);
}
- const walk = (startIds: Iterable<string>, adjacency: Map<string, string[]>): Set<string> => {
- const visited = new Set<string>();
- const pending = [...startIds];
- while (pending.length > 0) {
- const nodeId = pending.pop();
- if (nodeId === undefined || visited.has(nodeId)) {
- continue;
- }
- visited.add(nodeId);
- pending.push(...(adjacency.get(nodeId) ?? []));
+ const linkedReturnByForId = new Map<string, string>();
+ const linkedForByReturnId = new Map<string, string>();
+ let duplicateLinkage = false;
+
+ for (const edge of canonicalEdges.filter((candidate) => candidate.type === 'loop_linkage')) {
+ if (linkedReturnByForId.has(edge.source.node_id) || linkedForByReturnId.has(edge.destination.node_id)) {
+ duplicateLinkage = true;
+ continue;
}
- return visited;
- };
+ linkedReturnByForId.set(edge.source.node_id, edge.destination.node_id);
+ linkedForByReturnId.set(edge.destination.node_id, edge.source.node_id);
+ }
- const hasPath = (startId: string, targetId: string): boolean =>
- startId === targetId || walk([startId], outgoing).has(targetId);
+ const reachableReturnIds = new Set<string>();
+ const boundaries = invocationNodes
+ .filter((node) => node.data.type === 'for')
+ .map<LoopBodyBoundary>((forNode) => {
+ const iterationTargets = dataEdges
+ .filter((edge) => edge.source.node_id === forNode.id && ITERATION_OUTPUT_FIELDS.has(edge.source.field))
+ .map((edge) => edge.destination.node_id);
+ const reachableNodeIds = walk(iterationTargets, outgoing);
+ const reachableReturns = [...reachableNodeIds].filter(
+ (nodeId) => nodesById.get(nodeId)?.data.type === 'for_return'
+ );
+ reachableReturns.forEach((nodeId) => reachableReturnIds.add(nodeId));
+ const linkedReturnId = linkedReturnByForId.get(forNode.id);
+ const returnNodeId = linkedReturnId ?? (reachableReturns.length === 1 ? reachableReturns[0] : undefined);
+ let status: LoopBodyBoundaryStatus;
+
+ if (duplicateLinkage && linkedReturnId !== undefined) {
+ status = 'duplicate_linkage';
+ } else if (linkedReturnId === undefined) {
+ status = 'missing_linkage';
+ } else if (!reachableNodeIds.has(linkedReturnId)) {
+ status = 'invalid_linkage';
+ } else if (reachableReturns.length === 0) {
+ status = 'missing_return';
+ } else if (reachableReturns.length > 1) {
+ status = 'multiple_returns';
+ } else {
+ status = 'complete';
+ }
+
+ return {
+ ...(returnNodeId ? { returnNodeId } : {}),
+ bodyNodeIds: [forNode.id, ...getBodyNodeIds(reachableNodeIds, returnNodeId, incoming)],
+ forNodeId: forNode.id,
+ status,
+ };
+ });
+
+ boundaries.push(
+ ...invocationNodes
+ .filter(
+ (node) =>
+ node.data.type === 'for_return' && !linkedForByReturnId.has(node.id) && !reachableReturnIds.has(node.id)
+ )
+ .map((node) => ({
+ bodyNodeIds: [node.id],
+ returnNodeId: node.id,
+ status: 'orphan_return' as const,
+ }))
+ );
+
+ return boundaries;
+};
+
+/** Validates the scheduler-specific For/ForReturn graph contract before queueing. */
+export const validateForLoopGraph = (
+ document: Pick<ProjectGraphState, 'nodes' | 'edges'>
+): ForLoopGraphError | null => {
+ const nodes = getInvocationNodes(document.nodes);
+ const nodesById = new Map(nodes.map((node) => [node.id, node]));
+ const allEdges = getCanonicalWorkflowEdges(document);
+
+ if (
+ allEdges.some(
+ (edge) =>
+ edge.type === 'default' &&
+ edge.source.field === LOOP_LINKAGE_FIELD &&
+ edge.destination.field === LOOP_LINKAGE_FIELD &&
+ nodesById.has(edge.source.node_id) &&
+ nodesById.has(edge.destination.node_id)
+ )
+ ) {
+ return 'nodes.forLoopLinkageInvalid';
+ }
+
+ const edges = allEdges.filter((edge) => edge.type !== 'loop_linkage');
+ const linkageEdges = allEdges.filter((edge) => edge.type === 'loop_linkage');
+ const outgoing = new Map<string, string[]>();
+ const incoming = new Map<string, string[]>();
+
+ for (const edge of edges) {
+ outgoing.set(edge.source.node_id, [...(outgoing.get(edge.source.node_id) ?? []), edge.destination.node_id]);
+ incoming.set(edge.destination.node_id, [...(incoming.get(edge.destination.node_id) ?? []), edge.source.node_id]);
+ }
const linkedReturnByForId = new Map<string, string>();
const linkedForByReturnId = new Map<string, string>();
+
for (const edge of linkageEdges) {
- const sourceNode = nodes[edge.source.node_id];
- const destinationNode = nodes[edge.destination.node_id];
+ const sourceNode = nodesById.get(edge.source.node_id);
+ const returnNode = nodesById.get(edge.destination.node_id);
+
if (
edge.source.field !== LOOP_LINKAGE_FIELD ||
edge.destination.field !== LOOP_LINKAGE_FIELD ||
sourceNode?.type !== 'for' ||
- destinationNode?.type !== 'for_return'
+ returnNode?.type !== 'for_return'
) {
return 'nodes.forLoopLinkageInvalid';
}
+
if (linkedReturnByForId.has(edge.source.node_id) || linkedForByReturnId.has(edge.destination.node_id)) {
return 'nodes.forLoopLinkageDuplicate';
}
+
linkedReturnByForId.set(edge.source.node_id, edge.destination.node_id);
linkedForByReturnId.set(edge.destination.node_id, edge.source.node_id);
}
- if (
- Object.values(nodes).some((node) => {
- if (node.type === 'for') {
- return !linkedReturnByForId.has(node.id);
- }
- if (node.type === 'for_return') {
- return !linkedForByReturnId.has(node.id);
- }
- return false;
- })
- ) {
- return 'nodes.forLoopLinkageMissing';
+ for (const node of nodes) {
+ if (
+ (node.type === 'for' && !linkedReturnByForId.has(node.id)) ||
+ (node.type === 'for_return' && !linkedForByReturnId.has(node.id))
+ ) {
+ return 'nodes.forLoopLinkageMissing';
+ }
}
+ const hasPath = (startId: string, targetId: string): boolean =>
+ startId === targetId || walk([startId], outgoing).has(targetId);
+
const supportsNestedIterateBody = (
bodyPathNodeIds: Set<string>,
iterateNodeIds: string[],
@@ -146,6 +343,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (collectCollectionEdges.length !== 0 || collectItemEdges.length !== 1) {
return false;
}
+
const collectItemSourceId = collectItemEdges[0]?.source.node_id;
if (collectItemSourceId === undefined || !hasPath(iterateId, collectItemSourceId)) {
return false;
@@ -176,7 +374,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
return null;
}
- const innerForIds = [...reachableBodyNodeIds].filter((nodeId) => nodes[nodeId]?.type === 'for');
+ const innerForIds = [...reachableBodyNodeIds].filter((nodeId) => nodesById.get(nodeId)?.type === 'for');
const directInnerForIds = innerForIds.filter(
(innerForId) =>
!innerForIds.some((otherInnerForId) => otherInnerForId !== innerForId && hasPath(otherInnerForId, innerForId))
@@ -184,25 +382,23 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (directInnerForIds.length === 0) {
return null;
}
+
const innerBodyPathNodeIds = new Set<string>();
for (const innerForId of directInnerForIds) {
- if (innerForId === undefined) {
- return null;
- }
-
const innerIterationEdges = edges.filter(
(edge) => edge.source.node_id === innerForId && ITERATION_OUTPUT_FIELDS.has(edge.source.field)
);
if (innerIterationEdges.length === 0) {
return null;
}
+
const innerReachableBodyNodeIds = walk(
innerIterationEdges.map((edge) => edge.destination.node_id),
outgoing
);
const innerReachableReturnIds = [...innerReachableBodyNodeIds].filter(
- (nodeId) => nodes[nodeId]?.type === 'for_return'
+ (nodeId) => nodesById.get(nodeId)?.type === 'for_return'
);
const innerReturnId = linkedReturnByForId.get(innerForId);
if (innerReturnId === undefined || !innerReachableReturnIds.includes(innerReturnId)) {
@@ -214,10 +410,12 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
[...innerReachableBodyNodeIds].filter((nodeId) => nodeId === innerReturnId || innerReturnAncestors.has(nodeId))
);
childBodyPathNodeIds.add(innerReturnId);
- const innerNestedForIds = [...childBodyPathNodeIds].filter((nodeId) => nodes[nodeId]?.type === 'for');
- if ([...childBodyPathNodeIds].some((nodeId) => nodes[nodeId]?.type === 'iterate')) {
+
+ const innerNestedForIds = [...childBodyPathNodeIds].filter((nodeId) => nodesById.get(nodeId)?.type === 'for');
+ if ([...childBodyPathNodeIds].some((nodeId) => nodesById.get(nodeId)?.type === 'iterate')) {
return null;
}
+
const innerNestedBody =
innerNestedForIds.length > 0
? getSupportedNestedForBody(innerForId, innerReachableBodyNodeIds, innerReachableReturnIds)
@@ -258,6 +456,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
innerBodyPathNodeIds.add(bodyNodeId);
}
}
+
if (
new Set(reachableReturnIds.filter((returnId) => !innerBodyPathNodeIds.has(returnId))).size !== 1 ||
!reachableReturnIds.includes(outerReturnId)
@@ -271,6 +470,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (outerReturnOutputEdges.length !== 1) {
return null;
}
+
const unsupportedOuterReturnInput = edges.some(
(edge) =>
edge.destination.node_id === outerReturnId &&
@@ -291,6 +491,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
}
outerPreparationNodeIds.add(innerForId);
}
+
const innerFinalDescendantNodeIds = new Set<string>();
for (const innerForId of directInnerForIds) {
for (const destinationId of edges
@@ -301,6 +502,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
}
}
}
+
const continuationNodeIds = new Set(
[...reachableBodyNodeIds].filter(
(nodeId) =>
@@ -326,10 +528,10 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
return null;
}
if (
- [...continuationNodeIds].some(
- (nodeId) =>
- nodes[nodeId]?.type === 'for' || nodes[nodeId]?.type === 'iterate' || nodes[nodeId]?.type === 'for_return'
- )
+ [...continuationNodeIds].some((nodeId) => {
+ const type = nodesById.get(nodeId)?.type;
+ return type === 'for' || type === 'iterate' || type === 'for_return';
+ })
) {
return null;
}
@@ -345,6 +547,7 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
) {
return null;
}
+
const outerReturnOutputSource = outerReturnOutputEdges[0]?.source;
if (outerReturnOutputSource !== undefined && directInnerForIds.includes(outerReturnOutputSource.node_id)) {
if (
@@ -383,7 +586,8 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (
[...outerPreparationNodeIds].some(
(nodeId) =>
- !directInnerForIds.includes(nodeId) && (nodes[nodeId]?.type === 'for' || nodes[nodeId]?.type === 'iterate')
+ !directInnerForIds.includes(nodeId) &&
+ (nodesById.get(nodeId)?.type === 'for' || nodesById.get(nodeId)?.type === 'iterate')
)
) {
return null;
@@ -402,21 +606,26 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
const matchingForIdsByReturnId = new Map<string, string[]>();
- for (const node of Object.values(nodes)) {
+ for (const node of nodes) {
if (node.type !== 'for') {
continue;
}
- const iterationEdges = edges.filter(
- (edge) => edge.source.node_id === node.id && ITERATION_OUTPUT_FIELDS.has(edge.source.field)
+ const collectionInputs = edges.filter(
+ (edge) => edge.destination.node_id === node.id && edge.destination.field === 'collection'
);
- if (
- edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'collection').length >
- 1 ||
- edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'state').length > 1
- ) {
+ const stateInputs = edges.filter(
+ (edge) => edge.destination.node_id === node.id && edge.destination.field === 'state'
+ );
+
+ if (collectionInputs.length > 1 || stateInputs.length > 1) {
return 'nodes.forLoopInputCount';
}
+
+ const iterationEdges = edges.filter(
+ (edge) => edge.source.node_id === node.id && ITERATION_OUTPUT_FIELDS.has(edge.source.field)
+ );
+
if (iterationEdges.length === 0) {
return 'nodes.forLoopMissingIterationOutput';
}
@@ -425,13 +634,22 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
iterationEdges.map((edge) => edge.destination.node_id),
outgoing
);
- const reachableReturnIds = [...reachableBodyNodeIds].filter((nodeId) => nodes[nodeId]?.type === 'for_return');
+ const reachableReturnIds = [...reachableBodyNodeIds].filter(
+ (nodeId) => nodesById.get(nodeId)?.type === 'for_return'
+ );
+ const linkedReturnId = linkedReturnByForId.get(node.id);
+
+ if (reachableBodyNodeIds.has(node.id)) {
+ return 'nodes.forLoopBodyEscape';
+ }
+
const nestedForNodeIds = [...reachableBodyNodeIds].filter(
(nodeId) =>
nodeId !== node.id &&
- nodes[nodeId]?.type === 'for' &&
+ nodesById.get(nodeId)?.type === 'for' &&
![...reachableBodyNodeIds].some(
- (otherNodeId) => otherNodeId !== nodeId && nodes[otherNodeId]?.type === 'for' && hasPath(otherNodeId, nodeId)
+ (otherNodeId) =>
+ otherNodeId !== nodeId && nodesById.get(otherNodeId)?.type === 'for' && hasPath(otherNodeId, nodeId)
)
);
const nestedBody =
@@ -440,7 +658,6 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
return 'nodes.forLoopNestedUnsupported';
}
- const linkedReturnId = linkedReturnByForId.get(node.id);
if (nestedBody === null && (linkedReturnId === undefined || !reachableReturnIds.includes(linkedReturnId))) {
return 'nodes.forLoopReturnCount';
}
@@ -466,13 +683,13 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
return 'nodes.forLoopUnterminatedBody';
}
- const iterateNodeIds = [...bodyPathNodeIds].filter((nodeId) => nodes[nodeId]?.type === 'iterate');
+ const iterateNodeIds = [...bodyPathNodeIds].filter((nodeId) => nodesById.get(nodeId)?.type === 'iterate');
if (
iterateNodeIds.length > 0 &&
!supportsNestedIterateBody(
bodyPathNodeIds,
iterateNodeIds,
- [...bodyPathNodeIds].filter((nodeId) => nodes[nodeId]?.type === 'collect'),
+ [...bodyPathNodeIds].filter((nodeId) => nodesById.get(nodeId)?.type === 'collect'),
returnId,
node.id
)
@@ -485,8 +702,8 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (sourceId === node.id || bodyPathNodeIds.has(sourceId)) {
continue;
}
- const activeSourceIds = walk([sourceId], incoming);
- if ([...activeSourceIds].some((sourceNodeId) => nodes[sourceNodeId]?.type === 'iterate')) {
+
+ if ([...walk([sourceId], incoming)].some((sourceNodeId) => nodesById.get(sourceNodeId)?.type === 'iterate')) {
return 'nodes.forLoopIteratorInputUnsupported';
}
}
@@ -507,22 +724,27 @@ export const validateForLoopGraph = (graph: Graph): ForLoopGraphError | null =>
if (bodyNodeId === returnId) {
continue;
}
+
if ((outgoing.get(bodyNodeId) ?? []).some((destinationId) => !bodyPathNodeIds.has(destinationId))) {
return 'nodes.forLoopBodyEscape';
}
}
}
- for (const node of Object.values(nodes)) {
- if (node.type === 'for_return' && matchingForIdsByReturnId.get(node.id)?.length !== 1) {
+ for (const node of nodes) {
+ if (node.type !== 'for_return') {
+ continue;
+ }
+
+ if (matchingForIdsByReturnId.get(node.id)?.length !== 1) {
return 'nodes.forReturnOwnership';
}
+
if (
- node.type === 'for_return' &&
- (edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'output').length > 1 ||
- edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'state').length > 1 ||
- edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'continue_condition')
- .length > 1)
+ edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'output').length > 1 ||
+ edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'state').length > 1 ||
+ edges.filter((edge) => edge.destination.node_id === node.id && edge.destination.field === 'continue_condition')
+ .length > 1
) {
return 'nodes.forReturnInputCount';
}
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/graphContracts.ts b/invokeai/frontend/webv2/src/features/workflow/core/graphContracts.ts
index fb27419d2c..b1ebc92dfb 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/graphContracts.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/graphContracts.ts
@@ -8,6 +8,7 @@ export interface WorkflowBackendGraph {
id: string;
nodes: Record<string, WorkflowBackendInvocation>;
edges: Array<{
+ type: 'default' | 'loop_linkage';
source: { node_id: string; field: string };
destination: { node_id: string; field: string };
}>;
@@ -20,6 +21,7 @@ export interface CompiledWorkflowGraph {
nodes: Array<{ id: string; type: string; inputs: Record<string, unknown> }>;
edges: Array<{
id: string;
+ type: 'default' | 'loop_linkage';
sourceNodeId: string;
sourceField: string;
targetNodeId: string;
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.test.ts
index c2884a31b4..c783613afc 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.test.ts
@@ -121,4 +121,43 @@ describe('previewGraphToDocument', () => {
expect(compiled.edges).toHaveLength(1);
expect(compiled.edges[0]).toMatchObject({ sourceNodeId: 'seed', targetField: 'seed' });
});
+
+ it('preserves a direct loop-linkage edge when opening a preview as a document', () => {
+ const loopTemplates = {
+ for: template('for', { collection: input('collection', { input: 'connection' }) }),
+ for_return: template('for_return', {
+ loop_linkage: input('loop_linkage', { input: 'connection' }),
+ output: input('output'),
+ }),
+ };
+ const loopGraph: PreviewGraphLike = {
+ edges: [
+ {
+ id: 'loop-edge',
+ sourceField: 'loop_linkage',
+ sourceNodeId: 'for',
+ targetField: 'loop_linkage',
+ targetNodeId: 'for-return',
+ type: 'loop_linkage',
+ },
+ ],
+ nodes: [
+ { id: 'for', inputs: {}, type: 'for' },
+ { id: 'for-return', inputs: {}, type: 'for_return' },
+ ],
+ };
+
+ const { document } = previewGraphToDocument(loopGraph, loopTemplates);
+
+ expect(document.edges).toEqual([
+ {
+ id: expect.any(String),
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'for-return',
+ targetHandle: 'loop_linkage',
+ type: 'loop_linkage',
+ },
+ ]);
+ });
});
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.ts b/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.ts
index 36322488e3..a3d3497989 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/graphToDocument.ts
@@ -11,7 +11,14 @@ import { getLayeredPositions } from './graphLayout';
export interface PreviewGraphLike {
label?: string;
nodes: Array<{ id: string; type: string; inputs: Record<string, unknown> }>;
- edges: Array<{ id: string; sourceField: string; sourceNodeId: string; targetField: string; targetNodeId: string }>;
+ edges: Array<{
+ id: string;
+ sourceField: string;
+ sourceNodeId: string;
+ targetField: string;
+ targetNodeId: string;
+ type?: 'default' | 'loop_linkage';
+ }>;
}
export interface PreviewGraphDocumentResult {
@@ -101,7 +108,7 @@ export const previewGraphToDocument = (
sourceHandle: graphEdge.sourceField,
target: graphEdge.targetNodeId,
targetHandle: graphEdge.targetField,
- type: 'default',
+ type: graphEdge.type ?? 'default',
});
}
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts
index daa9f139e9..a875466654 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts
@@ -346,6 +346,7 @@ describe('buildLayerWorkflowGraph', () => {
expect(built.graph.edges).toContainEqual({
destination: { field: 'image', node_id: built.outputNodeId },
source: { field: 'result', node_id: 'processor' },
+ type: 'default',
});
expect(Object.values(built.graph.nodes).every((graphNode) => graphNode.is_intermediate === true)).toBe(true);
});
@@ -374,10 +375,12 @@ describe('buildLayerWorkflowGraph', () => {
expect(built.graph.edges).toContainEqual({
destination: { field: 'image', node_id: 'layer-workflow-source' },
source: { field: 'image', node_id: 'layer-workflow-source-1' },
+ type: 'default',
});
expect(built.graph.edges).toContainEqual({
destination: { field: 'image', node_id: 'layer-workflow-output-1' },
source: { field: 'image', node_id: 'layer-workflow-output' },
+ type: 'default',
});
});
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
index 45493648df..51f0abf160 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
@@ -280,6 +280,7 @@ export const buildLayerWorkflowGraph = (options: BuildLayerWorkflowGraphOptions)
graph.edges.push({
destination: { field: input.fieldName, node_id: input.nodeId },
source: { field: 'image', node_id: sourceNodeId },
+ type: 'default',
});
}
@@ -298,6 +299,7 @@ export const buildLayerWorkflowGraph = (options: BuildLayerWorkflowGraphOptions)
graph.edges.push({
destination: { field: 'image', node_id: outputNodeId },
source: { field: output.fieldName, node_id: output.nodeId },
+ type: 'default',
});
return { graph, outputNodeId };
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/outputFields.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/outputFields.test.ts
new file mode 100644
index 0000000000..18f27db9c8
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/workflow/core/outputFields.test.ts
@@ -0,0 +1,53 @@
+import { describe, expect, it } from 'vitest';
+
+import { getOutputFieldNamesByScope, getOutputFieldRows } from './outputFields';
+
+describe('output field scopes', () => {
+ it('groups visible outputs and keeps hidden scheduler outputs out of the node body', () => {
+ const fields = [
+ {
+ name: 'loop_linkage',
+ title: 'Linkage',
+ description: '',
+ type: { name: 'AnyField', cardinality: 'SINGLE' as const, batch: false },
+ },
+ {
+ name: 'item',
+ title: 'Item',
+ description: '',
+ outputScope: 'iteration' as const,
+ type: { name: 'AnyField', cardinality: 'SINGLE' as const, batch: false },
+ },
+ {
+ name: 'output',
+ title: 'Output',
+ description: '',
+ uiHidden: true,
+ type: { name: 'AnyField', cardinality: 'SINGLE' as const, batch: false },
+ },
+ {
+ name: 'output_collection',
+ title: 'Collection',
+ description: '',
+ outputScope: 'final' as const,
+ type: { name: 'CollectionField', cardinality: 'COLLECTION' as const, batch: false },
+ },
+ ];
+
+ const names = getOutputFieldNamesByScope(fields);
+
+ expect(names).toEqual({
+ all: ['loop_linkage', 'item', 'output_collection'],
+ final: ['output_collection'],
+ iteration: ['item'],
+ unscoped: ['loop_linkage'],
+ });
+ expect(getOutputFieldRows(names)).toEqual([
+ { fieldName: 'loop_linkage', type: 'field' },
+ { scope: 'iteration', type: 'header' },
+ { fieldName: 'item', type: 'field' },
+ { scope: 'final', type: 'header' },
+ { fieldName: 'output_collection', type: 'field' },
+ ]);
+ });
+});
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/outputFields.ts b/invokeai/frontend/webv2/src/features/workflow/core/outputFields.ts
new file mode 100644
index 0000000000..e955b53bd5
--- /dev/null
+++ b/invokeai/frontend/webv2/src/features/workflow/core/outputFields.ts
@@ -0,0 +1,42 @@
+import type { FieldOutputTemplate } from './types';
+
+export interface OutputFieldNamesByScope {
+ all: string[];
+ unscoped: string[];
+ iteration: string[];
+ final: string[];
+}
+
+export type OutputFieldRow = { type: 'field'; fieldName: string } | { type: 'header'; scope: 'iteration' | 'final' };
+
+export const getOutputFieldNamesByScope = (fields: FieldOutputTemplate[]): OutputFieldNamesByScope => {
+ const all = fields.filter((field) => !field.uiHidden).map((field) => field.name);
+ const fieldsByName = new Map(fields.map((field) => [field.name, field]));
+
+ return {
+ all,
+ final: all.filter((name) => fieldsByName.get(name)?.outputScope === 'final'),
+ iteration: all.filter((name) => fieldsByName.get(name)?.outputScope === 'iteration'),
+ unscoped: all.filter((name) => !fieldsByName.get(name)?.outputScope),
+ };
+};
+
+export const getOutputFieldRows = (fieldNames: OutputFieldNamesByScope): OutputFieldRow[] => {
+ if (fieldNames.iteration.length === 0 && fieldNames.final.length === 0) {
+ return fieldNames.all.map((fieldName) => ({ fieldName, type: 'field' as const }));
+ }
+
+ const rows: OutputFieldRow[] = fieldNames.unscoped.map((fieldName) => ({ fieldName, type: 'field' as const }));
+
+ if (fieldNames.iteration.length > 0) {
+ rows.push({ scope: 'iteration', type: 'header' });
+ rows.push(...fieldNames.iteration.map((fieldName) => ({ fieldName, type: 'field' as const })));
+ }
+
+ if (fieldNames.final.length > 0) {
+ rows.push({ scope: 'final', type: 'header' });
+ rows.push(...fieldNames.final.map((fieldName) => ({ fieldName, type: 'field' as const })));
+ }
+
+ return rows;
+};
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/types.ts b/invokeai/frontend/webv2/src/features/workflow/core/types.ts
index 385df5c7fc..0a732556b9 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/types.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/types.ts
@@ -55,6 +55,8 @@ export interface FieldOutputTemplate {
title: string;
description: string;
type: FieldType;
+ outputScope?: 'iteration' | 'final';
+ uiHidden?: boolean;
}
export interface InvocationTemplate {
@@ -144,7 +146,7 @@ export type WorkflowNode =
export interface WorkflowEdge {
id: string;
- type: 'default';
+ type: 'default' | 'loop_linkage';
source: string;
target: string;
sourceHandle: string;
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/validation.ts b/invokeai/frontend/webv2/src/features/workflow/core/validation.ts
index 0703896b00..de645e7cc5 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/validation.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/validation.ts
@@ -14,10 +14,13 @@ import {
CONNECTOR_OUTPUT_HANDLE,
resolveConnectorSourceIndexed,
resolveConnectorTargetsIndexed,
+ resolveLoopLinkagePath,
} from './connectors';
import { createWorkflowGraphIndex, type WorkflowGraphIndex } from './graphIndex';
import { isConnectorNode, isInvocationNode } from './types';
+export const LOOP_LINKAGE_FIELD = 'loop_linkage';
+
/**
* Connection validation, ported from the legacy editor's
* `validateConnectionTypes` / `validateConnection`. Connector nodes are
@@ -106,6 +109,9 @@ export const wouldCreateCycle = (sourceNodeId: string, targetNodeId: string, edg
visited.add(nodeId);
for (const edge of edges) {
+ if (edge.type === 'loop_linkage') {
+ continue;
+ }
if (edge.source === nodeId) {
stack.push(edge.target);
}
@@ -120,6 +126,9 @@ export const hasAnyCycle = (nodes: WorkflowNode[], edges: WorkflowEdge[]): boole
const adjacency = new Map<string, string[]>();
for (const edge of edges) {
+ if (edge.type === 'loop_linkage') {
+ continue;
+ }
adjacency.set(edge.source, [...(adjacency.get(edge.source) ?? []), edge.target]);
}
@@ -300,6 +309,78 @@ const hasValidSourceHandle = (node: WorkflowNode, handle: string, templates: Inv
return isConnectorNode(node) && handle === CONNECTOR_OUTPUT_HANDLE;
};
+const isLoopLinkageHandle = (handle: string): boolean => handle === LOOP_LINKAGE_FIELD;
+
+const isValidLoopLinkageConnection = (
+ sourceNode: WorkflowNode,
+ sourceHandle: string,
+ targetNode: WorkflowNode,
+ targetHandle: string,
+ document: Pick<ProjectGraphState, 'edges' | 'nodes'>,
+ index: WorkflowGraphIndex,
+ templates: InvocationTemplates
+): boolean => {
+ if (isInvocationNode(sourceNode) && isInvocationNode(targetNode)) {
+ return (
+ sourceNode.data.type === 'for' &&
+ targetNode.data.type === 'for_return' &&
+ sourceHandle === LOOP_LINKAGE_FIELD &&
+ targetHandle === LOOP_LINKAGE_FIELD
+ );
+ }
+
+ if (isInvocationNode(sourceNode) && isConnectorNode(targetNode)) {
+ return (
+ sourceNode.data.type === 'for' && sourceHandle === LOOP_LINKAGE_FIELD && targetHandle === CONNECTOR_INPUT_HANDLE
+ );
+ }
+
+ if (isConnectorNode(sourceNode) && isInvocationNode(targetNode)) {
+ if (
+ targetNode.data.type !== 'for_return' ||
+ targetHandle !== LOOP_LINKAGE_FIELD ||
+ sourceHandle !== CONNECTOR_OUTPUT_HANDLE
+ ) {
+ return false;
+ }
+
+ const resolvedSource = resolveConnectorSourceIndexed(sourceNode.id, index, templates);
+ const resolvedSourceNode = resolvedSource ? index.nodesById.get(resolvedSource.nodeId) : undefined;
+
+ return (
+ resolvedSource !== null &&
+ resolvedSourceNode !== undefined &&
+ isInvocationNode(resolvedSourceNode) &&
+ resolvedSourceNode.data.type === 'for' &&
+ resolvedSource.fieldName === LOOP_LINKAGE_FIELD &&
+ resolveLoopLinkagePath(
+ {
+ id: '__candidate-loop-linkage__',
+ source: sourceNode.id,
+ sourceHandle,
+ target: targetNode.id,
+ targetHandle,
+ type: 'default',
+ },
+ document.nodes,
+ [
+ ...document.edges,
+ {
+ id: '__candidate-loop-linkage__',
+ source: sourceNode.id,
+ sourceHandle,
+ target: targetNode.id,
+ targetHandle,
+ type: 'default',
+ },
+ ]
+ ) !== null
+ );
+ }
+
+ return false;
+};
+
/** Returns a human-readable rejection reason, or null when the connection is valid. */
export const validateConnection = (
candidate: ConnectionCandidate,
@@ -324,6 +405,12 @@ export const validateConnection = (
return 'One of the fields has no known definition.';
}
+ if (isLoopLinkageHandle(sourceHandle) || isLoopLinkageHandle(targetHandle)) {
+ if (!isValidLoopLinkageConnection(sourceNode, sourceHandle, targetNode, targetHandle, document, index, templates)) {
+ return 'For loop linkage must connect a For to its ForReturn.';
+ }
+ }
+
if (isConnectorNode(targetNode)) {
if (targetHandle !== CONNECTOR_INPUT_HANDLE) {
return 'Connectors only accept input on their left handle.';
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.test.ts b/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.test.ts
index f2e8d95b67..a1ee7574bc 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.test.ts
@@ -175,6 +175,43 @@ describe('parseWorkflowJson tolerance', () => {
]);
});
+ it('round-trips a direct loop_linkage edge without inferring it from handles', () => {
+ const { document, warnings } = parseWorkflowJson({
+ edges: [
+ {
+ id: 'link',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'loop_linkage',
+ },
+ ],
+ nodes: [
+ { data: { id: 'for', inputs: {}, type: 'for' }, id: 'for', position: { x: 0, y: 0 }, type: 'invocation' },
+ {
+ data: { id: 'return', inputs: {}, type: 'for_return' },
+ id: 'return',
+ position: { x: 0, y: 0 },
+ type: 'invocation',
+ },
+ ],
+ });
+
+ expect(warnings).toEqual([]);
+ expect(document.edges[0]?.type).toBe('loop_linkage');
+ expect(serializeWorkflowJson(document).edges).toEqual([
+ {
+ id: 'link',
+ source: 'for',
+ sourceHandle: 'loop_linkage',
+ target: 'return',
+ targetHandle: 'loop_linkage',
+ type: 'loop_linkage',
+ },
+ ]);
+ });
+
it('drops dangling edges and unknown form elements with warnings', () => {
const { document, warnings } = parseWorkflowJson({
edges: [{ id: 'e1', source: 'missing', sourceHandle: 'out', target: 'n1', targetHandle: 'in', type: 'default' }],
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.ts b/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.ts
index c64ea1afe2..858d0e7257 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/workflowJson.ts
@@ -76,13 +76,13 @@ const zConnectorNode = z.object({
const zAnyNode = z.union([zInvocationNode, zNotesNode, zCurrentImageNode, zConnectorNode]);
-const zDefaultEdge = z.object({
+const zWorkflowEdge = z.object({
id: z.string().catch(''),
source: z.string().min(1),
sourceHandle: z.string().min(1),
target: z.string().min(1),
targetHandle: z.string().min(1),
- type: z.literal('default').catch('default'),
+ type: z.enum(['default', 'loop_linkage']).catch('default'),
});
const zFieldIdentifier = z.object({ fieldName: z.string(), nodeId: z.string() });
@@ -304,7 +304,7 @@ export const parseWorkflowJson = (raw: unknown): ParsedWorkflow => {
}
const rawEdges = parsed.data.edges.flatMap((rawEdge) => {
- const edgeResult = zDefaultEdge.safeParse(rawEdge);
+ const edgeResult = zWorkflowEdge.safeParse(rawEdge);
return edgeResult.success ? [edgeResult.data] : [];
});
@@ -324,7 +324,7 @@ export const parseWorkflowJson = (raw: unknown): ParsedWorkflow => {
sourceHandle: edge.sourceHandle,
target: edge.target,
targetHandle: edge.targetHandle,
- type: 'default',
+ type: edge.type,
});
}
diff --git a/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts b/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts
index 1e49bd1bbd..567524b9e8 100644
--- a/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/data/templates.test.ts
@@ -238,6 +238,38 @@ describe('parseOpenApiToTemplates', () => {
expect(templates.denoise?.outputs.latents?.type.name).toBe('LatentsField');
expect(templates.add?.outputs.value?.type.name).toBe('IntegerField');
});
+
+ it('preserves output scopes and hidden scheduler outputs', () => {
+ const parsed = parseOpenApiToTemplates({
+ components: {
+ schemas: {
+ ForInvocation: {
+ class: 'invocation',
+ output: { $ref: '#/components/schemas/ForOutput' },
+ properties: { type: { default: 'for' } },
+ },
+ ForOutput: {
+ class: 'output',
+ properties: {
+ item: { field_kind: 'output', output_scope: 'iteration', type: 'string' },
+ output_collection: {
+ field_kind: 'output',
+ output_scope: 'final',
+ type: 'array',
+ items: { type: 'string' },
+ },
+ output: { field_kind: 'output', ui_hidden: true, type: 'string' },
+ type: { default: 'for_output' },
+ },
+ },
+ },
+ },
+ });
+
+ expect(parsed.for?.outputs.item?.outputScope).toBe('iteration');
+ expect(parsed.for?.outputs.output_collection?.outputScope).toBe('final');
+ expect(parsed.for?.outputs.output?.uiHidden).toBe(true);
+ });
});
describe('parseFieldType', () => {
diff --git a/invokeai/frontend/webv2/src/features/workflow/data/templates.ts b/invokeai/frontend/webv2/src/features/workflow/data/templates.ts
index 124d575797..0e9800211b 100644
--- a/invokeai/frontend/webv2/src/features/workflow/data/templates.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/data/templates.ts
@@ -341,8 +341,13 @@ const parseInvocationSchema = (schema: JsonObject, schemas: JsonObject): Invocat
outputs[name] = {
description: typeof rawProperty.description === 'string' ? rawProperty.description : '',
name,
+ outputScope:
+ rawProperty.output_scope === 'iteration' || rawProperty.output_scope === 'final'
+ ? rawProperty.output_scope
+ : undefined,
title: typeof rawProperty.title === 'string' ? rawProperty.title : startCase(name),
type: fieldType,
+ uiHidden: rawProperty.ui_hidden === true,
};
}
diff --git a/invokeai/frontend/webv2/src/features/workflow/graph.ts b/invokeai/frontend/webv2/src/features/workflow/graph.ts
index d01f7b2bf7..c341003884 100644
--- a/invokeai/frontend/webv2/src/features/workflow/graph.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/graph.ts
@@ -1,2 +1,3 @@
export * from './core/buildGraph';
+export * from './core/forLoops';
export * from './core/layerWorkflow';
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowWidgetChrome.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowWidgetChrome.tsx
index 6ce17c435a..d8bc78a56c 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowWidgetChrome.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/WorkflowWidgetChrome.tsx
@@ -14,6 +14,8 @@ import {
createWorkflowId,
getCompatibleInputTemplate,
getCompatibleOutputTemplate,
+ LOOP_LINKAGE_FIELD,
+ resolveConnectorSource,
parseWorkflowJson,
serializeWorkflowJson,
} from '@features/workflow/utility';
@@ -410,29 +412,76 @@ export const WorkflowDialogHost = () => {
}
if (addNodeConnection.kind === 'source') {
- const targetInput = getCompatibleInputTemplate(template, addNodeConnection.sourceType);
+ const targetInput =
+ addNodeConnection.sourceHandle === LOOP_LINKAGE_FIELD && template.type === 'for_return'
+ ? template.inputs[LOOP_LINKAGE_FIELD]
+ : template.type === 'for_return'
+ ? template.inputs.output
+ : getCompatibleInputTemplate(template, addNodeConnection.sourceType);
if (!targetInput) {
editGraph({ node, type: 'addNode' });
return;
}
+ const edge = {
+ id: createWorkflowId('edge'),
+ source: addNodeConnection.sourceNodeId,
+ sourceHandle: addNodeConnection.sourceHandle,
+ target: node.id,
+ targetHandle: targetInput.name,
+ type:
+ addNodeConnection.sourceHandle === LOOP_LINKAGE_FIELD && template.type === 'for_return'
+ ? ('loop_linkage' as const)
+ : ('default' as const),
+ };
+
editGraph({
- edge: {
- id: createWorkflowId('edge'),
- source: addNodeConnection.sourceNodeId,
- sourceHandle: addNodeConnection.sourceHandle,
- target: node.id,
- targetHandle: targetInput.name,
- type: 'default',
- },
+ edge,
node,
type: 'addNodeAndEdge',
});
+
+ const currentGraph = projectStore.getSnapshot().projectGraph;
+ const sourceNode = currentGraph.nodes.find((candidate) => candidate.id === addNodeConnection.sourceNodeId);
+ const resolvedSource =
+ sourceNode?.type === 'connector'
+ ? resolveConnectorSource(sourceNode.id, currentGraph.nodes, currentGraph.edges)
+ : sourceNode?.type === 'invocation'
+ ? { fieldName: addNodeConnection.sourceHandle, nodeId: sourceNode.id, type: null }
+ : null;
+ const resolvedSourceNode = currentGraph.nodes.find((candidate) => candidate.id === resolvedSource?.nodeId);
+ const shouldAddLoopLinkage =
+ template.type === 'for_return' &&
+ addNodeConnection.sourceHandle !== LOOP_LINKAGE_FIELD &&
+ ['item', 'index', 'total', 'state'].includes(addNodeConnection.sourceHandle) &&
+ ['item', 'index', 'total', 'state'].includes(resolvedSource?.fieldName ?? '') &&
+ resolvedSourceNode?.type === 'invocation' &&
+ resolvedSourceNode.data.type === 'for' &&
+ !currentGraph.edges.some(
+ (candidate) => candidate.source === resolvedSourceNode.id && candidate.sourceHandle === LOOP_LINKAGE_FIELD
+ );
+
+ if (shouldAddLoopLinkage && resolvedSourceNode?.type === 'invocation') {
+ editGraph({
+ edge: {
+ id: createWorkflowId('edge'),
+ source: resolvedSourceNode.id,
+ sourceHandle: LOOP_LINKAGE_FIELD,
+ target: node.id,
+ targetHandle: LOOP_LINKAGE_FIELD,
+ type: 'loop_linkage',
+ },
+ type: 'addEdge',
+ });
+ }
return;
}
- const sourceOutput = getCompatibleOutputTemplate(template, addNodeConnection.targetType);
+ const sourceOutput =
+ addNodeConnection.targetHandle === LOOP_LINKAGE_FIELD && template.type === 'for'
+ ? template.outputs[LOOP_LINKAGE_FIELD]
+ : getCompatibleOutputTemplate(template, addNodeConnection.targetType);
if (!sourceOutput) {
editGraph({ node, type: 'addNode' });
@@ -446,13 +495,16 @@ export const WorkflowDialogHost = () => {
sourceHandle: sourceOutput.name,
target: addNodeConnection.targetNodeId,
targetHandle: addNodeConnection.targetHandle,
- type: 'default',
+ type:
+ addNodeConnection.targetHandle === LOOP_LINKAGE_FIELD && template.type === 'for'
+ ? 'loop_linkage'
+ : 'default',
},
node,
type: 'addNodeAndEdge',
});
},
- [addNodeConnection, editGraph, getInsertPosition]
+ [addNodeConnection, editGraph, getInsertPosition, projectStore]
);
const addNote = useCallback(() => {
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts b/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts
index 17545d7886..d8eae6887a 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/contracts.ts
@@ -86,6 +86,7 @@ export interface WorkflowPreviewGraph {
sourceField: string;
targetNodeId: string;
targetField: string;
+ type?: 'default' | 'loop_linkage';
}>;
backendGraph?: unknown;
}
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/AddNodeDialog.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/AddNodeDialog.tsx
index 62d336b2bd..b29585f977 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/AddNodeDialog.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/AddNodeDialog.tsx
@@ -1,10 +1,16 @@
-import type { InvocationTemplate } from '@features/workflow/contracts';
+import type { InvocationTemplate, InvocationTemplates } from '@features/workflow/contracts';
+import type { WorkflowNode } from '@features/workflow/core/types';
import type { AddNodeConnectionFilter } from '@features/workflow/ui/workflowUiStore';
import { Badge, Box, Dialog, HStack, Icon, Input, Portal, ScrollArea, Stack, Text } from '@chakra-ui/react';
import { useInvocationTemplatesSelector } from '@features/workflow/react';
import { useWorkflowUi } from '@features/workflow/ui/WorkflowUiContext';
-import { getCompatibleInputTemplate, getCompatibleOutputTemplate } from '@features/workflow/utility';
+import {
+ getCompatibleInputTemplate,
+ getCompatibleOutputTemplate,
+ LOOP_LINKAGE_FIELD,
+ resolveConnectorSource,
+} from '@features/workflow/utility';
import { useMountEffect } from '@platform/react/useMountEffect';
import { IconButton, Tooltip } from '@platform/ui';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
@@ -56,12 +62,50 @@ const isCompatibleConnectionTemplate = (
}
if (connectionFilter.kind === 'source') {
+ if (connectionFilter.sourceHandle === LOOP_LINKAGE_FIELD) {
+ return template.type === 'for_return' && template.inputs[LOOP_LINKAGE_FIELD] !== undefined;
+ }
+
return getCompatibleInputTemplate(template, connectionFilter.sourceType) !== null;
}
+ if (connectionFilter.targetHandle === LOOP_LINKAGE_FIELD) {
+ return template.type === 'for' && template.outputs[LOOP_LINKAGE_FIELD] !== undefined;
+ }
+
return getCompatibleOutputTemplate(template, connectionFilter.targetType) !== null;
};
+const isForIterationOutputConnection = (
+ connectionFilter: AddNodeConnectionFilter | null,
+ nodes: WorkflowNode[],
+ edges: Parameters<typeof resolveConnectorSource>[2],
+ templates: InvocationTemplates
+): boolean => {
+ if (!connectionFilter || connectionFilter.kind !== 'source') {
+ return false;
+ }
+
+ const sourceNode = nodes.find((node) => node.id === connectionFilter.sourceNodeId);
+ const resolvedSource =
+ sourceNode?.type === 'connector'
+ ? resolveConnectorSource(sourceNode.id, nodes, edges, templates)
+ : sourceNode?.type === 'invocation'
+ ? { fieldName: connectionFilter.sourceHandle, nodeId: sourceNode.id }
+ : null;
+
+ if (!resolvedSource) {
+ return false;
+ }
+
+ const resolvedSourceNode = nodes.find((node) => node.id === resolvedSource.nodeId);
+ return (
+ resolvedSourceNode?.type === 'invocation' &&
+ resolvedSourceNode.data.type === 'for' &&
+ templates[resolvedSourceNode.data.type]?.outputs[resolvedSource.fieldName]?.outputScope === 'iteration'
+ );
+};
+
const getConnectionFilterName = (connectionFilter: AddNodeConnectionFilter): string => {
if (connectionFilter.kind === 'source') {
return connectionFilter.sourceType?.name ?? 'connector';
@@ -266,7 +310,7 @@ const AddNodeDialogContent = ({
onAddNote: () => void;
onOpenChange: (isOpen: boolean) => void;
}) => {
- const { registerModalHotkeyLayer } = useWorkflowUi();
+ const { getProjectGraph, registerModalHotkeyLayer } = useWorkflowUi();
const error = useInvocationTemplatesSelector((snapshot) => snapshot.error);
const status = useInvocationTemplatesSelector((snapshot) => snapshot.status);
const templates = useInvocationTemplatesSelector((snapshot) => snapshot.templates);
@@ -293,6 +337,13 @@ const AddNodeDialogContent = ({
const groups = useMemo<CategoryGroup[]>(() => {
const terms = searchTerm.trim().toLowerCase().split(/\s+/).filter(Boolean);
+ const projectGraph = getProjectGraph();
+ const shouldPromoteForReturn = isForIterationOutputConnection(
+ connectionFilter,
+ projectGraph.nodes,
+ projectGraph.edges,
+ templates
+ );
const utilityRows: NodeRow[] = [
{
description: 'Route a connection through a compact pass-through handle.',
@@ -363,14 +414,48 @@ const AddNodeDialogContent = ({
const categoryGroups = [...byCategory.entries()]
.map(([label, rows]) => ({
label,
- rows: rows.sort((a, b) => a.title.localeCompare(b.title, undefined, { sensitivity: 'base' })),
+ rows: rows.sort((a, b) => {
+ if (shouldPromoteForReturn) {
+ if (a.key === 'template:for_return' && b.key !== 'template:for_return') {
+ return -1;
+ }
+ if (a.key !== 'template:for_return' && b.key === 'template:for_return') {
+ return 1;
+ }
+ }
+
+ return a.title.localeCompare(b.title, undefined, { sensitivity: 'base' });
+ }),
}))
- .sort((a, b) => a.label.localeCompare(b.label));
+ .sort((a, b) => {
+ if (shouldPromoteForReturn) {
+ const aHasForReturn = a.rows.some((row) => row.key === 'template:for_return');
+ const bHasForReturn = b.rows.some((row) => row.key === 'template:for_return');
+ if (aHasForReturn && !bHasForReturn) {
+ return -1;
+ }
+ if (!aHasForReturn && bHasForReturn) {
+ return 1;
+ }
+ }
+
+ return a.label.localeCompare(b.label);
+ });
return utilityRows.length > 0
? [{ label: UTILITY_CATEGORY, rows: utilityRows }, ...categoryGroups]
: categoryGroups;
- }, [close, connectionFilter, onAddConnector, onAddCurrentImage, onAddNode, onAddNote, searchTerm, templates]);
+ }, [
+ close,
+ connectionFilter,
+ getProjectGraph,
+ onAddConnector,
+ onAddCurrentImage,
+ onAddNode,
+ onAddNote,
+ searchTerm,
+ templates,
+ ]);
const totalCount = groups.reduce((sum, group) => sum + group.rows.length, 0);
const isAllExpanded = groups.length > 0 && groups.every((group) => expandedCategories.has(group.label));
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/InvocationFlowNode.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/InvocationFlowNode.tsx
index 8cfc369f68..0f6b8395fd 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/InvocationFlowNode.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/InvocationFlowNode.tsx
@@ -18,6 +18,8 @@ import { useWorkflowNodeExecutionState } from '@features/workflow/ui/WorkflowUiC
import {
cloneWorkflowFieldDefault,
getFieldTypeLabel,
+ getOutputFieldNamesByScope,
+ getOutputFieldRows,
getWorkflowFieldInvalidReason,
isDirectInputField,
isExposableField,
@@ -478,6 +480,18 @@ const OutputFieldRow = ({ isSkeleton, template }: { isSkeleton: boolean; templat
);
};
+const OutputScopeHeader = ({ scope }: { scope: 'iteration' | 'final' }) => {
+ const { t } = useTranslation();
+
+ return (
+ <Box px={WORKFLOW_NODE_DENSITY.rowPaddingX} py={WORKFLOW_NODE_DENSITY.rowPaddingY}>
+ <Text color="fg.subtle" fontSize="2xs" fontWeight="600" textAlign="end">
+ {scope === 'iteration' ? t('nodes.iterationOutputs') : t('nodes.finalOutputs')}
+ </Text>
+ </Box>
+ );
+};
+
/** Keeps every handle mounted (invisible) so edges stay attached when rows are not rendered. */
const HiddenHandles = ({
inputTemplates,
@@ -609,6 +623,8 @@ const ExpandedInvocationNode = ({ data, selected }: NodeProps<InvocationFlowNode
const exposedFieldNames = new Set(data.exposedFieldNames);
const inputTemplates = templateView.inputTemplates;
const outputTemplates = templateView.outputTemplates;
+ const outputTemplatesByName = new Map(outputTemplates.map((template) => [template.name, template]));
+ const outputRows = getOutputFieldRows(getOutputFieldNamesByScope(outputTemplates));
const isOpen = node.data.isOpen;
const isRunning = execution?.status === 'running';
const isMissingRequiredInput = hasMissingRequiredInputs(node, Object.values(template.inputs), connectedFieldNames);
@@ -647,9 +663,17 @@ const ExpandedInvocationNode = ({ data, selected }: NodeProps<InvocationFlowNode
</>
) : isOpen ? (
<Box {...getWorkflowNodeBodyProps({ roundedBottom: !withFooter && !withOutputPreview })}>
- {outputTemplates.map((outputTemplate) => (
- <OutputFieldRow key={outputTemplate.name} isSkeleton={isZoomedOut} template={outputTemplate} />
- ))}
+ {outputRows.map((row) =>
+ row.type === 'header' ? (
+ <OutputScopeHeader key={`output-scope-${row.scope}`} scope={row.scope} />
+ ) : (
+ <OutputFieldRow
+ key={row.fieldName}
+ isSkeleton={isZoomedOut}
+ template={outputTemplatesByName.get(row.fieldName) as FieldOutputTemplate}
+ />
+ )
+ )}
{inputTemplates.map((inputTemplate) => (
<InputFieldRow
key={inputTemplate.name}
diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/LoopBodyBoundaryOverlay.tsx
similarity index 69%
rename from invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.tsx
rename to invokeai/frontend/webv2/src/features/workflow/ui/editor/LoopBodyBoundaryOverlay.tsx
index abb661d637..9b95f9e5d3 100644
--- a/invokeai/frontend/web/src/features/nodes/components/flow/LoopBodyBoundaryOverlay.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/LoopBodyBoundaryOverlay.tsx
@@ -1,40 +1,30 @@
-import { Box, Text } from '@invoke-ai/ui-library';
+import type { WorkflowEdge, WorkflowNode } from '@features/workflow/contracts';
+
+import { Box, Text } from '@chakra-ui/react';
+import { getForLoopBodyBoundaries, type LoopBodyBoundaryStatus } from '@features/workflow/utility';
import { useNodes, useReactFlow, ViewportPortal } from '@xyflow/react';
-import type { AnyEdge, AnyNode } from 'features/nodes/types/invocation';
-import { getForLoopBodyBoundaries, type LoopBodyBoundaryStatus } from 'features/nodes/util/graph/loopBodyBoundary';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-const BOUNDARY_PADDING = 24;
+import type { WorkflowFlowEdge, WorkflowFlowNode } from './flowAdapters';
-const getStatusColor = (status: LoopBodyBoundaryStatus) => {
- if (status === 'complete') {
- return {
- border: 'var(--invoke-colors-teal-400)',
- text: 'var(--invoke-colors-teal-200)',
- };
- }
- return {
- border: 'var(--invoke-colors-orange-400)',
- text: 'var(--invoke-colors-orange-200)',
- };
-};
+const BOUNDARY_PADDING = 24;
-type Props = {
- edges: AnyEdge[];
-};
+const getStatusColor = (status: LoopBodyBoundaryStatus) =>
+ status === 'complete' ? { border: 'green.400', text: 'green.200' } : { border: 'orange.400', text: 'orange.200' };
-const LoopBodyBoundaryOverlay = ({ edges }: Props) => {
+export const LoopBodyBoundaryOverlay = ({ edges }: { edges: WorkflowEdge[] }) => {
const { t } = useTranslation();
- const nodes = useNodes<AnyNode>();
- const { getNodesBounds } = useReactFlow<AnyNode, AnyEdge>();
-
+ const flowNodes = useNodes<WorkflowFlowNode>();
+ const { getNodesBounds } = useReactFlow<WorkflowFlowNode, WorkflowFlowEdge>();
+ const nodes = useMemo<WorkflowNode[]>(() => flowNodes.map((node) => node.data.documentNode), [flowNodes]);
const boundaries = useMemo(() => getForLoopBodyBoundaries(nodes, edges), [edges, nodes]);
return (
<ViewportPortal>
{boundaries.map((boundary) => {
const bounds = getNodesBounds(boundary.bodyNodeIds);
+
if (bounds.width <= 0 || bounds.height <= 0) {
return null;
}
@@ -48,17 +38,17 @@ const LoopBodyBoundaryOverlay = ({ edges }: Props) => {
return (
<Box
key={`${boundary.forNodeId ?? 'orphan'}-${boundary.returnNodeId ?? 'return'}-${boundary.status}`}
- position="absolute"
- pointerEvents="none"
- transform={`translate(${bounds.x - BOUNDARY_PADDING}px, ${bounds.y - BOUNDARY_PADDING}px)`}
- width={bounds.width + BOUNDARY_PADDING * 2}
- height={bounds.height + BOUNDARY_PADDING * 2}
+ aria-label={label}
border="2px dashed"
borderColor={colors.border}
borderRadius="base"
data-loop-body-boundary={boundary.forNodeId ?? boundary.returnNodeId}
data-loop-body-status={boundary.status}
- aria-label={label}
+ h={bounds.height + BOUNDARY_PADDING * 2}
+ pointerEvents="none"
+ position="absolute"
+ transform={`translate(${bounds.x - BOUNDARY_PADDING}px, ${bounds.y - BOUNDARY_PADDING}px)`}
+ w={bounds.width + BOUNDARY_PADDING * 2}
zIndex={0}
>
<Text
@@ -66,7 +56,7 @@ const LoopBodyBoundaryOverlay = ({ edges }: Props) => {
top={-6}
left={8}
px={1}
- bg="base.900"
+ bg="bg.canvas"
color={colors.text}
fontSize="xs"
lineHeight="short"
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/WorkflowEditorView.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/WorkflowEditorView.tsx
index 6974e01555..e13ca0fa54 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/WorkflowEditorView.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/WorkflowEditorView.tsx
@@ -20,6 +20,7 @@ import {
createWorkflowId,
getWorkflowSourceFieldType,
getWorkflowTargetFieldType,
+ LOOP_LINKAGE_FIELD,
validateConnection,
} from '@features/workflow/utility';
import { useModifierHeld } from '@platform/react/useModifierHeld';
@@ -72,6 +73,7 @@ import {
type WorkflowFlowInstance,
} from './flowInstanceStore';
import { InvocationFlowNode } from './InvocationFlowNode';
+import LoopBodyBoundaryOverlay from './LoopBodyBoundaryOverlay';
import { NodeContextMenu, type WorkflowContextMenuState } from './NodeContextMenu';
import { NotesFlowNode } from './NotesFlowNode';
import {
@@ -95,6 +97,7 @@ const nodeTypes: NodeTypes = {
const edgeTypes: EdgeTypes = {
default: WorkflowEdge,
+ loop_linkage: WorkflowEdge,
step: WorkflowEdge,
};
@@ -735,7 +738,10 @@ const WorkflowFlow = ({ runtime }: { runtime: WorkflowRuntimeApi }) => {
sourceHandle: connection.sourceHandle,
target: connection.target,
targetHandle: connection.targetHandle,
- type: 'default',
+ type:
+ connection.sourceHandle === LOOP_LINKAGE_FIELD && connection.targetHandle === LOOP_LINKAGE_FIELD
+ ? 'loop_linkage'
+ : 'default',
},
type: 'addEdge',
});
@@ -1073,6 +1079,7 @@ const WorkflowFlow = ({ runtime }: { runtime: WorkflowRuntimeApi }) => {
size={1.5}
variant={BackgroundVariant.Dots}
/>
+ <LoopBodyBoundaryOverlay edges={projectGraph.edges} />
<EditorToolbar
nodeOpacity={nodeOpacity}
tool={tool}
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.test.ts b/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.test.ts
index 809c50f3f7..d3daae7c33 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.test.ts
@@ -301,6 +301,18 @@ describe('flowAdapters identity preservation', () => {
});
});
+ it('renders direct loop linkage edges with their dedicated flow type and style', () => {
+ const doc = createDoc({
+ edges: [{ ...createEdge('link', 'a', 'value', 'b', 'a'), type: 'loop_linkage' }],
+ });
+ const rendered = toFlowEdges(doc, [], 'step', new Set(), createTemplates());
+
+ expect(rendered[0]).toMatchObject({
+ data: { fieldTypeLabel: 'Loop linkage', isLoopLinkage: true, stroke: '#22c55e', strokeDasharray: '6 4' },
+ type: 'loop_linkage',
+ });
+ });
+
it('replaces edges when templates resolve their field type styling', () => {
const doc = createDoc();
const untyped = toFlowEdges(doc, [], 'default');
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.ts b/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.ts
index 13d2084f1f..eb88ca2107 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/flowAdapters.ts
@@ -21,6 +21,7 @@ import {
createWorkflowGraphIndex,
getFieldTypeColor,
getFieldTypeLabel,
+ getEdgesWithLoopLinkageAliases,
getResolvedWorkflowEdgesIndexed,
getWorkflowSourceFieldType,
getWorkflowTargetFieldType,
@@ -300,17 +301,19 @@ export const withNodeSelection = (nodes: WorkflowFlowNode[], selectedIds: Set<st
/** xyflow edge component per the user's connection-style preference. */
export type FlowEdgeType = 'default' | 'step';
+export type WorkflowFlowEdgeType = FlowEdgeType | 'loop_linkage';
export interface WorkflowEdgeData extends Record<string, unknown> {
fieldTypeLabel: string;
pathType: FlowEdgeType;
+ isLoopLinkage?: boolean;
stroke: string;
strokeDasharray?: string;
strokeWidth: number;
tooltip: string;
}
-export type WorkflowFlowEdge = FlowEdge<WorkflowEdgeData, FlowEdgeType>;
+export type WorkflowFlowEdge = FlowEdge<WorkflowEdgeData, WorkflowFlowEdgeType>;
const UNKNOWN_EDGE_DATA = (pathType: FlowEdgeType): WorkflowEdgeData => ({
fieldTypeLabel: 'Unknown',
@@ -347,7 +350,16 @@ export const getWorkflowEdgeData = (
const fieldType = getWorkflowEdgeFieldType(document, templates, edge, index);
if (!fieldType) {
- return UNKNOWN_EDGE_DATA(pathType);
+ return edge.type === 'loop_linkage'
+ ? {
+ ...UNKNOWN_EDGE_DATA(pathType),
+ fieldTypeLabel: 'Loop linkage',
+ isLoopLinkage: true,
+ stroke: '#22c55e',
+ strokeDasharray: '6 4',
+ tooltip: 'Loop linkage',
+ }
+ : UNKNOWN_EDGE_DATA(pathType);
}
const fieldTypeLabel = getFieldTypeLabel(fieldType);
@@ -359,6 +371,18 @@ export const getWorkflowEdgeData = (
? '8 3 2 3'
: undefined;
+ if (edge.type === 'loop_linkage') {
+ return {
+ fieldTypeLabel: 'Loop linkage',
+ isLoopLinkage: true,
+ pathType,
+ stroke: '#22c55e',
+ strokeDasharray: '6 4',
+ strokeWidth: 2,
+ tooltip: 'Loop linkage',
+ };
+ }
+
return {
fieldTypeLabel,
pathType,
@@ -371,6 +395,7 @@ export const getWorkflowEdgeData = (
const isSameEdgeData = (a: WorkflowEdgeData | undefined, b: WorkflowEdgeData): boolean =>
a?.fieldTypeLabel === b.fieldTypeLabel &&
+ a.isLoopLinkage === b.isLoopLinkage &&
a.pathType === b.pathType &&
a.stroke === b.stroke &&
a.strokeDasharray === b.strokeDasharray &&
@@ -388,9 +413,10 @@ export const toFlowEdges = (
): WorkflowFlowEdge[] => {
const previousById = new Map(previousEdges.map((edge) => [edge.id, edge]));
- return document.edges.map((edge) => {
+ return getEdgesWithLoopLinkageAliases(document.nodes, document.edges).map((edge) => {
const previous = previousById.get(edge.id);
const data = getWorkflowEdgeData(document, edge, edgeType, templates, index);
+ const flowType: WorkflowFlowEdgeType = edge.type === 'loop_linkage' ? 'loop_linkage' : edgeType;
const isConnectedToSelectedNode = selectedNodeIds.has(edge.source) || selectedNodeIds.has(edge.target);
const animated = isConnectedToSelectedNode && !reduceMotion ? true : undefined;
const className = isConnectedToSelectedNode ? SELECTED_NODE_EDGE_CLASS : undefined;
@@ -399,7 +425,7 @@ export const toFlowEdges = (
if (
previous &&
- previous.type === edgeType &&
+ previous.type === flowType &&
previous.source === edge.source &&
previous.sourceHandle === edge.sourceHandle &&
previous.target === edge.target &&
@@ -424,7 +450,7 @@ export const toFlowEdges = (
style,
target: edge.target,
targetHandle: edge.targetHandle,
- type: edgeType,
+ type: flowType,
zIndex,
};
});
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/graph-preview/GraphPreviewFlow.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/graph-preview/GraphPreviewFlow.tsx
index 17a5e06fe5..c4a5915d5b 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/graph-preview/GraphPreviewFlow.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/graph-preview/GraphPreviewFlow.tsx
@@ -11,10 +11,10 @@ import type { TFunction } from 'i18next';
import { Badge, Box, Stack, Text } from '@chakra-ui/react';
import { isInvocationNode, type ProjectGraphState, type XYPosition } from '@features/workflow/contracts';
+import { getCanonicalWorkflowEdges } from '@features/workflow/core/forLoops';
import { getLayeredPositions } from '@features/workflow/core/graphLayout';
import '@xyflow/react/dist/style.css';
import { useWorkflowPreferencesSelector } from '@features/workflow/ui/WorkflowUiContext';
-import { getResolvedWorkflowEdges } from '@features/workflow/utility';
import { Background, BackgroundVariant, Handle, Position, ReactFlow } from '@xyflow/react';
import { useCallback, useId, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -48,14 +48,15 @@ export const documentToPreviewGraph = (
return {
graph: {
- edges: getResolvedWorkflowEdges(document.nodes, document.edges)
- .filter((edge) => invocationNodeIds.has(edge.source) && invocationNodeIds.has(edge.target))
+ edges: getCanonicalWorkflowEdges(document)
+ .filter((edge) => invocationNodeIds.has(edge.source.node_id) && invocationNodeIds.has(edge.destination.node_id))
.map((edge) => ({
id: edge.id,
- sourceField: edge.sourceHandle,
- sourceNodeId: edge.source,
- targetField: edge.targetHandle,
- targetNodeId: edge.target,
+ sourceField: edge.source.field,
+ sourceNodeId: edge.source.node_id,
+ targetField: edge.destination.field,
+ targetNodeId: edge.destination.node_id,
+ ...(edge.type ? { type: edge.type } : {}),
})),
id: document.id,
label: document.name || fallbackLabel,
@@ -140,6 +141,7 @@ const toPreviewEdges = (graph: WorkflowPreviewGraph): FlowEdge[] =>
source: edge.sourceNodeId,
target: edge.targetNodeId,
type: 'default',
+ ...(edge.type === 'loop_linkage' ? { style: { stroke: '#22c55e', strokeDasharray: '6 4', strokeWidth: 2 } } : {}),
}));
export const GraphPreviewFlow = ({
diff --git a/invokeai/frontend/webv2/src/features/workflow/utility.ts b/invokeai/frontend/webv2/src/features/workflow/utility.ts
index d22b04a8e8..dd4eb11cc7 100644
--- a/invokeai/frontend/webv2/src/features/workflow/utility.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/utility.ts
@@ -1,7 +1,9 @@
export * from './core/connectorHandles';
export * from './core/connectors';
export * from './core/document';
+export * from './core/forLoops';
export * from './core/fields';
export * from './core/graphIndex';
+export * from './core/outputFields';
export * from './core/validation';
export * from './core/workflowJson';
diff --git a/invokeai/frontend/webv2/src/workbench/graphContracts.ts b/invokeai/frontend/webv2/src/workbench/graphContracts.ts
index 6c03985f8a..5aff3710e1 100644
--- a/invokeai/frontend/webv2/src/workbench/graphContracts.ts
+++ b/invokeai/frontend/webv2/src/workbench/graphContracts.ts
@@ -12,6 +12,8 @@ export interface GraphEdgeContract {
sourceField: string;
targetNodeId: string;
targetField: string;
+ /** Direct loop-control edges retain their semantic type through queue snapshots. */
+ type?: 'default' | 'loop_linkage';
}
export interface GraphContract {
@@ -31,6 +33,8 @@ export interface BackendInvocationContract {
}
export interface BackendGraphEdgeContract {
+ /** Direct loop-control edges are distinct from ordinary data-flow edges. */
+ type?: 'default' | 'loop_linkage';
source: {
node_id: string;
field: string;
diff --git a/invokeai/frontend/webv2/src/workbench/workbenchState.ts b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
index 85ba3adeaa..db04befdd2 100644
--- a/invokeai/frontend/webv2/src/workbench/workbenchState.ts
+++ b/invokeai/frontend/webv2/src/workbench/workbenchState.ts
@@ -619,6 +619,7 @@ const cloneGraph = (graph: GraphContract): GraphContract => ({
edges: graph.backendGraph.edges.map((edge) => ({
destination: { ...edge.destination },
source: { ...edge.source },
+ ...(edge.type ? { type: edge.type } : {}),
})),
nodes: Object.fromEntries(Object.entries(graph.backendGraph.nodes).map(([id, node]) => [id, { ...node }])),
}