stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Extras tab: upscaler stuck on the first image it processes - latest build fixes the problem but not in some cases

Open AugmentedRealityCat opened this issue 3 years ago • 6 comments
trafficstars

Describe the bug In the Extras tab the upscaler gets stuck on the first image it processes. Then, any image you process will give you the same result as the first image. If you process a batch after that, then all the image in your batch will be copies of the very very first image you upscaled. Relaunching the web interface does not fix the problem at all. Changing the upscaler doesn't fix the problem either. Relaunching the app is required to process a new (single) image, but then you need to relaunch a third time if you want a third image.

If you start anew and try to process a batch, no matter what upscaler you select, the first frame from your batch will be processed, and all the frames after the first will be copies of that very first frame.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'extras tab'
  2. Click on 'batch process' and select 3 or more different pictures to be processed.
  3. Adjust the first upscaler "scale by" resize value to x4
  4. Select any upscaler like ESRGAN_4x, the problem occurs with all of them
  5. Hit the Generate button
  6. Wait for the images to be processed
  7. See all images are copies of the first. If you have processed any image in the upscaler earlier during that session, then that image will be shown. The good thing is it will have been upscaled.
  8. But if you want to upscale a second one, you need to relaunch the engine, not just the web interface.

Expected behavior I used to be able to process batch of images properly in the extra tab, but not anymore.

Desktop (please complete the following information):

  • Windows 10
  • Firefox 105.0.3
  • Commit hash: 3631adfe96dd7746f7e23a3cf5802d8f4a95a532

What else can I do to help debug this ?

AugmentedRealityCat avatar Oct 15 '22 10:10 AugmentedRealityCat

Same here.

Pernjakovic avatar Oct 15 '22 10:10 Pernjakovic

Having the same problem, this is really painful for workflow

Reproducing for me

  1. Put Image A in Extras and upscale it. The output is an upscaled version of image A which is saved in the extras-images folder
  2. Put image B in extras and upscale it. The output is the same upscaled version of image A, another copy of which is saved in the extras-images folder

Repeat step 2 as often as you like, you just get endless copies of the first image

There are some nuances here, changing the upscalers seems to work, I suspect this commit is at fault https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/2ef69df9a7c7b6793401f29ced71fb8a781fad4c

NanakoAC avatar Oct 16 '22 18:10 NanakoAC

The latest build has fixed all my problems ! I can run the upscaler on as many images as I want, and it doesn't get stuck reproducing the first image ad aeternam.

AugmentedRealityCat avatar Oct 17 '22 22:10 AugmentedRealityCat

This is not fixed. It uses a crop of the center image pixels as a key for caching. If two images have an identical center it will hit the cache and return the same image. Why not use filename instead?

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/c1093b8051606f0ac90506b7114c4b55d0447c70/modules/extras.py#L94-L97

doodlehead avatar Oct 19 '22 04:10 doodlehead

This is not fixed. It uses a crop of the center image pixels as a key for caching.

I was definitely still seeing this issue, and the explanation makes sense as I was working with multiple images that had been inpainted, and the "key" region was likely within the area that was unchanged.

kmbarr avatar Oct 19 '22 18:10 kmbarr

Experiencing the same problem.

delcompan avatar Oct 22 '22 14:10 delcompan

Closing as stale.

catboxanon avatar Aug 03 '23 16:08 catboxanon