diff --git a/ui/media/js/auto-save.js b/ui/media/js/auto-save.js index 670fee0d..f70b19c7 100644 --- a/ui/media/js/auto-save.js +++ b/ui/media/js/auto-save.js @@ -54,6 +54,7 @@ const SETTINGS_IDS_LIST = [ "zip_toggle", "tree_toggle", "json_toggle", + "extract_lora_from_prompt", ] const IGNORE_BY_DEFAULT = ["prompt"] diff --git a/ui/media/js/parameters.js b/ui/media/js/parameters.js index 9db01807..671451eb 100644 --- a/ui/media/js/parameters.js +++ b/ui/media/js/parameters.js @@ -121,6 +121,15 @@ var PARAMETERS = [ icon: "fa-arrow-down-short-wide", default: false, }, + { + id: "extract_lora_from_prompt", + type: ParameterType.checkbox, + label: "Extract LoRA tags from the prompt", + note: + "Automatically extract lora tags like <lora:name:0.4> from the prompt, and apply the correct LoRA (if present)", + icon: "fa-code", + default: true, + }, { id: "ui_open_browser_on_start", type: ParameterType.checkbox, diff --git a/ui/plugins/ui/lora-prompt-parser.plugin.js b/ui/plugins/ui/lora-prompt-parser.plugin.js index 5030b74c..201d49af 100644 --- a/ui/plugins/ui/lora-prompt-parser.plugin.js +++ b/ui/plugins/ui/lora-prompt-parser.plugin.js @@ -8,6 +8,11 @@ "use strict" promptField.addEventListener('input', function(e) { + let loraExtractSetting = document.getElementById("extract_lora_from_prompt") + if (!loraExtractSetting.checked) { + return + } + const { LoRA, prompt } = extractLoraTags(e.target.value); //console.log('e.target: ' + JSON.stringify(LoRA));