lquesada / ComfyUI-Inpaint-CropAndStitch

ComfyUI nodes to crop before sampling and stitch back after sampling that speed up inpainting
GNU General Public License v3.0
398 stars 23 forks source link

Stitching images in batch #46

Closed evanscho closed 1 week ago

evanscho commented 1 week ago

Is there a way to get Inpaint Crop / Inpaint Stitch's 'stitch' to be compatible with batch sizes > 1? I'm using the Repeat Latent Batch node which increases batch size, but haven't figured out a good way to use that with Inpaint Crop / Inpaint Stitch.

Specifically, the 'stitch' output of Inpaint Crop is a python dictionary which has an 'x' key that maps to a list of length 1. In Inpaint Stitch, stitch['x'] is compared to the batch_size of the inpainted_image, and if they're not equal it throws "Stitch size doesn't match image batch size".

evanscho commented 1 week ago

In case anyone runs into the same challenge, a solution is to add an "Image Batch to Image List" node, like in Impact Pack, before sending the inpainted_image to Inpaint Stitch.