From a2d06f87f619d0f1a0f575625baaa52640ce660f Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 18 Aug 2023 13:27:00 +0530 Subject: [PATCH] Use the new lora models component while creating the render request --- ui/media/js/main.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 643637d4..6e6f1aa2 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1640,7 +1640,9 @@ function getCurrentUserRequest() { newTask.reqBody.hypernetwork_strength = parseFloat(hypernetworkStrengthField.value) } if (testDiffusers.checked) { - let [modelNames, modelStrengths] = getModelInfo(loraModels) + let loraModelData = loraModelField.value + let modelNames = loraModelData["modelNames"] + let modelStrengths = loraModelData["modelWeights"] if (modelNames.length > 0) { modelNames = modelNames.length == 1 ? modelNames[0] : modelNames @@ -1717,17 +1719,6 @@ function setEmbeddings(task) { } } -function getModelInfo(models) { - let modelInfo = models.map((e) => [e[0].value, e[1].value]) - modelInfo = modelInfo.filter((e) => e[0].trim() !== "") - modelInfo = modelInfo.map((e) => [e[0], parseFloat(e[1])]) - - let modelNames = modelInfo.map((e) => e[0]) - let modelStrengths = modelInfo.map((e) => e[1]) - - return [modelNames, modelStrengths] -} - function getPrompts(prompts) { if (typeof prompts === "undefined") { prompts = promptField.value