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.

chore(webv2): remove inert layer workflow metadata helper

JPPhotocd6aa29087d8
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 0da352b908..2f9377d808 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.test.ts
@@ -15,7 +15,6 @@ import { buildConnectorNode, buildInvocationNode, createProjectGraph } from './d
import {
buildLayerWorkflowGraph,
getDefaultLayerWorkflowSelection,
- getLayerWorkflowInjectedInput,
getLayerWorkflowInputs,
getLayerWorkflowOutputs,
getRunnableLayerWorkflowInputs,
@@ -323,22 +322,6 @@ describe('layer workflow dialog selection', () => {
});
describe('buildLayerWorkflowGraph', () => {
- it('preserves an explicit description override when injecting the layer image', () => {
- expect(
- getLayerWorkflowInjectedInput(
- { description: '', descriptionOverride: true, label: 'Layer image', name: 'image', value: undefined },
- 'image',
- 'layer.png'
- )
- ).toEqual({
- description: '',
- descriptionOverride: true,
- label: 'Layer image',
- name: 'image',
- value: { image_name: 'layer.png' },
- });
- });
-
it('injects a direct-capable input before readiness without mutating the document', () => {
const processorTemplate = template(
'processor',
diff --git a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
index 137ee81091..ed6d5b914e 100644
--- a/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
+++ b/invokeai/frontend/webv2/src/features/workflow/core/layerWorkflow.ts
@@ -5,7 +5,6 @@ import type {
InvocationTemplates,
InvocationTemplatesSnapshot,
ProjectGraphState,
- WorkflowFieldInstance,
WorkflowInvocationNode,
} from './types';
@@ -186,18 +185,6 @@ const getAvailableBinding = (
selected: WorkflowImageBinding
): WorkflowImageBinding | undefined => bindings.find((candidate) => isSameBinding(candidate, selected));
-export const getLayerWorkflowInjectedInput = (
- instance: WorkflowFieldInstance | undefined,
- fieldName: string,
- imageName: string
-): WorkflowFieldInstance => ({
- label: instance?.label ?? '',
- name: fieldName,
- ...(instance?.description === undefined ? {} : { description: instance.description }),
- ...(instance?.descriptionOverride === undefined ? {} : { descriptionOverride: instance.descriptionOverride }),
- value: { image_name: imageName },
-});
-
const allocateNodeId = (graph: WorkflowBackendGraph, base: string): string => {
if (!graph.nodes[base]) {
return base;
@@ -268,7 +255,12 @@ export const buildLayerWorkflowGraph = (options: BuildLayerWorkflowGraphOptions)
if (!isConnectionOnly) {
const instance = inputNode.data.inputs[input.fieldName];
- inputNode.data.inputs[input.fieldName] = getLayerWorkflowInjectedInput(instance, input.fieldName, imageName);
+ inputNode.data.inputs[input.fieldName] = {
+ label: instance?.label ?? '',
+ name: input.fieldName,
+ ...(instance?.description === undefined ? {} : { description: instance.description }),
+ value: { image_name: imageName },
+ };
}
const readiness = getProjectGraphReadiness(cloned, templatesSnapshot, { externallySatisfiedInputs });