mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 17:30:07 +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
|
// 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 })
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user