mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-23 05:10:48 +08:00
Update model manager to display folder path
This commit is contained in:
parent
166debfabb
commit
d9a36dc901
@ -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']:
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user