Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scripts/changeTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class ChangeTracker {
scale: app.canvas.ds.scale,
offset: [app.canvas.ds.offset[0], app.canvas.ds.offset[1]]
}
this.nodeOutputs = clone(app.nodeOutputs)
this.nodeOutputs = useNodeOutputStore().snapshotOutputs()
const navigation = useSubgraphNavigationStore().exportState()
// Always store the navigation state, even if empty (root level)
this.subgraphState = { navigation }
Expand Down
6 changes: 6 additions & 0 deletions src/stores/imagePreviewStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
import { appendCloudResParam } from '@/platform/distribution/cloudPreviewUtil'
import { api } from '@/scripts/api'
import { app } from '@/scripts/app'
import { clone } from '@/scripts/utils'
import type { NodeLocatorId } from '@/types/nodeIdentification'
import { parseFilePath } from '@/utils/formatUtil'
import { isAnimatedOutput, isVideoNode } from '@/utils/litegraphUtil'
Expand Down Expand Up @@ -365,6 +366,10 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
return hadOutputs
}

function snapshotOutputs(): Record<string, ExecutedWsMessage['output']> {
return clone(app.nodeOutputs)
}

function restoreOutputs(
outputs: Record<string, ExecutedWsMessage['output']>
) {
Expand Down Expand Up @@ -455,6 +460,7 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
revokeAllPreviews,
revokeSubgraphPreviews,
removeNodeOutputs,
snapshotOutputs,
restoreOutputs,
resetAllOutputsAndPreviews,

Expand Down
Loading