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

[Bug]: "Batch from directory" limited to 238 pictures

Open 0nl1n1n opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

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

What happened?

While running a batch of thousands pictures in the "Extras -> Batch from directory" - I noticed that only 238 pictures were upscaled before coming to a full stop. No error message.

Steps to reproduce the problem

  1. Go to the "Extras Tab"
  2. Select "Batch from directory"
  3. Select a directory with more than 238 pictures
  4. Run the upscale on Lanczos

What should have happened?

The script should continue as long as there are pictures in the folder.

Commit where the problem happens

45a8b758

What platforms do you use to access the UI ?

MacOS

What browsers do you use to access the UI ?

Brave

Command Line Arguments

No

List of extensions

ABG_extension https://github.com/KutsuyaYuki/ABG_extension.git unknown sd-dynamic-prompts https://github.com/adieyal/sd-dynamic-prompts unknown stable-diffusion-webui-wildcards https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards unknown LDSR built-in ScuNET built-in SwinIR built-in prompt-bracket-checker built-in roll-artist built-in

Console logs

No long in the console for that feature.

Additional information

No response

0nl1n1n avatar Feb 17 '23 15:02 0nl1n1n

I just tried this with 500 images in a directory. Worked without issues.

Are you always trying this on the same directory? Perhaps there's an issue with your 238th image?

AlUlkesh avatar Feb 17 '23 18:02 AlUlkesh

same user posted the question few days ago in discussions, had the same answer. in either case - if there is an issue, needs more info.

vladmandic avatar Feb 19 '23 00:02 vladmandic

I just tried this with 500 images in a directory. Worked without issues.

Are you always trying this on the same directory? Perhaps there's an issue with your 238th image?

No, I actually have to do batches of 238 pictures each time. Not sure how I can further pin down where the problem comes from since there are no logs in the console.

0nl1n1n avatar Feb 19 '23 09:02 0nl1n1n

It is caused by too many open files. You can solve it by run ulimit -n 50000.

There should be a print in https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/postprocessing.py#L37.

Refer to https://stackoverflow.com/questions/18280612/ioerror-errno-24-too-many-open-files.

qodjf avatar Jun 19 '23 15:06 qodjf

@vladmandic FYI

TheOnlyHolyMoly avatar Jun 22 '23 10:06 TheOnlyHolyMoly

Fixed in https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12479

catboxanon avatar Aug 12 '23 06:08 catboxanon