Skip to content

Commit 0a7d06f

Browse files
fix(ui): fix circular imports
The logic that introduced a circular import was actually extraneous. I have entirely removed it.
1 parent 4092d05 commit 0a7d06f

File tree

1 file changed

+1
-14
lines changed
  • invokeai/frontend/web/src/features/nodes/types

1 file changed

+1
-14
lines changed

invokeai/frontend/web/src/features/nodes/types/types.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { store } from 'app/store/store';
21
import {
32
SchedulerParam,
43
zBaseModel,
@@ -10,14 +9,14 @@ import { keyBy } from 'lodash-es';
109
import { OpenAPIV3 } from 'openapi-types';
1110
import { RgbaColor } from 'react-colorful';
1211
import { Node } from 'reactflow';
13-
import { JsonObject } from 'type-fest';
1412
import { Graph, ImageDTO, _InputField, _OutputField } from 'services/api/types';
1513
import {
1614
AnyInvocationType,
1715
AnyResult,
1816
ProgressImage,
1917
} from 'services/events/types';
2018
import { O } from 'ts-toolbelt';
19+
import { JsonObject } from 'type-fest';
2120
import { z } from 'zod';
2221

2322
export type NonNullableGraph = O.Required<Graph, 'nodes' | 'edges'>;
@@ -936,22 +935,10 @@ export const zWorkflow = z.object({
936935
});
937936

938937
export const zValidatedWorkflow = zWorkflow.transform((workflow) => {
939-
const nodeTemplates = store.getState().nodes.nodeTemplates;
940938
const { nodes, edges } = workflow;
941939
const warnings: WorkflowWarning[] = [];
942940
const invocationNodes = nodes.filter(isWorkflowInvocationNode);
943941
const keyedNodes = keyBy(invocationNodes, 'id');
944-
invocationNodes.forEach((node, i) => {
945-
const nodeTemplate = nodeTemplates[node.data.type];
946-
if (!nodeTemplate) {
947-
warnings.push({
948-
message: `Node "${node.data.label || node.data.id}" skipped`,
949-
issues: [`Unable to find template for type "${node.data.type}"`],
950-
data: node,
951-
});
952-
delete nodes[i];
953-
}
954-
});
955942
edges.forEach((edge, i) => {
956943
const sourceNode = keyedNodes[edge.source];
957944
const targetNode = keyedNodes[edge.target];

0 commit comments

Comments
 (0)