From 0876f752d3b743e03a6c7d6bab1ae58c107765a5 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 13 May 2023 15:29:23 +0900 Subject: [PATCH] * batch support enhance - pick index based on imageIndex on copy action * paste fix on batch image node --- web/scripts/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 6dec31b94..36bc0cbcf 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -84,12 +84,17 @@ export class ComfyApp { } } + var selectedIndex = 0; + if(node.imageIndex) { + selectedIndex = node.imageIndex; + } + ComfyApp.clipspace = { 'widgets': widgets, 'imgs': imgs, 'original_imgs': orig_imgs, 'images': node.images, - 'selectedIndex': 0, + 'selectedIndex': selectedIndex, 'img_paste_mode': 'selected' // reset to default im_paste_mode state on copy action }; @@ -118,6 +123,7 @@ export class ComfyApp { const img = new Image(); img.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src; node.imgs = [img]; + node.imageIndex = 0; } else { const imgs = [];