Skip to content

Commit 552c089

Browse files
committed
LoRA: 'add to prompt' button
1 parent 116061d commit 552c089

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wwwroot/js/genpage/gentab/models.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,13 @@ class ModelBrowserWrapper {
597597
if (model.data.local && this.subType == 'Stable-Diffusion' && !model.data.name.endsWith('.engine') && permissions.hasPermission('create_tensorrt')) {
598598
buttons.push({ label: 'Create TensorRT Engine', onclick: () => showTrtMenu(model.data) });
599599
}
600+
if (this.subType == 'LoRA') {
601+
buttons.push({ label: 'Add To Prompt', onclick: () => {
602+
let promptBox = getRequiredElementById('alt_prompt_textbox');
603+
promptBox.value += ` <lora:${model.data.name}>`;
604+
triggerChangeFor(promptBox);
605+
}});
606+
}
600607
}
601608
else {
602609
description = `${escapeHtml(name)}<br>(Metadata only available for 'safetensors' models.)<br><b>WARNING:</b> 'ckpt' pickle files can contain malicious code! Use with caution.<br>`;

0 commit comments

Comments
 (0)