From 816cf8f702c9803938ca9dc3b3a2ac11cad00725 Mon Sep 17 00:00:00 2001 From: rbertus2000 <91765399+rbertus2000@users.noreply.github.com> Date: Fri, 21 Oct 2022 22:40:26 +0200 Subject: [PATCH 1/2] fix multiple images with upscale/fix face button --- ui/media/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 6300ea4a..b4ff83a2 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -453,11 +453,13 @@ function onMakeSimilarClick(req, img) { function enqueueImageVariationTask(req, img, reqDiff) { const imageSeed = img.getAttribute('data-seed') - const newTaskRequest = modifyCurrentRequest(req, reqDiff, { + reqDiff = Object.assign({}, reqDiff, { num_outputs: 1, // this can be user-configurable in the future seed: imageSeed }) + const newTaskRequest = modifyCurrentRequest(req, reqDiff) + newTaskRequest.numOutputsTotal = 1 // this can be user-configurable in the future newTaskRequest.batchCount = 1 From 1696a5c8e1cdef4319d2ffedefacfce258e9db4c Mon Sep 17 00:00:00 2001 From: rbertus2000 <91765399+rbertus2000@users.noreply.github.com> Date: Fri, 21 Oct 2022 23:04:42 +0200 Subject: [PATCH 2/2] modifyCurrentRequest with rest parameters --- ui/media/js/main.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index b4ff83a2..94d55878 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -421,10 +421,10 @@ function onDownloadImageClick(req, img) { imgDownload.click() } -function modifyCurrentRequest(req, reqDiff) { +function modifyCurrentRequest(req, ...reqDiff) { const newTaskRequest = getCurrentUserRequest() - newTaskRequest.reqBody = Object.assign({}, req, reqDiff, { + newTaskRequest.reqBody = Object.assign({}, req, ...reqDiff, { use_cpu: useCPUField.checked }) newTaskRequest.seed = newTaskRequest.reqBody.seed @@ -453,13 +453,11 @@ function onMakeSimilarClick(req, img) { function enqueueImageVariationTask(req, img, reqDiff) { const imageSeed = img.getAttribute('data-seed') - reqDiff = Object.assign({}, reqDiff, { + const newTaskRequest = modifyCurrentRequest(req, reqDiff, { num_outputs: 1, // this can be user-configurable in the future seed: imageSeed }) - const newTaskRequest = modifyCurrentRequest(req, reqDiff) - newTaskRequest.numOutputsTotal = 1 // this can be user-configurable in the future newTaskRequest.batchCount = 1