mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-06 22:10:14 -03:00
fix(loras): include folder prefix in context menu and bulk send-to-workflow
When using full path lora syntax, the context menu (single/bulk) and bulk copy actions were passing only the file basename to buildLoraSyntax(), ignoring the folder prefix. This caused the output to look like legacy A1111 format even when full path mode was enabled. Aligns all entry points with ModelCard.handleSendToWorkflow(), which correctly includes the folder prefix. Also fixes selectAllVisibleModels() to cache the folder field, preventing missing prefix on select-all-then-send flows.
This commit is contained in:
@@ -152,7 +152,9 @@ export class LoraContextMenu extends BaseContextMenu {
|
|||||||
sendLoraToWorkflow(replaceMode) {
|
sendLoraToWorkflow(replaceMode) {
|
||||||
const card = this.currentCard;
|
const card = this.currentCard;
|
||||||
const usageTips = JSON.parse(card.dataset.usage_tips || '{}');
|
const usageTips = JSON.parse(card.dataset.usage_tips || '{}');
|
||||||
const loraSyntax = buildLoraSyntax(card.dataset.file_name, usageTips);
|
const folder = card.dataset.folder || '';
|
||||||
|
const loraName = folder ? `${folder}/${card.dataset.file_name}` : card.dataset.file_name;
|
||||||
|
const loraSyntax = buildLoraSyntax(loraName, usageTips);
|
||||||
|
|
||||||
sendLoraToWorkflow(loraSyntax, replaceMode, 'lora');
|
sendLoraToWorkflow(loraSyntax, replaceMode, 'lora');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -397,6 +397,7 @@ export class BulkManager {
|
|||||||
const updated = {
|
const updated = {
|
||||||
...existing,
|
...existing,
|
||||||
fileName: card.dataset.file_name ?? existing.fileName,
|
fileName: card.dataset.file_name ?? existing.fileName,
|
||||||
|
folder: card.dataset.folder ?? existing.folder,
|
||||||
usageTips: card.dataset.usage_tips ?? existing.usageTips,
|
usageTips: card.dataset.usage_tips ?? existing.usageTips,
|
||||||
modelName: card.dataset.name ?? existing.modelName,
|
modelName: card.dataset.name ?? existing.modelName,
|
||||||
};
|
};
|
||||||
@@ -494,7 +495,8 @@ export class BulkManager {
|
|||||||
|
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
const usageTips = JSON.parse(metadata.usageTips || '{}');
|
const usageTips = JSON.parse(metadata.usageTips || '{}');
|
||||||
loraSyntaxes.push(buildLoraSyntax(metadata.fileName, usageTips));
|
const loraName = metadata.folder ? `${metadata.folder}/${metadata.fileName}` : metadata.fileName;
|
||||||
|
loraSyntaxes.push(buildLoraSyntax(loraName, usageTips));
|
||||||
} else {
|
} else {
|
||||||
missingLoras.push(filepath);
|
missingLoras.push(filepath);
|
||||||
}
|
}
|
||||||
@@ -537,7 +539,8 @@ export class BulkManager {
|
|||||||
|
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
const usageTips = JSON.parse(metadata.usageTips || '{}');
|
const usageTips = JSON.parse(metadata.usageTips || '{}');
|
||||||
loraSyntaxes.push(buildLoraSyntax(metadata.fileName, usageTips));
|
const loraName = metadata.folder ? `${metadata.folder}/${metadata.fileName}` : metadata.fileName;
|
||||||
|
loraSyntaxes.push(buildLoraSyntax(loraName, usageTips));
|
||||||
} else {
|
} else {
|
||||||
missingLoras.push(filepath);
|
missingLoras.push(filepath);
|
||||||
}
|
}
|
||||||
@@ -674,6 +677,7 @@ export class BulkManager {
|
|||||||
const modelId = this.parseModelId(item?.civitai?.modelId);
|
const modelId = this.parseModelId(item?.civitai?.modelId);
|
||||||
metadataCache.set(item.file_path, {
|
metadataCache.set(item.file_path, {
|
||||||
fileName: item.file_name,
|
fileName: item.file_name,
|
||||||
|
folder: item.folder || '',
|
||||||
usageTips: item.usage_tips || '{}',
|
usageTips: item.usage_tips || '{}',
|
||||||
modelName: item.name || item.file_name,
|
modelName: item.name || item.file_name,
|
||||||
...(modelId !== null ? { modelId } : {})
|
...(modelId !== null ? { modelId } : {})
|
||||||
|
|||||||
Reference in New Issue
Block a user