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
fileComboWidget.callback = function () {
nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, {
isAnimated
isAnimated,
isInitialLoad: 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
requestAnimationFrame(() => {
nodeOutputStore.setNodeOutputs(node, fileComboWidget.value, {
isAnimated
isAnimated,
isInitialLoad: true
})
showPreview({ block: false })
})

View File

@@ -98,12 +98,23 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
filenames: string | string[] | ResultItem,
{
folder = 'input',
isAnimated = false
}: { folder?: ResultItemType; isAnimated?: boolean } = {}
isAnimated = false,
isInitialLoad = false
}: {
folder?: ResultItemType
isAnimated?: boolean
isInitialLoad?: boolean
} = {}
) {
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') {
app.nodeOutputs[nodeId] = createOutputs([filenames], folder, isAnimated)