mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix workflow saving
'id' should not be omitted when building a workflow, it makes workflows always save as a copy
This commit is contained in:
parent
08ef71a74e
commit
1af4260ab6
@ -1,9 +1,9 @@
|
|||||||
import { enqueueRequested } from 'app/store/actions';
|
import { enqueueRequested } from 'app/store/actions';
|
||||||
import { buildNodesGraph } from 'features/nodes/util/graph/buildNodesGraph';
|
import { buildNodesGraph } from 'features/nodes/util/graph/buildNodesGraph';
|
||||||
|
import { buildWorkflow } from 'features/nodes/util/workflow/buildWorkflow';
|
||||||
import { queueApi } from 'services/api/endpoints/queue';
|
import { queueApi } from 'services/api/endpoints/queue';
|
||||||
import { BatchConfig } from 'services/api/types';
|
import { BatchConfig } from 'services/api/types';
|
||||||
import { startAppListening } from '..';
|
import { startAppListening } from '..';
|
||||||
import { buildWorkflow } from 'features/nodes/util/workflow/buildWorkflow';
|
|
||||||
|
|
||||||
export const addEnqueueRequestedNodes = () => {
|
export const addEnqueueRequestedNodes = () => {
|
||||||
startAppListening({
|
startAppListening({
|
||||||
@ -19,6 +19,10 @@ export const addEnqueueRequestedNodes = () => {
|
|||||||
edges,
|
edges,
|
||||||
workflow,
|
workflow,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// embedded workflows don't have an id
|
||||||
|
delete builtWorkflow.id;
|
||||||
|
|
||||||
const batchConfig: BatchConfig = {
|
const batchConfig: BatchConfig = {
|
||||||
batch: {
|
batch: {
|
||||||
graph,
|
graph,
|
||||||
|
@ -24,12 +24,12 @@ export const buildWorkflow: BuildWorkflowFunction = ({
|
|||||||
edges,
|
edges,
|
||||||
workflow,
|
workflow,
|
||||||
}) => {
|
}) => {
|
||||||
const clonedWorkflow = cloneDeep(workflow);
|
const clonedWorkflow = omit(cloneDeep(workflow), 'isTouched');
|
||||||
const clonedNodes = cloneDeep(nodes);
|
const clonedNodes = cloneDeep(nodes);
|
||||||
const clonedEdges = cloneDeep(edges);
|
const clonedEdges = cloneDeep(edges);
|
||||||
|
|
||||||
const newWorkflow: WorkflowV2 = {
|
const newWorkflow: WorkflowV2 = {
|
||||||
...omit(clonedWorkflow, 'isTouched', 'id'),
|
...clonedWorkflow,
|
||||||
nodes: [],
|
nodes: [],
|
||||||
edges: [],
|
edges: [],
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user