Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: FileNotFoundError: [Errno 2]... gradio\"any png name".png' #1563

Closed
1 task done
lvlantic0r opened this issue Jun 5, 2023 · 24 comments
Closed
1 task done

[Bug]: FileNotFoundError: [Errno 2]... gradio\"any png name".png' #1563

lvlantic0r opened this issue Jun 5, 2023 · 24 comments
Labels
Announcement documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@lvlantic0r
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Hello!
since last update(today) got a strange error. Controlnet after i choose an image and preprocessor, wrote a prompt etc... Start to make generation, but in end it finished and image blinked and dessapear(but in a output folder its exist). Error appear and after this error i cannot generate anything, only after reloading the page. In stable diffusion i can generate normaly. Whould be appreceate for help

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...
    ive tried to reinstall but problem is still appear
    try to chaning path sleshes to 1/ , \, wrote a whole path and etc

What should have happened?

everything should generate well=
actualy cant get why he try to search something on disk "C" while directory of "F"

Commit where the problem happens

webui:
https://github.com/AUTOMATIC1111/stable-diffusion-webui | master | baf6946e | Mon Jun 5 03:13:41 2023

controlnet:

What browsers do you use to access the UI ?

No response

Command Line Arguments

Mozilla

List of enabled extensions

23412351235

Console logs

Loading A111 WebUI Launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 i   Settings file found, loading
 →   Updating Settings File  ✓
 i   Launcher Version 1.7.0
 i   Found a custom WebUI Config
 i   No Launcher launch options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 →   Checking requirements :
 i   Python 3.10.6150.1013 found in registry:  C:\Users\Lanphir\AppData\Local\Programs\Python\Python310\
 i   Clearing PATH of any mention of Python
 →   Adding python 3.10 to path  ✓
 i   Git found and already in PATH:  C:\Program Files\Git\cmd\git.exe
 i   Automatic1111 SD WebUI found:  F:\AI\stable-diffusion-webui
 i   One or more checkpoint models were found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Loading Complete, opening launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 i   Arguments are now: --medvram --api
 i   Arguments are now: --medvram --api
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  WEBUI LAUNCHING VIA EMS LAUNCHER, EXIT THIS WINDOW TO STOP THE WEBUI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 !   Any error happening after 'commit hash : XXXX' is not related to the launcher. Please report them on Automatic1111's github instead :
 ☁   https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cancel
venv "F:\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.3.2
Commit hash: baf6946e06249c5af9851c60171692c44ef633e0
Installing requirements


Launching Web UI with arguments: --autolaunch --medvram --api
No module 'xformers'. Proceeding without it.
==============================================================================
You are running torch 1.13.1+cu117.
The program is tested to work with torch 2.0.0.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.
==============================================================================
2023-06-05 22:09:57,189 - ControlNet - INFO - ControlNet v1.1.217
ControlNet preprocessor location: F:\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-06-05 22:09:57,242 - ControlNet - INFO - ControlNet v1.1.217
Loading weights [bd83b90a2e] from F:\AI\stable-diffusion-webui\models\Stable-diffusion\Counterfeit-V2.5.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: F:\AI\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
Startup time: 5.4s (import torch: 1.3s, import gradio: 0.8s, import ldm: 0.5s, other imports: 0.7s, list SD models: 0.1s, load scripts: 0.9s, create ui: 0.3s, gradio launch: 0.4s, scripts app_started_callback: 0.3s).
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: F:\AI\stable-diffusion-webui\models\VAE\kl-f8-anime2.ckpt
Applying optimization: Doggettx... done.
Textual inversion embeddings loaded(8): bad-artist, bad-artist-anime, bad-hands-5, bad-image-v2-39000, bad_prompt, bad_prompt_version2, easynegative, ng_deepnegative_v1_75t
Model loaded in 2.9s (load weights from disk: 0.7s, create model: 0.8s, apply weights to model: 0.6s, apply half(): 0.6s, load VAE: 0.2s).
2023-06-05 22:10:25,120 - ControlNet - INFO - Loading preprocessor: reference_only
2023-06-05 22:10:25,120 - ControlNet - INFO - preprocessor resolution = 512
  0%|                                                                                           | 0/20 [00:00<?, ?it/s]ControlNet used torch.float16 VAE to encode torch.Size([1, 4, 64, 64]).
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:26<00:00,  1.31s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:18<00:00,  1.11it/s]
Traceback (most recent call last):█████████████████████████████████████████████████████| 20/20 [00:18<00:00,  1.33it/s]
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 4461, in postprocess
    file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
  File "F:\AI\stable-diffusion-webui\modules\ui_tempdir.py", line 55, in save_pil_to_file
    file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
  File "C:\Users\Lanphir\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
  File "C:\Users\Lanphir\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 556, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Users\Lanphir\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lanphir\\AppData\\Local\\Temp\\gradio\\tmp2514rfci.png'

Additional information

No response

@bluetwo12
Copy link

I have this problem as well. Its seems to be isolated to just control net.

@lllyasviel
Copy link
Collaborator

Cannot reproduce the problem. Can anyone inform us what kind of environment will trigger this?

@bluetwo12
Copy link

bluetwo12 commented Jun 6, 2023

Just running any generated image with any model using controlnet and no embeddings showed this. I actually just fixed it by adding a gradio folder to my temp location. Not sure why it wasnt automatically generating this.

C:\Users"Username"\AppData\Local\Temp

@lllyasviel
Copy link
Collaborator

lllyasviel commented Jun 6, 2023

It seems a gradio problem and need users to run as administrator?
but why is this only isolated to CN?

@lllyasviel lllyasviel added the help wanted Extra attention is needed label Jun 6, 2023
@lllyasviel
Copy link
Collaborator

not sure what we can do about this. Will add a help wanted flag and if anyone can find the cause please let us know

@continue-revolution
Copy link
Collaborator

continue-revolution commented Jun 6, 2023

This is due to a bug in gradio version v3.32.0, especially for people who update their webui to v1.3.2. The solution is to add a gradio folder inside the temp dir, or switch to webui v1.3.1 via ‘git checkout v1.3.1’ under the webui folder.

This problem also happen to me (inside my extension, not CN) when I develop and test my own extension with webui v1.3.2

Related issues:
continue-revolution/sd-webui-segment-anything#115
AUTOMATIC1111/stable-diffusion-webui#11040
AUTOMATIC1111/stable-diffusion-webui#10787 (comment)

@firestar222
Copy link

Following, I have this as well, in Safari on OSX

@lllyasviel
Copy link
Collaborator

lllyasviel commented Jun 6, 2023

According to a1111 https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/baf6946e06249c5af9851c60171692c44ef633e0/requirements.txt#L6
the version is still 3.31.0

so if users get 3.32.0, user should know what break things

@Lerc
Copy link

Lerc commented Jun 6, 2023

I just tried bumping requirements_versions.txt down to gradio 3.31.0. ControlNet working again for me.

@Wormri
Copy link

Wormri commented Jun 6, 2023

Just running any generated image with any model using controlnet and no embeddings showed this. I actually just fixed it by adding a gradio folder to my temp location. Not sure why it wasnt automatically generating this.

C:\Users"Username"\AppData\Local\Temp

I can't believe this worked. Thanks!

@breengles
Copy link

breengles commented Jun 6, 2023

I just tried bumping requirements_versions.txt down to gradio 3.31.0. ControlNet working again for me.

Can confirm it but keep in mind that by default A1111 will install packages using requirements_versions.txt where gradio==3.32.0 so you need either downgrade version there or launch with --skip-install option (if you don't want to create missing tmp dir for gradio by yourself).

@lllyasviel
Copy link
Collaborator

Can confirm this is from automatic1111 AUTOMATIC1111/stable-diffusion-webui@baf6946#r116673136

@lvlantic0r lvlantic0r changed the title [Bug]: FileNotFoundError: [Errno 2]... tmp2514rfci.png' [Bug]: FileNotFoundError: [Errno 2]... gradio\"any png name".png' Jun 6, 2023
@lvlantic0r
Copy link
Author

Just running any generated image with any model using controlnet and no embeddings showed this. I actually just fixed it by adding a gradio folder to my temp location. Not sure why it wasnt automatically generating this.

C:\Users"Username"\AppData\Local\Temp

Thx work for me too)

@lllyasviel lllyasviel added documentation Improvements or additions to documentation Announcement labels Jun 6, 2023
@lllyasviel
Copy link
Collaborator

lllyasviel commented Jun 6, 2023

I added an ugly fix in #1576 in 1.1.219

import tempfile
gradio_tempfile_path = os.path.join(tempfile.gettempdir(), 'gradio')
os.makedirs(gradio_tempfile_path, exist_ok=True)

Someone please help see if this fix the problem.

@sololll
Copy link

sololll commented Jun 7, 2023

Yes, it's working for me.
I manually deleted the tmp/gradio folder, and it automatically created a new one after running.

@sololll
Copy link

sololll commented Jun 7, 2023

Functionally it seemed normal, but some new information popped up:
Task exception was never retrieved
future: <Task finished name='01rvkah8adqe_86' coro=<Queue.process_events() done, defined at /root/miniconda3/envs/p3 10/lib/python3.10/site-packages/gradio/queueing.py:343> exception=WebSocketDisconnect(1006)>
Traceback (most recent call last):
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events
client_awake = await self.gather_event_data(event)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data
data, client_awake = await self.get_message(event, timeout=receive_timeout)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 453, in get_message
data = await asyncio.wait_for(
File "/root/miniconda3/envs/p310/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
return fut.result()
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 133, in receive_json
self._raise_on_disconnect(message)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 105, in _raise_on_dis connect
raise WebSocketDisconnect(message["code"])
starlette.websockets.WebSocketDisconnect: 1006
Task exception was never retrieved
future: <Task finished name='01rvkah8adqe_73' coro=<Queue.process_events() done, defined at /root/miniconda3/envs/p3 10/lib/python3.10/site-packages/gradio/queueing.py:343> exception=WebSocketDisconnect(1006)>
Traceback (most recent call last):
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events
client_awake = await self.gather_event_data(event)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data
data, client_awake = await self.get_message(event, timeout=receive_timeout)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 453, in get_message
data = await asyncio.wait_for(
File "/root/miniconda3/envs/p310/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
return fut.result()
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 133, in receive_json
self._raise_on_disconnect(message)
File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 105, in _raise_on_dis connect
raise WebSocketDisconnect(message["code"])
starlette.websockets.WebSocketDisconnect: 1006

@sololll
Copy link

sololll commented Jun 7, 2023

Functionally it seemed normal, but some new information popped up: Task exception was never retrieved future: <Task finished name='01rvkah8adqe_86' coro=<Queue.process_events() done, defined at /root/miniconda3/envs/p3 10/lib/python3.10/site-packages/gradio/queueing.py:343> exception=WebSocketDisconnect(1006)> Traceback (most recent call last): File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events client_awake = await self.gather_event_data(event) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data data, client_awake = await self.get_message(event, timeout=receive_timeout) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 453, in get_message data = await asyncio.wait_for( File "/root/miniconda3/envs/p310/lib/python3.10/asyncio/tasks.py", line 445, in wait_for return fut.result() File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 133, in receive_json self._raise_on_disconnect(message) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 105, in _raise_on_dis connect raise WebSocketDisconnect(message["code"]) starlette.websockets.WebSocketDisconnect: 1006 Task exception was never retrieved future: <Task finished name='01rvkah8adqe_73' coro=<Queue.process_events() done, defined at /root/miniconda3/envs/p3 10/lib/python3.10/site-packages/gradio/queueing.py:343> exception=WebSocketDisconnect(1006)> Traceback (most recent call last): File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 347, in process_events client_awake = await self.gather_event_data(event) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 220, in gather_event_data data, client_awake = await self.get_message(event, timeout=receive_timeout) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/gradio/queueing.py", line 453, in get_message data = await asyncio.wait_for( File "/root/miniconda3/envs/p310/lib/python3.10/asyncio/tasks.py", line 445, in wait_for return fut.result() File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 133, in receive_json self._raise_on_disconnect(message) File "/root/miniconda3/envs/p310/lib/python3.10/site-packages/starlette/websockets.py", line 105, in _raise_on_dis connect raise WebSocketDisconnect(message["code"]) starlette.websockets.WebSocketDisconnect: 1006

With the startup parameter --no-gradio-queue, that information no longer appeared.

@alenknight
Copy link

any updates on this? creating the gradio folder isn't working for me

@Bavoch
Copy link

Bavoch commented Jun 11, 2023

Just running any generated image with any model using controlnet and no embeddings showed this. I actually just fixed it by adding a gradio folder to my temp location. Not sure why it wasnt automatically generating this.

C:\Users"Username"\AppData\Local\Temp

I would like to know how to do it on Mac, thanks

@daidaixiaoge
Copy link

请问在autodl云服务器上在那个位置添加 tmp/gradio

@mhenriquezschott
Copy link

can believe it works, I was trying the depth image extension, it was expecting the gradio folder at /tmp on my linux machine (ubuntu20), thanks!!

@amortegui84
Copy link

i though that mine was the same problem but nop,

*** Error running postprocess_batch: C:\ai\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
Traceback (most recent call last):
File "C:\ai\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
script.postprocess_batch(p, *script_args, images=images, **kwargs)
TypeError: Script.postprocess_batch() missing 1 required positional argument: 'enabled'


*** Error running postprocess_batch: C:\ai\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py
Traceback (most recent call last):
File "C:\ai\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
script.postprocess_batch(p, *script_args, images=images, **kwargs)
File "C:\ai\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 177, in postprocess_batch
if self.enable:
AttributeError: 'FaceSwapScript' object has no attribute 'enable'


*** Error running postprocess_image: C:\ai\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py
Traceback (most recent call last):
File "C:\ai\stable-diffusion-webui\modules\scripts.py", line 514, in postprocess_image
script.postprocess_image(p, pp, *script_args)
File "C:\ai\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 181, in postprocess_image
if self.enable and self.swap_in_generated:
AttributeError: 'FaceSwapScript' object has no attribute 'enable'


*** Error running postprocess: C:\ai\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
Traceback (most recent call last):
File "C:\ai\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess
script.postprocess(p, processed, *script_args)
TypeError: Script.postprocess() missing 1 required positional argument: 'enabled'


*** Error running postprocess: C:\ai\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\vae_optimize.py
Traceback (most recent call last):
File "C:\ai\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess
script.postprocess(p, processed, *script_args)
TypeError: Script.postprocess() missing 1 required positional argument: 'enabled'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Announcement documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests