sd-webui-controlnet icon indicating copy to clipboard operation
sd-webui-controlnet copied to clipboard

[Feature Request] Support for batch img2img?

Open Creative-Ataraxia opened this issue 1 year ago • 12 comments

how do we load the same image into the extension as the image loaded into img2img? So we don't have to manually load the image twice each time

Creative-Ataraxia avatar Feb 15 '23 08:02 Creative-Ataraxia

Already supported by #36

Mikubill avatar Feb 15 '23 08:02 Mikubill

Already supported by #36

thanks for the reply; What I meant was, not just the img2img tab, but the batch subtab of the img2img tab; when using the batch tab and the controlnet script, will raise error:

\stable-diffusion-webui\modules\img2img.py", line 76, in process_batch
processed_image.save(os.path.join(output_dir, filename))
AttributeError: 'numpy.ndarray' object has no attribute 'save'

sounds like the output data of controlnet is a ndarray and when processed as webui's code processed_image, by line 76, processed_image.save(os.path.join(output_dir, filename)), will raise an error

Creative-Ataraxia avatar Feb 15 '23 11:02 Creative-Ataraxia

yes currently batch only gives you the very first image and does not work for the rest , this shouldnt be that hard to fix

ryanthegray74 avatar Feb 15 '23 11:02 ryanthegray74

yes currently batch only gives you the very first image and does not work for the rest , this shouldnt be that hard to fix

wonder if we can extract the for loop of the batch process function and output the image into controlnet somehow

Creative-Ataraxia avatar Feb 15 '23 12:02 Creative-Ataraxia

Added an option to skip saving controlnet detectmep. May help with this issue

Mikubill avatar Feb 15 '23 12:02 Mikubill

Can confirm this is working now with "Do not append detectmap to output" enabled in settings. Thanks!

boredofnames avatar Feb 15 '23 13:02 boredofnames

Added an option to skip saving controlnet detectmep. May help with this issue

When I use "Do not append detectmap to output" Batch img2img works fine! In my personal opinion, this option would be more convenient to use if moved to the ControlNet panel of the img2img tab.

toyxyz avatar Feb 15 '23 14:02 toyxyz

Added an option to skip saving controlnet detectmep. May help with this issue

great, thanks! just wondering, does this mean that the open pose are no longer guiding the generated images? I noticed that some output images are not following the input image's pose anymore, even with openpose model selected

edit: most still sticks to the input image, but some are not, could just this be noises in latent space?

Creative-Ataraxia avatar Feb 15 '23 14:02 Creative-Ataraxia

Found something a little odd. BatchImg2Img runs normally without any problems, but compared to when ControlNet was run in Txt2img (same Seed, prompt), it seems that not only openpose is input, but the image itself is also input. 1: Input Image, 2: Txt2img Openpose, 3: BatchImg2Img Openpose. Is there a way to get the same result as Txt2Img in BatchImg2Img? image

toyxyz avatar Feb 15 '23 16:02 toyxyz

I created a temporary extension to fix this issue. By using this extension, img2img processing will not be performed. https://github.com/ddPn08/sd-webui-controlnet-batch-patch

Once #98 is merged it will no longer be needed.

ddPn08 avatar Feb 17 '23 09:02 ddPn08

I created a temporary extension to fix this issue. By using this extension, img2img processing will not be performed. https://github.com/ddPn08/sd-webui-controlnet-batch-patch

Once #98 is merged it will no longer be needed.

I double that current outputs are all really dark, which seems to be because it's using the detectmaps as the img2img sources, is this what your PR aims to fix?

Creative-Ataraxia avatar Feb 17 '23 13:02 Creative-Ataraxia

image

@Creative-Ataraxia You can use it like this. For the Patch extension, just enable it. Batch processing works similarly.

ddPn08 avatar Feb 17 '23 14:02 ddPn08