Skip to content

Commit

Permalink
user setting for model name fomat in the tree
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 26, 2024
1 parent 1c9e82d commit a3685d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/sidebar/tabs/ModelLibrarySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const root: ComputedRef<TreeNode> = computed(() => {
})
const renderedRoot = computed<TreeExplorerNode<ComfyModelDef>>(() => {
const nameFormat = settingStore.get('Comfy.ModelLibrary.NameFormat')
const fillNodeInfo = (node: TreeNode): TreeExplorerNode<ComfyModelDef> => {
const children = node.children?.map(fillNodeInfo)
const model: ComfyModelDef | null =
Expand Down Expand Up @@ -126,7 +127,11 @@ const renderedRoot = computed<TreeExplorerNode<ComfyModelDef>>(() => {
return {
key: node.key,
label: model ? model.title : node.label,
label: model
? nameFormat === 'title'
? model.title
: model.simplified_name
: node.label,
leaf: node.leaf,
data: node.data,
getIcon: (node: TreeExplorerNode<ComfyModelDef>) => {
Expand Down
7 changes: 7 additions & 0 deletions src/stores/coreSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ export const CORE_SETTINGS: SettingParams[] = [
type: 'boolean',
defaultValue: false
},
{
id: 'Comfy.ModelLibrary.NameFormat',
name: 'What name to display in the model library tree view',
type: 'combo',
options: ['filename', 'title'],
defaultValue: 'title'
},
{
id: 'Comfy.Locale',
name: 'Locale',
Expand Down

0 comments on commit a3685d6

Please sign in to comment.