mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix extra attrs added to workflow payload
This commit is contained in:
parent
06104f3851
commit
fc6cebb975
@ -1,6 +1,5 @@
|
|||||||
import { useAppSelector } from 'app/store/storeHooks';
|
import { useAppSelector } from 'app/store/storeHooks';
|
||||||
import { buildWorkflow } from 'features/nodes/util/workflow/buildWorkflow';
|
import { buildWorkflow } from 'features/nodes/util/workflow/buildWorkflow';
|
||||||
import { omit } from 'lodash-es';
|
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useDebounce } from 'use-debounce';
|
import { useDebounce } from 'use-debounce';
|
||||||
|
|
||||||
@ -12,8 +11,7 @@ export const useWorkflow = () => {
|
|||||||
const [edges] = useDebounce(edges_, 300);
|
const [edges] = useDebounce(edges_, 300);
|
||||||
const [workflow] = useDebounce(workflow_, 300);
|
const [workflow] = useDebounce(workflow_, 300);
|
||||||
const builtWorkflow = useMemo(
|
const builtWorkflow = useMemo(
|
||||||
() =>
|
() => buildWorkflow({ nodes, edges, workflow }),
|
||||||
buildWorkflow({ nodes, edges, workflow: omit(workflow, 'isTouched') }),
|
|
||||||
[nodes, edges, workflow]
|
[nodes, edges, workflow]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
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, WorkflowsState } from 'features/nodes/store/types';
|
||||||
import { isInvocationNode, isNotesNode } from 'features/nodes/types/invocation';
|
import { isInvocationNode, isNotesNode } from 'features/nodes/types/invocation';
|
||||||
import {
|
import {
|
||||||
WorkflowV2,
|
WorkflowV2,
|
||||||
@ -8,13 +8,13 @@ import {
|
|||||||
zWorkflowNode,
|
zWorkflowNode,
|
||||||
} from 'features/nodes/types/workflow';
|
} from 'features/nodes/types/workflow';
|
||||||
import i18n from 'i18next';
|
import i18n from 'i18next';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep, omit } from 'lodash-es';
|
||||||
import { fromZodError } from 'zod-validation-error';
|
import { fromZodError } from 'zod-validation-error';
|
||||||
|
|
||||||
type BuildWorkflowArg = {
|
type BuildWorkflowArg = {
|
||||||
nodes: NodesState['nodes'];
|
nodes: NodesState['nodes'];
|
||||||
edges: NodesState['edges'];
|
edges: NodesState['edges'];
|
||||||
workflow: Omit<WorkflowV2, 'nodes' | 'edges'>;
|
workflow: WorkflowsState;
|
||||||
};
|
};
|
||||||
|
|
||||||
type BuildWorkflowFunction = (arg: BuildWorkflowArg) => WorkflowV2;
|
type BuildWorkflowFunction = (arg: BuildWorkflowArg) => WorkflowV2;
|
||||||
@ -29,7 +29,7 @@ export const buildWorkflow: BuildWorkflowFunction = ({
|
|||||||
const clonedEdges = cloneDeep(edges);
|
const clonedEdges = cloneDeep(edges);
|
||||||
|
|
||||||
const newWorkflow: WorkflowV2 = {
|
const newWorkflow: WorkflowV2 = {
|
||||||
...clonedWorkflow,
|
...omit(clonedWorkflow, 'isTouched', 'id'),
|
||||||
nodes: [],
|
nodes: [],
|
||||||
edges: [],
|
edges: [],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user