V 1.0.0 - model version helper 1
This commit is contained in:
@@ -397,7 +397,8 @@ async def primere_get_filelinks(request):
|
||||
if is_link == True:
|
||||
singleFile_link = Path(str(singleFile)).resolve()
|
||||
filenameonly = Path(singleFile).stem
|
||||
comfyModelDir = os.path.join(utility.comfy_dir, 'models')
|
||||
# comfyModelDir = os.path.join(utility.comfy_dir, 'models')
|
||||
comfyModelDir = str(Path(folder_paths.folder_names_and_paths[subdirKey][0][0]).parent)
|
||||
modelType = str(singleFile_link)[len(comfyModelDir) + 1:str(singleFile_link).find('\\', len(comfyModelDir) + 1)]
|
||||
filelinktypes[filenameonly] = modelType
|
||||
|
||||
|
||||
@@ -42,9 +42,10 @@ if len(ModelsList) > 0:
|
||||
File_link = Path(str(model_path)).resolve()
|
||||
# comfyModelDir = os.path.join(comfy_dir, 'models')
|
||||
comfyModelDir = str(Path(folder_paths.folder_names_and_paths['checkpoints'][0][0]).parent)
|
||||
modelType = str(File_link)[len(comfyModelDir) + 1:str(File_link).find('\\', len(comfyModelDir) + 1)]
|
||||
utility.add_value_to_cache('model_version', modelaname_only, modelType + '_symlink')
|
||||
print('Model [' + str(model_counter) + '] / ' + str(len(ModelsList)) + ' symlinked file: ' + modelaname_only + ' -> from: ' + modelType)
|
||||
modelType = str(File_link)[(len(comfyModelDir) + 1):(str(File_link).find('\\', len(comfyModelDir) + 1))]
|
||||
utility.add_value_to_cache('model_version', modelaname_only, f"{modelType} _symlink")
|
||||
# print('Model [' + str(model_counter) + '] / ' + str(len(ModelsList)) + ' symlinked file: ' + modelaname_only + ' -> from: ' + modelType)
|
||||
print(f"Model [{model_counter}] / {len(ModelsList)} symlinked file: {modelaname_only} -> from: {modelType}")
|
||||
model_counter = model_counter + 1
|
||||
else:
|
||||
print('No models in your system....')
|
||||
Reference in New Issue
Block a user