Files
ComfyUI_frontend/src/renderer/extensions/linearMode/useExecutionStatus.ts
pythongosssss 7c4234cf93 feat: App mode - add execution status messages (#10369)
## 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>
2026-03-24 07:58:35 -07:00

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 }
}