mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-25 20:08:16 +02:00
Merge pull request #1316 from JeLuF/fix1312
Fix #1312 - invert model A and B ratio in merge
This commit is contained in:
commit
0ebf9df207
@ -403,6 +403,8 @@
|
|||||||
// Batch main loop
|
// Batch main loop
|
||||||
for (let i = 0; i < iterations; i++) {
|
for (let i = 0; i < iterations; i++) {
|
||||||
let alpha = (start + i * step) / 100
|
let alpha = (start + i * step) / 100
|
||||||
|
|
||||||
|
if (isTabActive(tabSettingsBatch)) {
|
||||||
switch (document.querySelector("#merge-interpolation").value) {
|
switch (document.querySelector("#merge-interpolation").value) {
|
||||||
case "SmoothStep":
|
case "SmoothStep":
|
||||||
alpha = smoothstep(alpha)
|
alpha = smoothstep(alpha)
|
||||||
@ -414,13 +416,15 @@
|
|||||||
alpha = smootheststep(alpha)
|
alpha = smootheststep(alpha)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
addLogMessage(`merging batch job ${i + 1}/${iterations}, alpha = ${alpha.toFixed(5)}...`)
|
addLogMessage(`merging batch job ${i + 1}/${iterations}, alpha = ${alpha.toFixed(5)}...`)
|
||||||
|
|
||||||
request["out_path"] = document.querySelector("#merge-filename").value
|
request["out_path"] = document.querySelector("#merge-filename").value
|
||||||
request["out_path"] += "-" + alpha.toFixed(5) + "." + document.querySelector("#merge-format").value
|
request["out_path"] += "-" + alpha.toFixed(5) + "." + document.querySelector("#merge-format").value
|
||||||
addLogMessage(` filename: ${request["out_path"]}`)
|
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", {
|
let res = await fetch("/model/merge", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
|
Loading…
Reference in New Issue
Block a user