feat: add setting to include trigger words in LoRA syntax, update UI and functionality, fixes #268

This commit is contained in:
Will Miao
2025-08-05 18:04:10 +08:00
parent 3b96bfe5af
commit 677a239d53
6 changed files with 116 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import { BaseContextMenu } from './BaseContextMenu.js';
import { ModelContextMenuMixin } from './ModelContextMenuMixin.js';
import { getModelApiClient, resetAndReload } from '../../api/modelApiFactory.js';
import { copyToClipboard, sendLoraToWorkflow } from '../../utils/uiHelpers.js';
import { copyLoraSyntax, sendLoraToWorkflow } from '../../utils/uiHelpers.js';
import { showExcludeModal, showDeleteModal } from '../../utils/modalUtils.js';
import { moveManager } from '../../managers/MoveManager.js';
@@ -37,7 +37,7 @@ export class LoraContextMenu extends BaseContextMenu {
break;
case 'copyname':
// Generate and copy LoRA syntax
this.copyLoraSyntax();
copyLoraSyntax(this.currentCard);
break;
case 'sendappend':
// Send LoRA to workflow (append mode)
@@ -67,16 +67,6 @@ export class LoraContextMenu extends BaseContextMenu {
}
}
// Specific LoRA methods
copyLoraSyntax() {
const card = this.currentCard;
const usageTips = JSON.parse(card.dataset.usage_tips || '{}');
const strength = usageTips.strength || 1;
const loraSyntax = `<lora:${card.dataset.file_name}:${strength}>`;
copyToClipboard(loraSyntax, 'LoRA syntax copied to clipboard');
}
sendLoraToWorkflow(replaceMode) {
const card = this.currentCard;
const usageTips = JSON.parse(card.dataset.usage_tips || '{}');