mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): clarify workflow building node filter
This commit is contained in:
parent
c42d692ea6
commit
fd8d1e13a0
@ -1,6 +1,7 @@
|
|||||||
import { logger } from 'app/logging/logger';
|
import { logger } from 'app/logging/logger';
|
||||||
import { parseify } from 'common/util/serialize';
|
import { parseify } from 'common/util/serialize';
|
||||||
import { NodesState } from 'features/nodes/store/types';
|
import { NodesState } from 'features/nodes/store/types';
|
||||||
|
import { isInvocationNode, isNotesNode } from 'features/nodes/types/invocation';
|
||||||
import {
|
import {
|
||||||
WorkflowV2,
|
WorkflowV2,
|
||||||
zWorkflowEdge,
|
zWorkflowEdge,
|
||||||
@ -34,9 +35,7 @@ export const buildWorkflow: BuildWorkflowFunction = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
clonedNodes
|
clonedNodes
|
||||||
.filter((n) =>
|
.filter((n) => isInvocationNode(n) || isNotesNode(n)) // Workflows only contain invocation and notes nodes
|
||||||
['invocation', 'notes'].includes(n.type ?? '__UNKNOWN_NODE_TYPE__')
|
|
||||||
)
|
|
||||||
.forEach((node) => {
|
.forEach((node) => {
|
||||||
const result = zWorkflowNode.safeParse(node);
|
const result = zWorkflowNode.safeParse(node);
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user