Update model manager to display folder path

This commit is contained in:
Eric Lam 2025-05-18 19:01:47 -07:00
parent 166debfabb
commit d9a36dc901
2 changed files with 19 additions and 4 deletions

View File

@ -921,14 +921,23 @@ def check_model_installed(json_obj):
item['installed'] = 'True'
if 'installed' not in item:
item['installed'] = 'False'
if item['filename'] == '<huggingface>':
filename = os.path.basename(item['url'])
else:
filename = item['filename']
fullpath = os.path.join(folder_paths.models_dir, item['save_path'], filename)
if model_dir_name in folder_paths.folder_names_and_paths:
paths = folder_paths.folder_names_and_paths[model_dir_name][0]
item['installed'] = 'True' if os.path.exists(fullpath) else 'False'
for folder_path in paths:
base_path = os.path.split(folder_path)[0]
fullpath = os.path.join(base_path, item['save_path'], filename)
if os.path.exists(fullpath):
item['installed'] = 'True'
item['folder_path_source'] = base_path
with concurrent.futures.ThreadPoolExecutor(8) as executor:
for item in json_obj['models']:

View File

@ -249,14 +249,14 @@ export class ModelManager {
bindContainerResize: true,
cellResizeObserver: (rowItem, columnItem) => {
const autoHeightColumns = ['name', 'description'];
const autoHeightColumns = ['name', 'description', 'folder_path_source'];
return autoHeightColumns.includes(columnItem.id)
},
// updateGrid handler for filter and keywords
rowFilter: (rowItem) => {
const searchableColumns = ["name", "type", "base", "description", "filename", "save_path"];
const searchableColumns = ["name", "type", "base", "description", "filename", "save_path", "folder_path_source"];
const models_extensions = ['.ckpt', '.pt', '.pt2', '.bin', '.pth', '.safetensors', '.pkl', '.sft'];
let shouldShown = grid.highlightKeywordsFilter(rowItem, searchableColumns, this.keywords);
@ -381,6 +381,12 @@ export class ModelManager {
width: 400,
maxWidth: 5000,
classMap: 'cmm-node-desc'
}, {
id: 'folder_path_source',
name: 'Folder Path Source',
width: 400,
maxWidth: 5000,
classMap: 'cmm-node-desc'
}, {
id: "save_path",
name: 'Save Path',