mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 18:24:11 +00:00
[backport core/1.32] Add linear mode (#6926)
Backport of #6670 to `core/1.32` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6926-backport-core-1-32-Add-linear-mode-2b66d73d365081e89a25c097285dc494) by [Unito](https://www.unito.io) Co-authored-by: AustinMroz <austin@comfy.org>
This commit is contained in:
@@ -40,6 +40,7 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
const { nodeIdToNodeLocatorId, nodeToNodeLocatorId } = useWorkflowStore()
|
||||
const { executionIdToNodeLocatorId } = useExecutionStore()
|
||||
const scheduledRevoke: Record<NodeLocatorId, { stop: () => void }> = {}
|
||||
const latestOutput = ref<string[]>([])
|
||||
|
||||
function scheduleRevoke(locator: NodeLocatorId, cb: () => void) {
|
||||
scheduledRevoke[locator]?.stop()
|
||||
@@ -146,6 +147,13 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO:Preview params and deduplication
|
||||
latestOutput.value =
|
||||
(outputs as ExecutedWsMessage['output'])?.images?.map((image) => {
|
||||
const imgUrlPart = new URLSearchParams(image)
|
||||
const rand = app.getRandParam()
|
||||
return api.apiURL(`/view?${imgUrlPart}${rand}`)
|
||||
}) ?? []
|
||||
app.nodeOutputs[nodeLocatorId] = outputs
|
||||
nodeOutputs.value[nodeLocatorId] = outputs
|
||||
}
|
||||
@@ -213,6 +221,7 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
scheduledRevoke[nodeLocatorId].stop()
|
||||
delete scheduledRevoke[nodeLocatorId]
|
||||
}
|
||||
latestOutput.value = previewImages
|
||||
app.nodePreviewImages[nodeLocatorId] = previewImages
|
||||
nodePreviewImages.value[nodeLocatorId] = previewImages
|
||||
}
|
||||
@@ -381,6 +390,7 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
|
||||
|
||||
// State
|
||||
nodeOutputs,
|
||||
nodePreviewImages
|
||||
nodePreviewImages,
|
||||
latestOutput
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user