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

Too many open files

Open Hans2004 opened this issue 11 months ago • 2 comments

When doing a "batch from directory", is it necessary for the script to open all the files at once?

On many Linuxes this creates an issue with too many open files and possibly all sorts of memory issues. I think the offending code is in common_ui.py:

image_list = backbone.listfiles(depthmap_batch_input_dir)
   for path in image_list:
     try:
       inputimages.append(Image.open(path))
       inputnames.append(path)
.
.
.

Hans2004 avatar Mar 07 '24 09:03 Hans2004

I would second this, I think the file should be opened when it is actually processed not when it is being read into the queue. This makes little sense and make the batching feature quite impractical.

I was splitting an animation into singular images and intended to process them from a directory. We're talking thousands of images. However, I can't batch process them at the moment due to this limitation.

zealsprince avatar May 11 '24 00:05 zealsprince

You may try to increase the maximum number of opened file descriptors.

semjon00 avatar May 11 '24 09:05 semjon00