mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
allow updating outputs on custom nodes and inside subgraphs (#4963)
This commit is contained in:
committed by
Jennifer Weber
parent
0950da0b43
commit
8da2b304ef
@@ -10,6 +10,7 @@ import { app } from '@/scripts/app'
|
|||||||
import { blankGraph, defaultGraph } from '@/scripts/defaultGraph'
|
import { blankGraph, defaultGraph } from '@/scripts/defaultGraph'
|
||||||
import { downloadBlob } from '@/scripts/utils'
|
import { downloadBlob } from '@/scripts/utils'
|
||||||
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
||||||
|
import { useNodeOutputStore } from '@/stores/imagePreviewStore'
|
||||||
import { TaskItemImpl } from '@/stores/queueStore'
|
import { TaskItemImpl } from '@/stores/queueStore'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { useToastStore } from '@/stores/toastStore'
|
import { useToastStore } from '@/stores/toastStore'
|
||||||
@@ -18,6 +19,7 @@ import { useWorkspaceStore } from '@/stores/workspaceStore'
|
|||||||
import { appendJsonExt, generateUUID } from '@/utils/formatUtil'
|
import { appendJsonExt, generateUUID } from '@/utils/formatUtil'
|
||||||
|
|
||||||
import { useDialogService } from './dialogService'
|
import { useDialogService } from './dialogService'
|
||||||
|
import { useExtensionService } from './extensionService'
|
||||||
|
|
||||||
export const useWorkflowService = () => {
|
export const useWorkflowService = () => {
|
||||||
const settingStore = useSettingStore()
|
const settingStore = useSettingStore()
|
||||||
@@ -178,7 +180,22 @@ export const useWorkflowService = () => {
|
|||||||
|
|
||||||
await app.loadGraphData(toRaw(workflowData))
|
await app.loadGraphData(toRaw(workflowData))
|
||||||
if (task.outputs) {
|
if (task.outputs) {
|
||||||
app.nodeOutputs = toRaw(task.outputs)
|
const nodeOutputsStore = useNodeOutputStore()
|
||||||
|
const rawOutputs = toRaw(task.outputs)
|
||||||
|
|
||||||
|
// Set outputs by execution ID to account for outputs inside of subgraphs
|
||||||
|
for (const nodeExecutionId in rawOutputs) {
|
||||||
|
nodeOutputsStore.setNodeOutputsByExecutionId(
|
||||||
|
nodeExecutionId,
|
||||||
|
rawOutputs[nodeExecutionId]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Invoke extension (e.g., 3D nodes) hooks to allow them to update
|
||||||
|
useExtensionService().invokeExtensions(
|
||||||
|
'onNodeOutputsUpdated',
|
||||||
|
app.nodeOutputs
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user