mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
feat(download): download to current version's directory in versions tab
Instead of always using default paths, downloads from the model versions tab now target the same directory as the current in-library version. Falls back silently to default paths if the current version path cannot be resolved.
This commit is contained in:
@@ -620,7 +620,12 @@ export class DownloadManager {
|
||||
});
|
||||
}
|
||||
|
||||
async downloadVersionWithDefaults(modelType, modelId, versionId, { versionName = '', source = null } = {}) {
|
||||
async downloadVersionWithDefaults(modelType, modelId, versionId, {
|
||||
versionName = '',
|
||||
source = null,
|
||||
modelRoot = '',
|
||||
targetFolder = ''
|
||||
} = {}) {
|
||||
try {
|
||||
this.apiClient = getModelApiClient(modelType);
|
||||
} catch (error) {
|
||||
@@ -630,13 +635,14 @@ export class DownloadManager {
|
||||
this.modelId = modelId ? modelId.toString() : null;
|
||||
this.source = source;
|
||||
|
||||
const useDefaultPaths = !modelRoot;
|
||||
return this.executeDownloadWithProgress({
|
||||
modelId,
|
||||
versionId,
|
||||
versionName,
|
||||
modelRoot: '',
|
||||
targetFolder: '',
|
||||
useDefaultPaths: true,
|
||||
modelRoot: modelRoot || '',
|
||||
targetFolder: targetFolder || '',
|
||||
useDefaultPaths,
|
||||
source,
|
||||
closeModal: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user