* batch support enhance

- pick index based on imageIndex on copy action
* paste fix on batch image node
This commit is contained in:
Dr.Lt.Data 2023-05-13 15:29:23 +09:00
parent 60b0d2067e
commit 0876f752d3

View File

@ -84,12 +84,17 @@ export class ComfyApp {
} }
} }
var selectedIndex = 0;
if(node.imageIndex) {
selectedIndex = node.imageIndex;
}
ComfyApp.clipspace = { ComfyApp.clipspace = {
'widgets': widgets, 'widgets': widgets,
'imgs': imgs, 'imgs': imgs,
'original_imgs': orig_imgs, 'original_imgs': orig_imgs,
'images': node.images, 'images': node.images,
'selectedIndex': 0, 'selectedIndex': selectedIndex,
'img_paste_mode': 'selected' // reset to default im_paste_mode state on copy action '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(); const img = new Image();
img.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src; img.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src;
node.imgs = [img]; node.imgs = [img];
node.imageIndex = 0;
} }
else { else {
const imgs = []; const imgs = [];