Merge branch 'main' into rotate
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
commit
c4d6826369
2 changed files with 26 additions and 2 deletions
|
@ -373,7 +373,7 @@
|
|||
src="js/ui/tool/generic.js?v=f5ad9d7"
|
||||
type="text/javascript"></script>
|
||||
|
||||
<script src="js/ui/tool/dream.js?v=95c916d" type="text/javascript"></script>
|
||||
<script src="js/ui/tool/dream.js?v=3db7d6c" type="text/javascript"></script>
|
||||
<script
|
||||
src="js/ui/tool/maskbrush.js?v=1e8a893"
|
||||
type="text/javascript"></script>
|
||||
|
|
|
@ -517,6 +517,17 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
|||
});
|
||||
};
|
||||
|
||||
const removeImg = async () => {
|
||||
if (!images[at]) return;
|
||||
images.splice(at, 1);
|
||||
seeds.splice(at, 1);
|
||||
if (at >= images.length) at = 0;
|
||||
imageindextxt.textContent = `${at}/${images.length - 1}`;
|
||||
var seed = seeds[at];
|
||||
seedbtn.title = "Use seed " + seed;
|
||||
redraw();
|
||||
};
|
||||
|
||||
const makeMore = async () => {
|
||||
const moreQ = await waitQueue();
|
||||
try {
|
||||
|
@ -596,6 +607,9 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
|||
case "+":
|
||||
makeMore();
|
||||
break;
|
||||
case "-":
|
||||
removeImg();
|
||||
break;
|
||||
default:
|
||||
switch (evn.code) {
|
||||
case "ArrowRight":
|
||||
|
@ -659,7 +673,11 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
|||
const oncancelhandler = mouse.listen.world.btn.right.onclick.on(
|
||||
(evn, state) => {
|
||||
if (!state.dream_processed && bb.contains(evn.x, evn.y)) {
|
||||
discardImg();
|
||||
if (images.length > 1) {
|
||||
removeImg();
|
||||
} else {
|
||||
discardImg();
|
||||
}
|
||||
imageCollection.inputElement.style.cursor = "auto";
|
||||
state.dream_processed = true;
|
||||
}
|
||||
|
@ -743,6 +761,12 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
|||
morebtn.addEventListener("click", makeMore);
|
||||
imageSelectMenu.appendChild(morebtn);
|
||||
|
||||
const removebtn = document.createElement("button");
|
||||
removebtn.textContent = "-";
|
||||
removebtn.title = "Remove From Batch";
|
||||
removebtn.addEventListener("click", removeImg);
|
||||
imageSelectMenu.appendChild(removebtn);
|
||||
|
||||
const acceptbtn = document.createElement("button");
|
||||
acceptbtn.textContent = "Y";
|
||||
acceptbtn.title = "Apply Current";
|
||||
|
|
Loading…
Reference in a new issue