Use the new lora models component while creating the render request

This commit is contained in:
cmdr2 2023-08-18 13:27:00 +05:30
parent 8e4afc8374
commit a2d06f87f6

View File

@ -1640,7 +1640,9 @@ function getCurrentUserRequest() {
newTask.reqBody.hypernetwork_strength = parseFloat(hypernetworkStrengthField.value) newTask.reqBody.hypernetwork_strength = parseFloat(hypernetworkStrengthField.value)
} }
if (testDiffusers.checked) { if (testDiffusers.checked) {
let [modelNames, modelStrengths] = getModelInfo(loraModels) let loraModelData = loraModelField.value
let modelNames = loraModelData["modelNames"]
let modelStrengths = loraModelData["modelWeights"]
if (modelNames.length > 0) { if (modelNames.length > 0) {
modelNames = modelNames.length == 1 ? modelNames[0] : modelNames 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) { function getPrompts(prompts) {
if (typeof prompts === "undefined") { if (typeof prompts === "undefined") {
prompts = promptField.value prompts = promptField.value