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:
@@ -912,6 +912,7 @@ export class DownloadManager {
|
||||
modelRoot = '',
|
||||
targetFolder = '',
|
||||
useDefaultPaths = false,
|
||||
useSaveDirAsRoot = false,
|
||||
source = null,
|
||||
fileParams = null,
|
||||
closeModal = false,
|
||||
@@ -923,7 +924,7 @@ export class DownloadManager {
|
||||
}
|
||||
|
||||
const displayName = versionName || `#${versionId}`;
|
||||
const retryParams = { modelId, versionId, versionName, modelRoot, targetFolder, useDefaultPaths, source, fileParams, closeModal: false };
|
||||
const retryParams = { modelId, versionId, versionName, modelRoot, targetFolder, useDefaultPaths, useSaveDirAsRoot, source, fileParams, closeModal: false };
|
||||
let ws = null;
|
||||
let updateProgress = () => { };
|
||||
let cancelled = false;
|
||||
@@ -995,7 +996,8 @@ export class DownloadManager {
|
||||
useDefaultPaths,
|
||||
downloadId,
|
||||
source,
|
||||
fileParams
|
||||
fileParams,
|
||||
useSaveDirAsRoot
|
||||
);
|
||||
|
||||
if (cancelled) {
|
||||
@@ -1809,7 +1811,9 @@ export class DownloadManager {
|
||||
versionName = '',
|
||||
source = null,
|
||||
modelRoot = '',
|
||||
targetFolder = ''
|
||||
targetFolder = '',
|
||||
useDefaultPaths = null,
|
||||
useSaveDirAsRoot = false
|
||||
} = {}) {
|
||||
console.warn('[download] downloadVersionWithDefaults: NO fileParams will be sent — backend will always use primary file. '
|
||||
+ 'modelType=%s, modelId=%s, versionId=%s, versionName="%s"',
|
||||
@@ -1824,14 +1828,14 @@ export class DownloadManager {
|
||||
this.modelId = modelId ? modelId.toString() : null;
|
||||
this.source = source;
|
||||
|
||||
const useDefaultPaths = !modelRoot;
|
||||
return this.executeDownloadWithProgress({
|
||||
modelId,
|
||||
versionId,
|
||||
versionName,
|
||||
modelRoot: modelRoot || '',
|
||||
targetFolder: targetFolder || '',
|
||||
useDefaultPaths,
|
||||
useDefaultPaths: useDefaultPaths ?? !modelRoot,
|
||||
useSaveDirAsRoot,
|
||||
source,
|
||||
closeModal: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user