From 7202ffba6e9645cbbd4e668e475ca3bbfb1a7d41 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Sun, 28 May 2023 02:36:56 +0200 Subject: [PATCH] Fix #1312 - invert model A and B ratio in merge --- ui/plugins/ui/merge.plugin.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ui/plugins/ui/merge.plugin.js b/ui/plugins/ui/merge.plugin.js index 5ce97b2d..d3ddedbf 100644 --- a/ui/plugins/ui/merge.plugin.js +++ b/ui/plugins/ui/merge.plugin.js @@ -403,16 +403,19 @@ // Batch main loop for (let i = 0; i < iterations; i++) { let alpha = (start + i * step) / 100 - switch (document.querySelector("#merge-interpolation").value) { - case "SmoothStep": - alpha = smoothstep(alpha) - break - case "SmootherStep": - alpha = smootherstep(alpha) - break - case "SmoothestStep": - alpha = smootheststep(alpha) - break + + if (isTabActive(tabSettingsBatch)) { + switch (document.querySelector("#merge-interpolation").value) { + case "SmoothStep": + alpha = smoothstep(alpha) + break + case "SmootherStep": + alpha = smootherstep(alpha) + break + case "SmoothestStep": + alpha = smootheststep(alpha) + break + } } addLogMessage(`merging batch job ${i + 1}/${iterations}, alpha = ${alpha.toFixed(5)}...`) @@ -420,7 +423,8 @@ request["out_path"] += "-" + alpha.toFixed(5) + "." + document.querySelector("#merge-format").value addLogMessage(`  filename: ${request["out_path"]}`) - request["ratio"] = alpha + // sdkit documentation: "ratio - the ratio of the second model. 1 means only the second model will be used." + request["ratio"] = 1-alpha let res = await fetch("/model/merge", { method: "POST", headers: { "Content-Type": "application/json" },