Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Batch img2img with multiple X/Y/Z denoising values is only saving one image (WebUI 1.6.0) #12913

Closed
1 task done
acoolrocket opened this issue Aug 31, 2023 · 12 comments
Closed
1 task done
Assignees
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@acoolrocket
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

I always used this setup with the older versions with no issues and it saves all 7 denoising results, although now only saving one image, and weirder I have 2 images in the input folder.

Steps to reproduce the problem

Have my img2img setup here.

What should have happened?

It should give 2x7 images but for some reason only 1.

Sysinfo

N/A

What browsers do you use to access the UI ?

Google Chrome

Console logs

Will process 98 images, creating 1 new images for each.
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)
                                  Calculating sha256 for C:\ai\stable-diffusion-webui\models\VAE\orangemix.vae.pt: f921fb3f29891d2a77a6571e56b8b5052420d2884129517a333c60b1b4816cdf
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:28<00:00,  1.25s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:33<00:00,  1.30s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 28/28 [00:37<00:00,  1.32s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:40<00:00,  1.32s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 33/33 [00:44<00:00,  1.34s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 36/36 [00:48<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 38/38 [00:51<00:00,  1.36s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:17<03:19,  1.48s/it]
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)         | 215/350 [05:17<03:05,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:31<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:35<00:00,  1.35s/it]
 89%|█████████████████████████████████████████████████████████████████████████▏        | 25/28 [00:34<00:04,  1.38s/it]
Total progress:  21%|█████████████▋                                                   | 74/350 [01:52<07:00,  1.52s/it]
Will process 2 images, creating 1 new images for each.                                | 74/350 [01:52<06:20,  1.38s/it]
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:30<00:00,  1.31s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:34<00:00,  1.34s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 28/28 [00:37<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:41<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 33/33 [00:44<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 36/36 [00:49<00:00,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 38/38 [00:51<00:00,  1.37s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:18<03:19,  1.48s/it]
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)         | 215/350 [05:18<03:06,  1.38s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:31<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:35<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 28/28 [00:38<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:42<00:00,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 33/33 [00:45<00:00,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 36/36 [00:49<00:00,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 38/38 [00:52<00:00,  1.37s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:22<03:22,  1.50s/it]
Will process 2 images, creating 1 new images for each.██████▎                        | 215/350 [05:22<03:07,  1.39s/it]
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:29<00:00,  1.29s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:34<00:00,  1.32s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 28/28 [00:37<00:00,  1.33s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:41<00:00,  1.34s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 33/33 [00:44<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 36/36 [00:48<00:00,  1.35s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 38/38 [00:51<00:00,  1.36s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:15<03:17,  1.47s/it]
X/Y/Z plot will create 7 images on 1 7x1 grid. (Total steps to process: 350)         | 215/350 [05:15<03:06,  1.38s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 23/23 [00:31<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:35<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 28/28 [00:38<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 31/31 [00:42<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 33/33 [00:44<00:00,  1.36s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 36/36 [00:49<00:00,  1.37s/it]
100%|██████████████████████████████████████████████████████████████████████████████████| 38/38 [00:52<00:00,  1.38s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:21<03:21,  1.50s/it]
Total progress:  61%|███████████████████████████████████████▎                        | 215/350 [05:21<03:08,  1.39s/it]

Additional information

No response

@acoolrocket acoolrocket added the bug-report Report of a bug, yet to be confirmed label Aug 31, 2023
@w-e-w w-e-w self-assigned this Aug 31, 2023
@w-e-w
Copy link
Collaborator

w-e-w commented Aug 31, 2023

upload Sysinfo

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 31, 2023

test pr #12926 see if the issue is fixed

@acoolrocket
Copy link
Author

upload Sysinfo

Sorry first time posting an issue, but found the tab in settings.

Pastebin link

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 1, 2023

so if my conclusion is correct my PR one part of the problem
but the more importent problem is caused by your user error
in your setting tou have

        "samples_filename_pattern": "[seed], [model_name], [prompt], [steps], [cfg]",
        "save_images_add_number": false,

this means that the follow name given to the image you saved will be [seed], [model_name], [prompt], [steps], [cfg]
so if you have an image with the same seat using the same model using the same prompt with the same amount of steps and the same CFG
the image will be given the same name
the issue occurs if you have all these the same but denoise is different the image will still be given the same name

this normally wouldn't be an issue but you also have save_images_add_number disable
which would add a prefix number guaranteeing that the file name is unique

when they found name is the same the image will be overwritten
this is most likely why you're only seeing not the correct amount of images
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Images-Filename-Name-and-Subdirectory#caution
I have document this behavior and add caution on the wiki you clearly read that

there are other ways of making sure that the file name is unique other than adding a prefix number
I personally use timestamp as te filename, as long as the time increment is small enough then the images will be unique

example [datetime<%Y%m%d-%H%M%S-%f><Asia/Tokyo>], timestamp to the millisecond precision in Tokyo time zone

another method of making sure that the file name is unique is using [image_hash] this would generate a signature that is almost impossible to repeat, it is a method often used to do comparison if you see two files with the same hash, it's basically used to say that these two files are the same
if you see two images with the same exact hash then you can essentially say that these two images are Pixel Perfect the same which you basically don't need a second copy
mathematically speaking it is possible that you get two different images that outputs the same hash but it is it is essentially impossible

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 1, 2023

the expected behavior of the current 1.6.0 before my PR should be when xyz and batch img2img
is the output directory is ignored but images are correct saved just in the default directory
this is a bug and it should be addressed by my PR

@acoolrocket
Copy link
Author

Thankfully enabling the field 'save_images_add_number' in config solved the issue, it was the fact that it was overriding the filename hence leaving only one which is weird considering I have both the Seed at -1 and 'Keep -1 for seeds' checked on. I mean even then before 1.5.1 and 1.6.0 it would save the file like "original image name"-1, "original image name"-2 and so on for all images.

Strangely I don't know why the X/Y/Z script decided to switch to the seed name/prompt and etc. naming afterwards for some reason even though I didn't change the settings in regards to this.

Also side note, the files are still not saving in the output directory, still going to my typical img2img directory if that's anything too.

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 1, 2023

yes it seems that I accidentally change the behavior in this mix scenario
I'll see if I can bring the old behavior back

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 6, 2023

@acoolrocket I made a additional change to the PR so that now it should also be able to use original file name when script is in used

@acoolrocket
Copy link
Author

@acoolrocket I made a additional change to the PR so that now it should also be able to use original file name when script is in used

Nice, admittedly I've already switched back to 1.5.2 since I've had enough of 1.6.0 but now facing the TypeError: 'NoneType' object is not subscriptable issue I faced with on 1.5.1 too. Don't tell me I have to keep switching between 1.6.0 just to make use of batch img2img.

@w-e-w
Copy link
Collaborator

w-e-w commented Sep 6, 2023

TypeError: 'NoneType' object is not subscriptable

that's practically no information to work with
if you really want me to look at it then provide full error log and sysinfo

@acoolrocket
Copy link
Author

acoolrocket commented Sep 6, 2023

TypeError: 'NoneType' object is not subscriptable

that's practically no information to work with if you really want me to look at it then provide full error log and sysinfo

I'll open another issue post regarding this.

Edit: Just finished opening

@w-e-w
Copy link
Collaborator

w-e-w commented Nov 26, 2023

should be fiex by #13170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants