mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-14 09:43:22 -03:00
fix(update): resolve template path when updating to a different base model (#1059)
Version-tab updates reused the current version's folder, so updating a LoRA to a version with a different base model (e.g. Illustrious -> Anima) ignored the download path template and landed in the old version's directory. When the target version's base model differs from the current local version and a path template is configured, re-resolve the template under the same model root. The backend keeps an explicitly provided root when use_save_dir_as_root is set, so regular downloads still use the default root.
This commit is contained in:
@@ -1233,7 +1233,7 @@ export class BaseModelApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
async downloadModel(modelId, versionId, modelRoot, relativePath, useDefaultPaths = false, downloadId, source = null, fileParams = null) {
|
||||
async downloadModel(modelId, versionId, modelRoot, relativePath, useDefaultPaths = false, downloadId, source = null, fileParams = null, useSaveDirAsRoot = false) {
|
||||
try {
|
||||
const response = await fetch(DOWNLOAD_ENDPOINTS.download, {
|
||||
method: 'POST',
|
||||
@@ -1244,6 +1244,7 @@ export class BaseModelApiClient {
|
||||
model_root: modelRoot,
|
||||
relative_path: relativePath,
|
||||
use_default_paths: useDefaultPaths,
|
||||
use_save_dir_as_root: useSaveDirAsRoot,
|
||||
download_id: downloadId,
|
||||
...(source ? { source } : {}),
|
||||
...(fileParams ? { file_params: fileParams } : {})
|
||||
|
||||
Reference in New Issue
Block a user