Update anapnoe_png_info.js
Browse files- anapnoe_png_info.js +26 -20
anapnoe_png_info.js
CHANGED
|
@@ -524,24 +524,29 @@ let imgStorage=(img)=>{
|
|
| 524 |
.querySelector("#txt2img_enable_hr input")
|
| 525 |
.dispatchEvent(changeEvent);
|
| 526 |
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
);
|
| 531 |
-
const mousevent = new MouseEvent("mousedown", {
|
| 532 |
-
view: window,
|
| 533 |
-
bubbles: true,
|
| 534 |
-
cancelable: true,
|
| 535 |
-
});
|
| 536 |
-
inputElement.dispatchEvent(mousevent);
|
| 537 |
-
queueMicrotask(() => {
|
| 538 |
-
//将函数加入到任务队列待下一次轮询在执行
|
| 539 |
-
const listElem = shadowRoot.querySelector(
|
| 540 |
-
`[data-value="${result.Hiresupscaler}"]`
|
| 541 |
);
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 545 |
|
| 546 |
shadowRoot.querySelectorAll("#txt2img_hires_steps input")[0].value =
|
| 547 |
Number(result.Hiressteps) || 0;
|
|
@@ -764,9 +769,10 @@ let imgStorage=(img)=>{
|
|
| 764 |
};
|
| 765 |
}
|
| 766 |
});
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
|
|
|
|
| 770 |
png_info.dispatchEvent(changeEvent)
|
| 771 |
})
|
| 772 |
}
|
|
|
|
| 524 |
.querySelector("#txt2img_enable_hr input")
|
| 525 |
.dispatchEvent(changeEvent);
|
| 526 |
|
| 527 |
+
if (!!result.Hiresupscaler) {
|
| 528 |
+
const inputElement = document.querySelector(
|
| 529 |
+
'#txt2img_hr_upscaler > label > div > div.wrap-inner> div > input'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
);
|
| 531 |
+
const mousevent = new MouseEvent("mousedown", {
|
| 532 |
+
view: window,
|
| 533 |
+
bubbles: true,
|
| 534 |
+
cancelable: true,
|
| 535 |
+
});
|
| 536 |
+
const focus = new MouseEvent("focus", {
|
| 537 |
+
view: window,
|
| 538 |
+
bubbles: true,
|
| 539 |
+
cancelable: true,
|
| 540 |
+
});
|
| 541 |
+
inputElement.dispatchEvent(focus);
|
| 542 |
+
queueMicrotask(() => {
|
| 543 |
+
//将函数加入到任务队列待下一次轮询在执行
|
| 544 |
+
const listElem = shadowRoot.querySelector(
|
| 545 |
+
`[data-value="${result.Hiresupscaler}"]`
|
| 546 |
+
);
|
| 547 |
+
listElem.dispatchEvent(mousevent);
|
| 548 |
+
});
|
| 549 |
+
}
|
| 550 |
|
| 551 |
shadowRoot.querySelectorAll("#txt2img_hires_steps input")[0].value =
|
| 552 |
Number(result.Hiressteps) || 0;
|
|
|
|
| 769 |
};
|
| 770 |
}
|
| 771 |
});
|
| 772 |
+
//拖拽
|
| 773 |
+
png_info.querySelector("#pnginfo_image > div.image-container > div ").addEventListener("drop",()=>{
|
| 774 |
+
if(document.querySelector("#pnginfo_image > div.image-container > div > div > button:nth-child(2)"))
|
| 775 |
+
png_info.querySelector("#pnginfo_image > div.image-container > div > div > button:nth-child(2)").click()
|
| 776 |
png_info.dispatchEvent(changeEvent)
|
| 777 |
})
|
| 778 |
}
|