mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-27 03:19:56 +00:00
Fix LoadImage bleeds values between subgraphs (#4507)
This commit is contained in:
@@ -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 })
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user