From dac58ad81108354d6a076089db6304b6d355519e Mon Sep 17 00:00:00 2001 From: Dante Date: Sat, 21 Feb 2026 15:21:21 +0900 Subject: [PATCH] feat: show template version in system info for local builds (#9018) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary 스크린샷 2026-02-21 오전 1 05 10 - Add `installed_templates_version` and `required_templates_version` to the system stats schema - Display the template version as a badge on the About page alongside ComfyUI and Frontend badges - Display the template version as a row in the local System Info table - Highlight badge (red severity) and table row (red text) when installed version doesn't match required version, so users can quickly spot outdated templates Fixes #4006 ## Test plan - [x] Open Settings > About and verify "Templates v{version}" badge appears - [x] Verify "Templates Version" row appears in System Info table - [ ] When `installed_templates_version` matches `required_templates_version`: badge is default color, table row is default color - [ ] When versions don't match: badge turns red, table row turns red - [ ] When `installed_templates_version` is absent (package not installed): badge is hidden, table row shows empty Co-authored-by: Claude Opus 4.6 --- src/components/common/SystemStatsPanel.vue | 17 +++++++++--- .../dialog/content/setting/AboutPanel.vue | 2 +- src/schemas/apiSchema.ts | 4 ++- src/stores/aboutPanelStore.ts | 26 +++++++++++++++++++ src/types/comfy.ts | 1 + 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/components/common/SystemStatsPanel.vue b/src/components/common/SystemStatsPanel.vue index 5d3cd89659..e9b01a9299 100644 --- a/src/components/common/SystemStatsPanel.vue +++ b/src/components/common/SystemStatsPanel.vue @@ -6,10 +6,12 @@
@@ -47,6 +49,7 @@ import DeviceInfo from '@/components/common/DeviceInfo.vue' import { isCloud } from '@/platform/distribution/types' import type { SystemStats } from '@/schemas/apiSchema' import { formatCommitHash, formatSize } from '@/utils/formatUtil' +import { cn } from '@/utils/tailwindUtil' const props = defineProps<{ stats: SystemStats @@ -76,7 +79,8 @@ const localColumns: ColumnDef[] = [ { field: 'pytorch_version', header: 'Pytorch Version' }, { field: 'argv', header: 'Arguments' }, { field: 'ram_total', header: 'RAM Total', formatNumber: formatSize }, - { field: 'ram_free', header: 'RAM Free', formatNumber: formatSize } + { field: 'ram_free', header: 'RAM Free', formatNumber: formatSize }, + { field: 'installed_templates_version', header: 'Templates Version' } ] /** Columns for cloud distribution */ @@ -97,6 +101,13 @@ const cloudColumns: ColumnDef[] = [ const systemColumns = computed(() => (isCloud ? cloudColumns : localColumns)) +function isOutdated(column: ColumnDef): boolean { + if (column.field !== 'installed_templates_version') return false + const installed = props.stats.system.installed_templates_version + const required = props.stats.system.required_templates_version + return !!installed && !!required && installed !== required +} + const getDisplayValue = (column: ColumnDef) => { const value = systemInfo.value[column.field] if (column.formatNumber && typeof value === 'number') { diff --git a/src/components/dialog/content/setting/AboutPanel.vue b/src/components/dialog/content/setting/AboutPanel.vue index 979ac8aa2f..12d320a488 100644 --- a/src/components/dialog/content/setting/AboutPanel.vue +++ b/src/components/dialog/content/setting/AboutPanel.vue @@ -13,7 +13,7 @@ class="about-badge inline-flex items-center no-underline" :title="badge.url" > - + diff --git a/src/schemas/apiSchema.ts b/src/schemas/apiSchema.ts index f453d6228d..deca94afdd 100644 --- a/src/schemas/apiSchema.ts +++ b/src/schemas/apiSchema.ts @@ -248,7 +248,9 @@ const zSystemStats = z.object({ // Cloud-specific fields cloud_version: z.string().optional(), comfyui_frontend_version: z.string().optional(), - workflow_templates_version: z.string().optional() + workflow_templates_version: z.string().optional(), + installed_templates_version: z.string().optional(), + required_templates_version: z.string().optional() }), devices: z.array(zDeviceStats) }) diff --git a/src/stores/aboutPanelStore.ts b/src/stores/aboutPanelStore.ts index 069c3c4592..b21991b4b4 100644 --- a/src/stores/aboutPanelStore.ts +++ b/src/stores/aboutPanelStore.ts @@ -18,6 +18,20 @@ export const useAboutPanelStore = defineStore('aboutPanel', () => { const coreVersion = computed( () => systemStatsStore?.systemStats?.system?.comfyui_version ?? '' ) + const templatesVersion = computed( + () => + systemStatsStore?.systemStats?.system?.installed_templates_version ?? '' + ) + const requiredTemplatesVersion = computed( + () => + systemStatsStore?.systemStats?.system?.required_templates_version ?? '' + ) + const isTemplatesOutdated = computed( + () => + templatesVersion.value !== '' && + requiredTemplatesVersion.value !== '' && + templatesVersion.value !== requiredTemplatesVersion.value + ) const coreBadges = computed(() => [ // In electron, the ComfyUI is packaged without the git repo, @@ -36,6 +50,18 @@ export const useAboutPanelStore = defineStore('aboutPanel', () => { url: staticUrls.githubFrontend, icon: 'pi pi-github' }, + ...(templatesVersion.value + ? [ + { + label: `Templates v${templatesVersion.value}`, + url: 'https://pypi.org/project/comfyui-workflow-templates/', + icon: 'pi pi-book', + ...(isTemplatesOutdated.value + ? { severity: 'danger' as const } + : {}) + } + ] + : []), { label: 'Discord', url: staticUrls.discord, diff --git a/src/types/comfy.ts b/src/types/comfy.ts index c9aa5d1dac..f4965407c2 100644 --- a/src/types/comfy.ts +++ b/src/types/comfy.ts @@ -20,6 +20,7 @@ export interface AboutPageBadge { label: string url: string icon: string + severity?: 'danger' | 'warn' } type MenuCommandGroup = {