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

Error when using Img2Img Batch

Open SSA4 opened this issue 2 years ago • 7 comments

Hello,

I get this error when I try to process multiple images with the img2img batch function:

Traceback (most recent call last):
  File "C:\StableDiffusion2023\stable-diffusion-webui-master(3)\stable-diffusion-webui-master\modules\call_queue.py", line 56, in f
   res = list(func(*args, **kwargs))
  File "C:\StableDiffusion2023\stable-diffusion-webui-master(3)\stable-diffusion-webui-master\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "C:\StableDiffusion2023\stable-diffusion-webui-master(3)\stable-diffusion-webui-master\modules\img2img.py", line 163, in img2img
    process_batch(p, img2img_batch_input_dir, img2img_batch_output_dir, img2img_batch_inpaint_mask_dir, args)
  File "C:\StableDiffusion2023\stable-diffusion-webui-master(3)\stable-diffusion-webui-master\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'

I tried to use different preprocessors and models but everytime I get the same error. When I just use img2img with just a single image there is no error. I using Windows 10 whith a NVIDIA RTX 3090 Ti. I set the Input directory and the Output directory correctly.

SSA4 avatar Feb 14 '23 21:02 SSA4

Same

Echolink50 avatar Feb 14 '23 21:02 Echolink50

I'm not even sure I follow how to use batch with this. Batch lets you specify a whole directory of images as input images, but this script only lets you specify one image in its canvas. Shouldn't the script also add the ability to provide a corresponding directory of images for the script to use? That's what I would need, at least...

enn-nafnlaus avatar Feb 14 '23 22:02 enn-nafnlaus

When I use this extension I dont put any images in the canvas, so I leave it completly blank. I just enable the the ControlNet in the img2img tab and select the preprocessor and the model and set the weight. The results are very good and extremely accurate. I get a way better consistency and the results are much better than I get with the normal img2img.

SSA4 avatar Feb 14 '23 22:02 SSA4

Well, that's great if your goal isn't to provide a custom depthmap / etc as distinct from the image...

enn-nafnlaus avatar Feb 14 '23 22:02 enn-nafnlaus

Well, that's great if your goal isn't to provide a custom depthmap / etc as distinct from the image...

I get the same image without canvas. Thats for scribbles i guess.

AbyszOne avatar Feb 14 '23 23:02 AbyszOne

I'm sorry, but I think I completely misunderstood this extension. A empty canvas make no sense. So I think to fix the error I mentioned in my first post above is not necessary, because to use the batch function in this way is useless. I figured this out after some experiments.

SSA4 avatar Feb 15 '23 00:02 SSA4

I'm sorry, but I think I completely misunderstood this extension. A empty canvas make no sense. So I think to fix the error I mentioned in my first post above is not necessary, because to use the batch function in this way is useless. I figured this out after some experiments.

Can you elaborate? I just want it to do what it does to multiple images without having to put them in one at a time

Echolink50 avatar Feb 15 '23 00:02 Echolink50