mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-05 05:32:02 +00:00
## Summary Adds custom status messages that are shown under the previews in order to provide additional progress feedback to the user Nodes matching the words: Save, Preview -> Saving Load, Loader -> Loading Encode -> Encoding Decode -> Decoding Compile, Conditioning, Merge, -> Processing Upscale, Resize -> Resizing ToVideo -> Generating video Specific nodes: KSampler, KSamplerAdvanced, SamplerCustom, SamplerCustomAdvanced -> Generating Video Slice, GetVideoComponents, CreateVideo -> Processing video TrainLoraNode -> Training ## Changes - **What**: - add specific node lookups for non-easily matchable patterns - add regex based matching for common patterns - show on both latent preview & skeleton preview - allow app mode workflow authors to override status with custom property `Execution Message` (no UI for doing this) ## Review Focus This is purely pattern/lookup based, in future we could update the backend node schema to allow nodes to define their own status key. ## Screenshots (if applicable) <img width="757" height="461" alt="image" src="https://github.com/user-attachments/assets/2b32cc54-c4e7-4aeb-912d-b39ac8428be7" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10369-feat-App-mode-add-execution-status-messages-32a6d73d3650814e8ca2da5eb33f3b65) by [Unito](https://www.unito.io) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import { getExecutionStatusMessage } from '@/renderer/extensions/linearMode/getExecutionStatusMessage'
|
|
import { app } from '@/scripts/app'
|
|
import { useExecutionStore } from '@/stores/executionStore'
|
|
import { useNodeDefStore } from '@/stores/nodeDefStore'
|
|
import {
|
|
executionIdToNodeLocatorId,
|
|
getNodeByLocatorId
|
|
} from '@/utils/graphTraversalUtil'
|
|
|
|
function resolveStatus(
|
|
t: (key: string) => string,
|
|
nodeDefStore: ReturnType<typeof useNodeDefStore>,
|
|
executionId: string | number
|
|
): string | null {
|
|
const locatorId = executionIdToNodeLocatorId(app.rootGraph, executionId)
|
|
if (!locatorId) return null
|
|
|
|
const node = getNodeByLocatorId(app.rootGraph, locatorId)
|
|
const nodeType = node?.type
|
|
if (!nodeType) return null
|
|
|
|
const nodeDef = nodeDefStore.nodeDefsByName[nodeType] ?? null
|
|
return getExecutionStatusMessage(t, nodeType, nodeDef, node.properties)
|
|
}
|
|
|
|
export function useExecutionStatus() {
|
|
const { t } = useI18n()
|
|
const executionStore = useExecutionStore()
|
|
const nodeDefStore = useNodeDefStore()
|
|
|
|
const executionStatusMessage = computed<string | null>(() => {
|
|
const executionId = executionStore.executingNodeId
|
|
if (!executionId) return null
|
|
return resolveStatus(t, nodeDefStore, executionId) || t('execution.running')
|
|
})
|
|
|
|
return { executionStatusMessage }
|
|
}
|