stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: issue with gradio version 3.32.0 that causes "FileNotFoundError: [Errno 2] No such file or directory:"
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
In the most recent update when gradio was updated from 3.31.0 to 3.32.0 in order to fix a few issues relating to #10762 another issue popped up where if the %localappdata%/Temp/gradio" folder didn't exist SD would pop an "FileNotFoundError: [Errno 2] No such file or directory:" error
Steps to reproduce the problem
naturally happens if you don't have a custom temporary image folder defined and a '%localappdata%/Temp/gradio' folder doesn't exist.
can also happen if you delete your custom-defined folder, there seems to be no check to make sure either folder actually exists, and likly would be fixed if it was done so,
What should have happened?
likely there needs to be a check to make sure the folder '%localappdata%/Temp/gradio' or your custom-defined temp image folder actually exists on startup.
Commit where the problem happens
baf6946
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
No response
What browsers do you use to access the UI ?
No response
Command Line Arguments
--xformers
List of extensions
no
Console logs
FileNotFoundError: [Errno 2] No such file or directory: 'E:\\Ai Stuffs\\stable-diffusion-webui\\temp\\tmpk3u66409.png'
or
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Roy\AppData\Local\Temp\gradio\tmpcm2f3nrq.png'
Additional information
apologies if this bug report is done wrong
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10787#issuecomment-1576484358
this can be temporarily fixed by creating the "gradio" folder in user's temp directory.
Can confirm the same happens on ubuntu (/tmp/gradio). It can be simply fixed by manually creating the dir
I am having the same issue with the error message about /tmp/gradio/xxxx files. It does not consistently happen but I have to reload the web page once it happens.
Dunno why but without extensions (like controlnet) everything works fine (both 3.31.0 and 3.32.0 gradio versions). Nevertheless, people report that the same issue appears not only with controlnet extension.
@AUTOMATIC1111 See also https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/baf6946e06249c5af9851c60171692c44ef633e0#r116673136
Getting the same issue, windows:
Traceback (most recent call last):███████████████████████████████████████████████████████████████████| 21/21 [00:17<00:00, 2.01it/s]
File "Q:\Ai\stable-diffusion-portable-main\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "Q:\Ai\stable-diffusion-portable-main\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "Q:\Ai\stable-diffusion-portable-main\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "Q:\Ai\stable-diffusion-portable-main\venv\lib\site-packages\gradio\components.py", line 4461, in postprocess
file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
File "Q:\Ai\stable-diffusion-portable-main\modules\ui_tempdir.py", line 55, in save_pil_to_file
file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
File "Q:\Ai\stable-diffusion-portable-main\python\lib\tempfile.py", line 559, in NamedTemporaryFile
file = _io.open(dir, mode, buffering=buffering,
File "Q:\Ai\stable-diffusion-portable-main\python\lib\tempfile.py", line 556, in opener
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "Q:\Ai\stable-diffusion-portable-main\python\lib\tempfile.py", line 256, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'Q:\\Ai\\stable-diffusion-portable-main\\tmp\\gradio\\tmpo07iedck.png'
the same issue
Creating a dir actually fixes it and it's probably more convenient. You do not have to look for some recently made images around your entire tmp folder
In my case the issue was exactly as @7orbs said, the only difference being that the system that I work on is macOS Ventura 13.4. In the case of macOS, the gradio folder was missing in the following directory: /var/folders/lt/lz3y14d905v9tq9g5t5h019c0000gn/T/. Just as @breengles as @Faishun said, and I concluded this myself, after reading @7orbs' comment, but still before reading @breengles and @Faishun's comments, creating the missing gradio folder solved the issue. I have to point out here that prior to updating to the 1.3.2 version of Stable Diffusion from the previous version, I did not have this issue. This fact suggests, in turn, that not until after updating to the 1.3.2 version, the gradio folder was not missing, which would mean that it is only after updating to this particular version that the gradio folder in question may or does disappear
I have the same issue too
Can confirm it also happens on Debian 12
creating gradio folder in /tmp fixed the problem for me
Incidentally, this follows the exported TMPDIR, which I had added in webui-user.sh so pip would stop vomiting all over my rather small OS drive. Creating the gradio folder in the set location, indeed, has resolved it, until I go cleaning out that folder.
Yeah, I've been noticing this issue too. I created a gradio folder in my AppData\Local\Temp directory and the problem resolves itself without needing a UI restart, but it seems that it randomly disappears, maybe after turning off my computer.
Thanks; which folder would I put this file in?
Hmm, code's not working for me. Am I supposed to do git apply temp_patch.diff once I move it to my SD directory?
Not sure why @serakeri's answers have disappeared, but I think I managed to resolve this. I opened cmd in my Stable Diffusion directory and typed pip install gradio to get it running properly.
searched a lot, doubted sadtalker, and finally found right solution here.
Can confirm the same happens on ubuntu (
/tmp/gradio). It can be simply fixed by manually creating the dir
It works for me in linux, thank you very much
mkdir tmp
mkdir tmp/gradio
Hi I'm facing same issue now, Under which directory should I create "tmp/gradio"? directory under my stable diffusion folder? please help.
Hi I'm facing same issue now, Under which directory should I create "tmp/gradio"? directory under my stable diffusion folder? please help.
I found it was a lot easier to define a new path for the temp folder, which you can set by going to Settings → Saving images/grids → Directory for temporary images; leave empty for default
Hi I'm facing same issue now, Under which directory should I create "tmp/gradio"? directory under my stable diffusion folder? please help.
I found it was a lot easier to define a new path for the temp folder, which you can set by going to
Settings → Saving images/grids → Directory for temporary images; leave empty for default
Thxxx.....! now everything fine!
have same issue on MAC ios
Resolved by https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12717