diff --git a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts index 094a43b944..b2825db783 100644 --- a/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/nodesSlice.ts @@ -133,6 +133,10 @@ const nodesSlice = createSlice({ loadFileEdges: (state, action: PayloadAction) => { state.edges = action.payload; }, + clearNodes: (state) => { + state.nodes = []; + state.edges = []; + }, }, extraReducers: (builder) => { builder.addCase(receivedOpenAPISchema.fulfilled, (state, action) => { @@ -156,6 +160,7 @@ export const { setEditorInstance, loadFileNodes, loadFileEdges, + clearNodes, } = nodesSlice.actions; export default nodesSlice.reducer;