Fix LoadImage bleeds values between subgraphs (#4507)

This commit is contained in:
filtered
2025-07-24 07:58:50 +10:00
committed by GitHub
parent f81b191fae
commit e34d9bb411
2 changed files with 18 additions and 5 deletions

View File

@@ -100,7 +100,8 @@ export const useImageUploadWidget = () => {
// Add our own callback to the combo widget to render an image when it changes // Add our own callback to the combo widget to render an image when it changes
fileComboWidget.callback = function () { fileComboWidget.callback = function () {
nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, { nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, {
isAnimated isAnimated,
isInitialLoad: true
}) })
node.graph?.setDirtyCanvas(true) node.graph?.setDirtyCanvas(true)
} }
@@ -110,7 +111,8 @@ export const useImageUploadWidget = () => {
// No change callbacks seem to be fired on initial setting of the value // No change callbacks seem to be fired on initial setting of the value
requestAnimationFrame(() => { requestAnimationFrame(() => {
nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, { nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, {
isAnimated isAnimated,
isInitialLoad: true
}) })
showPreview({ block: false }) showPreview({ block: false })
}) })

View File

@@ -98,12 +98,23 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
filenames: string | string[] | ResultItem, filenames: string | string[] | ResultItem,
{ {
folder = 'input', folder = 'input',
isAnimated = false isAnimated = false,
}: { folder?: ResultItemType; isAnimated?: boolean } = {} isInitialLoad = false
}: {
folder?: ResultItemType
isAnimated?: boolean
isInitialLoad?: boolean
} = {}
) { ) {
if (!filenames || !node) return if (!filenames || !node) return
const nodeId = getMostRecentExecutionId(node) const nodeId = isInitialLoad
? executionStore.getNodeLocatorId(node)
: getMostRecentExecutionId(node)
if (isInitialLoad) {
executionStore.locatorIdToExecutionIdMap.set(nodeId, nodeId)
}
if (typeof filenames === 'string') { if (typeof filenames === 'string') {
app.nodeOutputs[nodeId] = createOutputs([filenames], folder, isAnimated) app.nodeOutputs[nodeId] = createOutputs([filenames], folder, isAnimated)