[backport core/1.42] feat: improve essentials tab blueprint support and display names (#10159)

Backport of #10113 to `core/1.42`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-10159-backport-core-1-42-feat-improve-essentials-tab-blueprint-support-and-display-names-3266d73d3650814ab379c9a568acc8f2)
by [Unito](https://www.unito.io)

Co-authored-by: Yourz <crazilou@vip.qq.com>
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Comfy Org PR Bot
2026-03-17 17:50:57 +09:00
committed by GitHub
parent dc235380d4
commit b82cd2720d
24 changed files with 181 additions and 36 deletions

View File

@@ -167,7 +167,10 @@ import {
import { computed, nextTick, onMounted, ref, watchEffect } from 'vue'
import { useI18n } from 'vue-i18n'
import { resolveEssentialsDisplayName } from '@/constants/essentialsDisplayNames'
import {
resolveBlueprintSuffix,
resolveEssentialsDisplayName
} from '@/constants/essentialsDisplayNames'
import Tab from '@/components/tab/Tab.vue'
import TabList from '@/components/tab/TabList.vue'
import TabPanel from '@/components/tab/TabPanel.vue'
@@ -371,11 +374,38 @@ const essentialSections = computed(() => {
)
})
function disambiguateBlueprintLabels(
root: RenderedTreeExplorerNode<ComfyNodeDefImpl>
): RenderedTreeExplorerNode<ComfyNodeDefImpl> {
if (!root.children) return root
return {
...root,
children: root.children.map((folder) => {
if (folder.type !== 'folder' || !folder.children) return folder
const labelCounts = new Map<string, number>()
for (const node of folder.children) {
if (node.label)
labelCounts.set(node.label, (labelCounts.get(node.label) ?? 0) + 1)
}
return {
...folder,
children: folder.children.map((node) => {
if ((labelCounts.get(node.label ?? '') ?? 0) <= 1) return node
const suffix = resolveBlueprintSuffix(node.data?.name ?? '')
if (!suffix) return node
return { ...node, label: `${node.label} (${suffix})` }
})
}
})
}
}
const renderedEssentialRoot = computed(() => {
const section = essentialSections.value[0]
return section
const root = section
? fillNodeInfo(applySorting(section.tree), { useEssentialsLabels: true })
: fillNodeInfo({ key: 'root', label: '', children: [] })
return disambiguateBlueprintLabels(root)
})
function flattenRenderedLeaves(