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

[Feature Request]: disable: All images are auto saved in fixed Windows Temp folder. Critical for possible unwanted results

Open Username69992872 opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

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

What would your feature do ?

I found that WebUI is saving all pictures generated in User/AppData/Local/Temp, regardless of WebUI settings not to save any images. There should be a way to disable that, or if WebUI requires that, at least put a setting to move that temp directory to a specific location.

This becomes important when creating possible unwanted NFSW results. People dont want that files being left somewhere.

Proposed workflow

  1. Go to ....
  2. Press ....
  3. ...

Additional information

No response

Username69992872 avatar Nov 02 '22 19:11 Username69992872

Looks like this code line is fixing it, and it should be added to the WebUI Settings:

launch.py: os.environ["TEMP"] = os.environ["TMP"] = "[drive]:/path/to/dir"

Username69992872 avatar Nov 02 '22 19:11 Username69992872

Possible duplicate of #3278

timntorres avatar Nov 02 '22 20:11 timntorres

https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4202 Made a PR to fix this

aliencaocao avatar Nov 03 '22 05:11 aliencaocao

Pls check and close if issue is resolved https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4202#issuecomment-1370975145

aliencaocao avatar Jan 04 '23 14:01 aliencaocao

Not fixed still https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3278

mezotaken avatar Jan 13 '23 16:01 mezotaken

i do have a PR linked but AUTO closed it, maybe those in need can checkout my PR see if what it does is what you need, then I can reopen it.

The reason being there are multiple 'solutions' to this issue. The most permant and fundmental is to not save at all and instead use data URLs, however this cause the entire DOM to be very big and might be laggy on some browsers since now all images are storaged in the html as base64 data URLs.

The other solutions include the one my PR does, which is allowing user to specify a temp folder and purge it on SIGINT/ctrl+c, but this relies on user using ctrl+c to close instead of using the X button.

The current way already merged in this repo is to purge the content of the temp folder at start up, and there is a cmd arg that allow user to specify temp dir, but I personally have not tried it as i am using my own PR.

aliencaocao avatar Jan 14 '23 04:01 aliencaocao

I saw your PR and assumed this https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4202#issuecomment-1370975145 meant it should have been fixed by auto instead, but looks like there were some implementation errors, because i can confirm https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3278#issuecomment-1371565111 this happens on my machine as well. I'll check out your PR and i do believe it works, but the main problem here is to merge it in somehow.

Btw i closed this only because of duplicate, first issue still stands, waiting for a fix.

mezotaken avatar Jan 14 '23 05:01 mezotaken

The problem is NOT that the images are left in the temp folder AFTERWARDS. If I say I do NOT want images then why are images, as image FILES, even being created?

You might ask why would someone not want image files for the images being generated. Well it does not matter as I have my reasons and you have a setting which are supposed to disable saving images. It is NOT "where" they are being saved it, or whether they are removed later, but the fact that I have disabled "Always save all generated images". If I say DO NOT SAVED THEM then please do NOT save them. I don't want the zip overhead while investigating things.

aifartist avatar Jan 22 '23 21:01 aifartist

Image files are being created as part of gradio library. The only 2 solution will be 1. Dont use gradio 2. Make a pr to gradio to make it optional. Nothing we can do here except for cleaning it up

aliencaocao avatar Jan 22 '23 21:01 aliencaocao