sd-webui-controlnet icon indicating copy to clipboard operation
sd-webui-controlnet copied to clipboard

[Bug]: Error FileNotFoundError: [Errno 2] No such file or directory

Open jakemengers opened this issue 2 years ago • 9 comments
trafficstars

Is there an existing issue for this?

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

What happened?

I am using Controlnet 274dd5df latest update through Auto1111

I get this error message... on all models

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\extensions\sd-webui-controlnet\models\cldm_v15.yaml'

N.B I was also getting this with previous version before latest update today

Seems to be looking for a .yaml file in the wrong place???

Steps to reproduce the problem

  1. Txt2img default settings, insert prompt
  2. generate image
  3. insert seed number to test if image changes when controlnet enabled
  4. enable controlnet, if tested canny/depth/openpose
  5. insert image in controlnet window
  6. generate
  7. check command window for this error

What should have happened?

On a previous version I had it working as follows If I generate the image in txt2img then use that seed it will not change if controlnet is having no effect If controlnet is working the image will change according to the guidance values

If controlnet not working the image will be exactly the same as befor eit was enabled

Commit where the problem happens

webui: dfeee786f903e392dbef1519c7c246b9856ebab3 controlnet: 274dd5df

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --no-half --theme dark

Console logs

venv "C:\Users\jakem\stable-diffusion-webui_TEST\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)]
Commit hash: dfeee786f903e392dbef1519c7c246b9856ebab3
Installing requirements for Web UI

Launching Web UI with arguments: --xformers --no-half --theme dark
Loading weights [1254103966] from C:\Users\jakem\stable-diffusion-webui_TEST\models\Stable-diffusion\protogenV22Anime_22.safetensors
Creating model from config: C:\Users\jakem\stable-diffusion-webui_TEST\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 2.7s (load weights from disk: 0.1s, create model: 0.4s, apply weights to model: 0.6s, move model to device: 0.8s, load textual inversion embeddings: 0.8s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 13.1s (import gradio: 2.9s, import ldm: 1.5s, other imports: 3.4s, list extensions: 0.1s, setup codeformer: 0.1s, load scripts: 1.1s, load SD checkpoint: 3.0s, create ui: 0.9s, gradio launch: 0.1s).

Closing server running on port: 7860
Restarting UI...
*Deforum ControlNet support: enabled*
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 6.2s (list extensions: 0.2s, load scripts: 0.3s, create ui: 5.5s).
Loading weights [cc6cb27103] from C:\Users\jakem\stable-diffusion-webui_TEST\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt
Creating model from config: C:\Users\jakem\stable-diffusion-webui_TEST\models\Stable-diffusion\v1-5-pruned-emaonly.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Model loaded in 1.7s (create model: 0.4s, apply weights to model: 0.4s, move model to device: 1.0s).
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.97it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.80it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.43it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00,  3.47it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.84it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.77it/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.80it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.85it/s]
Loading model: control_sd15_canny [fef5e48e]█████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  5.06it/s]
Loaded state_dict from [C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\models\control_sd15_canny.pth]
Error running process: C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py
Traceback (most recent call last):
  File "C:\Users\jakem\stable-diffusion-webui_TEST\modules\scripts.py", line 409, in process
    script.process(p, *script_args)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 742, in process
    model_net = self.load_control_model(p, unet, model, lowvram)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 541, in load_control_model
    model_net = self.build_control_model(p, unet, model, lowvram)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 579, in build_control_model
    network = network_module(
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\cldm.py", line 63, in __init__
    config = OmegaConf.load(config_path)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\venv\lib\site-packages\omegaconf\omegaconf.py", line 187, in load
    with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\jakem\\stable-diffusion-webui_TEST\\extensions\\sd-webui-controlnet\\extensions\\sd-webui-controlnet\\models\\cldm_v15.yaml'

100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:08<00:00,  2.38it/s]
Total progress: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:07<00:00,  2.76it/s]
Loading model: control_sd15_depth [fef5e48e]█████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:07<00:00,  4.90it/s]
Loaded state_dict from [C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\models\control_sd15_depth.pth]
Error running process: C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py
Traceback (most recent call last):
  File "C:\Users\jakem\stable-diffusion-webui_TEST\modules\scripts.py", line 409, in process
    script.process(p, *script_args)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 742, in process
    model_net = self.load_control_model(p, unet, model, lowvram)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 541, in load_control_model
    model_net = self.build_control_model(p, unet, model, lowvram)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\controlnet.py", line 579, in build_control_model
    network = network_module(
  File "C:\Users\jakem\stable-diffusion-webui_TEST\extensions\sd-webui-controlnet\scripts\cldm.py", line 63, in __init__
    config = OmegaConf.load(config_path)
  File "C:\Users\jakem\stable-diffusion-webui_TEST\venv\lib\site-packages\omegaconf\omegaconf.py", line 187, in load
    with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\jakem\\stable-diffusion-webui_TEST\\extensions\\sd-webui-controlnet\\extensions\\sd-webui-controlnet\\models\\cldm_v15.yaml'

Additional information

No response

jakemengers avatar Mar 14 '23 11:03 jakemengers

Can you check the that the path in webui settings does not contain double backslashes \\? Not sure why the yaml path seems to have double backslashes.

ljleb avatar Mar 15 '23 03:03 ljleb

There are no double backslashes in the webui settings. The problem has stopped occurring since I updated to later version

Jake Mengers www.bruvva.com +44(0)7976253980 On 15 March 2023 03:34:49 ljleb @.***> wrote:

Can you check the that the path in webui settings does not contain double backslashes \? Not sure why the paths seem to have double backslashes.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

jakemengers avatar Mar 15 '23 07:03 jakemengers

I have the same problem, this because the path is written fixed, so change fake dir in the config.json to the real dir in the web UI root dir, like this: config.json:

"control_net_model_config": "S:/01code/stable_diff/stable-diffusion-webui-master/extensions/sd-webui-controlnet/models/cldm_v15.yaml",
"control_net_model_adapter_config": "S:/01code/stable_diff/stable-diffusion-webui-master/extensions/sd-webui-controlnet/models/sketch_adapter_v14.yaml",

huohuaqi avatar Mar 22 '23 08:03 huohuaqi

I must have a critter in my PC that change shit around last time I touched CN it was working and now it was missing .yaml

if-ai avatar Mar 23 '23 12:03 if-ai

I tried what you suggested but then I can't load automatic1111 and get this..

Traceback (most recent call last): File "C:\AI\stable-diffusion-webui\launch.py", line 381, in start() File "C:\AI\stable-diffusion-webui\launch.py", line 372, in start import webui File "C:\AI\stable-diffusion-webui\webui.py", line 28, in from modules import extra_networks, ui_extra_networks_checkpoints File "C:\AI\stable-diffusion-webui\modules\ui_extra_networks_checkpoints.py", line 5, in from modules import shared, ui_extra_networks, sd_models File "C:\AI\stable-diffusion-webui\modules\shared.py", line 665, in opts.load(config_filename) File "C:\AI\stable-diffusion-webui\modules\shared.py", line 602, in load self.data = json.load(file) File "C:\Users\seans\AppData\Local\Programs\Python\Python310\lib\json_init_.py", line 293, in load return loads(fp.read(), File "C:\Users\seans\AppData\Local\Programs\Python\Python310\lib\json_init_.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\seans\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\seans\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 148 column 36 (char 5392) Press any key to continue . . .

skullzy77 avatar Mar 25 '23 01:03 skullzy77

First time trying this extension and I get this same error in Brave & Chrome * even tried a clean reinstall of ControlNet with same error

Startup time: 7.3s (load scripts: 0.4s, create ui: 2.6s, gradio launch: 4.2s). Loading model: control_sd15_canny [fef5e48e] Loaded state_dict from [D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\models\control_sd15_canny.pth] Error running process: D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py Traceback (most recent call last): File "D:\Stable Difussion\stable-diffusion-webui\modules\scripts.py", line 417, in process script.process(p, *script_args) File "D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 679, in process model_net = self.load_control_model(p, unet, unit.model, unit.low_vram) File "D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 468, in load_control_model model_net = self.build_control_model(p, unet, model, lowvram) File "D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 510, in build_control_model network = network_module( File "D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\cldm.py", line 63, in init config = OmegaConf.load(config_path) File "D:\Stable Difussion\stable-diffusion-webui\venv\lib\site-packages\omegaconf\omegaconf.py", line 187, in load with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: 'D:\Stable Difussion\stable-diffusion-webui\extensions\sd-webui-controlnet\Models\cldm_sd15.yaml'

ScArecrow23 avatar Mar 27 '23 13:03 ScArecrow23

The same problem, there are files on this path.

Loaded state_dict from [/home/mihas/stable-diffusion-webui/models/ControlNet/control_openpose-fp16.safetensors]
Error running process: /home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py
Traceback (most recent call last):
  File "/home/mihas/stable-diffusion-webui/modules/scripts.py", line 417, in process
    script.process(p, *script_args)
  File "/home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 680, in process
    model_net = self.load_control_model(p, unet, unit.model, unit.low_vram)
  File "/home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 469, in load_control_model
    model_net = self.build_control_model(p, unet, model, lowvram)
  File "/home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/controlnet.py", line 511, in build_control_model
    network = network_module(
  File "/home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/cldm.py", line 63, in __init__
    config = OmegaConf.load(config_path)
  File "/home/mihas/anaconda3/envs/automatic/lib/python3.10/site-packages/omegaconf/omegaconf.py", line 187, in load
    with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/mihas/stable-diffusion-webui/extensions/sd-webui-controlnet/models\\cldm_v15.yaml'
~/stable-diffusion-webui/extensions/sd-webui-controlnet/models$ ls 
cldm_v15.yaml  image_adapter_v14.yaml   t2iadapter_color_sd14v1.yaml    t2iadapter_style_sd14v1.yaml
cldm_v21.yaml  sketch_adapter_v14.yaml  t2iadapter_keypose_sd14v1.yaml

In config.json

    "control_net_model_config": "models\\cldm_v15.yaml",
    "control_net_model_adapter_config": "models\\sketch_adapter_v14.yaml",
    "control_net_detectedmap_dir": "detected_maps",
    "control_net_models_path": "",
    "control_net_max_models_num": 6,
    "control_net_model_cache_size": 3,
    "control_net_control_transfer": false,
    "control_net_no_detectmap": false,
    "control_net_detectmap_autosaving": false,
    "control_net_only_midctrl_hires": true,
    "control_net_allow_script_control": true,
    "control_net_skip_img2img_processing": false,
    "control_net_monocular_depth_optim": false,
    "control_net_only_mid_control": false,
    "control_net_cfg_based_guidance": false,
    "disable_all_extensions": "none",

what needs to be done to make it work?

mihas2 avatar Apr 11 '23 17:04 mihas2

Replacing backslashes \\ with forward slashes / should at least help fix one of the issues you are encountering. Unix path separators are not the same as windows path separators.

ljleb avatar Apr 11 '23 19:04 ljleb

Replacing backslashes \\ with forward slashes / should at least help fix one of the issues you are encountering. Unix path separators are not the same as windows path separators.

Exactly, thanks!)

mihas2 avatar Apr 11 '23 19:04 mihas2