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

[Bug]: Temporary directory not created

Open Woisek 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?

When a temporary directory should be used, it will not be created if not existing.

Steps to reproduce the problem

  1. Go to instruct-pix2pix
  2. Press Generate
  3. See error in console: FileNotFoundError: [Errno 2] No such file or directory: 'T:\systemp\sd_temp_files\tmpy3cnuuzh.png'

What should have happened?

When a temporary directory should be used, it should create it if not existing.

Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--xformers --api --administrator --opt-split-attention --theme=dark

List of extensions

A lot (to tedious to copy, paste and format it every time)

Console logs

Processing 1 image(s)
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:02<00:00,  8.10it/s]
Traceback (most recent call last):
  File "I:\Super SD 2.0\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "I:\Super SD 2.0\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1018, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "I:\Super SD 2.0\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 956, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "I:\Super SD 2.0\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 3735, in postprocess
    file = processing_utils.save_pil_to_file(img)
  File "I:\Super SD 2.0\stable-diffusion-webui\modules\ui_tempdir.py", line 52, in save_pil_to_file
    file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
  File "F:\Programme\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
  File "F:\Programme\Python310\lib\tempfile.py", line 556, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "F:\Programme\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'T:\\systemp\\sd_temp_files\\tmpy3cnuuzh.png'

Additional information

No response

Woisek avatar Feb 25 '23 17:02 Woisek

me too, i can't output any grid, but each image can output, i don't know why?

LCHHeluo avatar Feb 28 '23 09:02 LCHHeluo

It would be nice if this gets fixed soon, because it's really annoying to render an (bigger) image over a lenghy time, just to have it aborted at the end, because the defined temporary folder was not created as it should. Thanks.

Woisek avatar Mar 03 '23 08:03 Woisek

It seem there is no interest in fixing such big problem ...

Woisek avatar Mar 09 '23 18:03 Woisek

On the surface, there doesn't seem to be any relation to this project, but rather a sub-component. Also, the whining tone of these messages will not encourage any volunteers to reach out on the issue.

There doesn't seem to be any useful detail in the console log that was posted. Is the path shown to be nonexistant actually existing: 'T:\\systemp\\sd_temp_files\\tmpy3cnuuzh.png' ?

Are the steps to reproduce, only to simply use instruct-pix2pix and generate large images?

Have you tried executing the runtime, by first changing directory to the temporary storage or making the default runtime directory on your temporary storage? Is your temporary storage a USB or network attached drive?

suparious avatar Mar 09 '23 19:03 suparious

On the surface, there doesn't seem to be any relation to this project, but rather a sub-component.

How can this not be related to this project, when a setting from WebUI is not respected and therefore not working? Under "Saving images/grids" there is the option "Directory for temporary images; leave empty for default". Would you say, that this option does not relate to this reposity "stable-diffusion-webui"?

Also, the whining tone of these messages will not encourage any volunteers to reach out on the issue.

Maybe you have missed it, but many users report this issue for about a month or so it seems. And still no one cares about it. What do you think should we do to make your grace finally move something?

There doesn't seem to be any useful detail in the console log that was posted. Is the path shown to be nonexistant actually existing: 'T:\systemp\sd_temp_files\tmpy3cnuuzh.png' ?

That is exactly the issue and if you would have red the many issue reports, then you would know. Again, for you once more: The issue is, that folders aren't created if they are not existing but needed. I have a temporary folder at T:\systemp\ which is emptyed on a regular basis and I want to have everything stable diffusion related in an subfolder there. So I enter the option provided for this purpose with T:\systemp\sd_temp_files. And the problem is, becasue also this subfolder get regulary deleted, that this directory is not created when needed. Instead it throws the error you have seen. This is considert as a bug, and that's why it should have been fixed already. And while we are at it, then also equally the option "Cleanup non-default temporary directory when starting webui", which also doesn't work. Nothing is gonna deleted at WebUI start. Also already reported a few times. Therefore, we would all be happy if this would finally be fixed, thanks.

Woisek avatar Mar 09 '23 22:03 Woisek

Work around: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/11578#issuecomment-1628075572

TZFC avatar Aug 02 '23 04:08 TZFC

5 months and this is still not fixed ,,, ? 😯 Geez ... how hard must it be to tell an application to create a folder if it's not existing ... 😒

Woisek avatar Aug 02 '23 06:08 Woisek

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

catboxanon avatar Aug 26 '23 09:08 catboxanon