Revert PRs #4506 and #4507 - Fix execution output issues (#4508)

This commit is contained in:
Christian Byrne
2025-07-23 17:53:04 -07:00
committed by GitHub
parent e34d9bb411
commit 052d5320c0
4 changed files with 11 additions and 59 deletions

View File

@@ -8,12 +8,9 @@ import {
} from '@/schemas/apiSchema'
import { api } from '@/scripts/api'
import { app } from '@/scripts/app'
import type { NodeExecutionId } from '@/types'
import { parseFilePath } from '@/utils/formatUtil'
import { isVideoNode } from '@/utils/litegraphUtil'
import { useExecutionStore } from './executionStore'
const createOutputs = (
filenames: string[],
type: ResultItemType,
@@ -26,20 +23,16 @@ const createOutputs = (
}
export const useNodeOutputStore = defineStore('nodeOutput', () => {
const executionStore = useExecutionStore()
const getMostRecentExecutionId = (node: LGraphNode): NodeExecutionId =>
executionStore.locatorIdToExecutionIdMap.get(
executionStore.getNodeLocatorId(node)
) ?? node.id.toString()
const getNodeId = (node: LGraphNode): string => node.id.toString()
function getNodeOutputs(
node: LGraphNode
): ExecutedWsMessage['output'] | undefined {
return app.nodeOutputs[getMostRecentExecutionId(node)]
return app.nodeOutputs[getNodeId(node)]
}
function getNodePreviews(node: LGraphNode): string[] | undefined {
return app.nodePreviewImages[getMostRecentExecutionId(node)]
return app.nodePreviewImages[getNodeId(node)]
}
/**
@@ -98,23 +91,12 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
filenames: string | string[] | ResultItem,
{
folder = 'input',
isAnimated = false,
isInitialLoad = false
}: {
folder?: ResultItemType
isAnimated?: boolean
isInitialLoad?: boolean
} = {}
isAnimated = false
}: { folder?: ResultItemType; isAnimated?: boolean } = {}
) {
if (!filenames || !node) return
const nodeId = isInitialLoad
? executionStore.getNodeLocatorId(node)
: getMostRecentExecutionId(node)
if (isInitialLoad) {
executionStore.locatorIdToExecutionIdMap.set(nodeId, nodeId)
}
const nodeId = getNodeId(node)
if (typeof filenames === 'string') {
app.nodeOutputs[nodeId] = createOutputs([filenames], folder, isAnimated)