mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
- dont show latent preview size (causes ui layout jump, isnt useful anyway)
- fallback to "Running..." when no specific status text - change "Sampler" to match word instead of specific nodes as missing custom samplers is worse than showing "generating" for the instantly executing "KSamplerSelect" type nodes
This commit is contained in:
@@ -3695,6 +3695,7 @@
|
||||
"resizing": "Resizing…",
|
||||
"generatingVideo": "Generating video…",
|
||||
"training": "Training…",
|
||||
"processingVideo": "Processing video…"
|
||||
"processingVideo": "Processing video…",
|
||||
"running": "Running…"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,11 @@ const { executionStatusMessage } = useExecutionStatus()
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
const { src } = defineProps<{
|
||||
const { src, showSize = true } = defineProps<{
|
||||
src: string
|
||||
mobile?: boolean
|
||||
label?: string
|
||||
showSize?: boolean
|
||||
}>()
|
||||
|
||||
const imageRef = useTemplateRef('imageRef')
|
||||
@@ -20,7 +21,7 @@ const width = ref<number | null>(null)
|
||||
const height = ref<number | null>(null)
|
||||
|
||||
function onImageLoad() {
|
||||
if (!imageRef.value) return
|
||||
if (!imageRef.value || !showSize) return
|
||||
width.value = imageRef.value.naturalWidth
|
||||
height.value = imageRef.value.naturalHeight
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ async function rerun(e: Event) {
|
||||
v-if="canShowPreview && latentPreview"
|
||||
:mobile
|
||||
:src="latentPreview"
|
||||
:show-size="false"
|
||||
/>
|
||||
<MediaOutputPreview
|
||||
v-else-if="selectedOutput"
|
||||
|
||||
@@ -17,13 +17,6 @@ type ExecutionStatusKey =
|
||||
* identifier patterns (e.g. unconventional naming, spaces).
|
||||
*/
|
||||
const statusMap: Record<string, ExecutionStatusKey> = {
|
||||
// Sampling / generation — can't use `Sampler` identifier because it
|
||||
// would match nodes like KSamplerSelect
|
||||
KSampler: 'generating',
|
||||
KSamplerAdvanced: 'generating',
|
||||
SamplerCustom: 'generating',
|
||||
SamplerCustomAdvanced: 'generating',
|
||||
|
||||
// Video utility nodes with non-standard naming
|
||||
'Video Slice': 'processingVideo',
|
||||
GetVideoComponents: 'processingVideo',
|
||||
@@ -47,7 +40,8 @@ const identifierRules: [RegExp, ExecutionStatusKey][] = [
|
||||
[pascalId('Decode'), 'decoding'],
|
||||
[pascalId('Compile', 'Conditioning', 'Merge'), 'processing'],
|
||||
[pascalId('Upscale', 'Resize'), 'resizing'],
|
||||
[pascalId('ToVideo'), 'generatingVideo']
|
||||
[pascalId('ToVideo'), 'generatingVideo'],
|
||||
[pascalId('Sampler'), 'generating']
|
||||
]
|
||||
|
||||
export function getExecutionStatusMessage(
|
||||
|
||||
@@ -10,6 +10,22 @@ import {
|
||||
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()
|
||||
@@ -18,18 +34,7 @@ export function useExecutionStatus() {
|
||||
const executionStatusMessage = computed<string | null>(() => {
|
||||
const executionId = executionStore.executingNodeId
|
||||
if (!executionId) return null
|
||||
|
||||
const locatorId = executionIdToNodeLocatorId(app.rootGraph, executionId)
|
||||
if (!locatorId) return null
|
||||
|
||||
const node = getNodeByLocatorId(app.rootGraph, locatorId)
|
||||
if (!node) return null
|
||||
|
||||
const nodeType = node.type
|
||||
if (!nodeType) return null
|
||||
|
||||
const nodeDef = nodeDefStore.nodeDefsByName[nodeType] ?? null
|
||||
return getExecutionStatusMessage(t, nodeType, nodeDef, node.properties)
|
||||
return resolveStatus(t, nodeDefStore, executionId) || t('execution.running')
|
||||
})
|
||||
|
||||
return { executionStatusMessage }
|
||||
|
||||
Reference in New Issue
Block a user