jquesnelle / txt2imghd

A port of GOBIG for Stable Diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows 10: FileNotFoundError: [WinError 2] The system cannot find the file specified

Amdersiteen opened this issue · comments

Traceback (most recent call last):
  File "scripts/txt2imghd.py", line 549, in <module>
    main()
  File "scripts/txt2imghd.py", line 365, in main
    text2img2(opt)
  File "scripts/txt2imghd.py", line 476, in text2img2
    realesrgan2x(opt.realesrgan, os.path.join(sample_path, f"{base_filename}.png"), os.path.join(sample_path, f"{base_filename}u.png"))
  File "scripts/txt2imghd.py", line 368, in realesrgan2x
    process = subprocess.Popen([
  File "C:\Users\user\miniconda3\envs\ldm\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\user\miniconda3\envs\ldm\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Reference to #27
I'm having the same issue instead I do use the right realesrgan-ncnn-vulkan folder for windows.
No specific file is mentioned in the error prompt and there is no indication on what files need to be in the realesrgan-ncnn-vulkan folder in order to work properly.

What may I have missed?

Alright I unzipped the full folder to my stable diffusion folder.
After reading the documentation on subprocess.Popen I realized it need the path to the executable but I feeded it the folder path by default.

For those who might have done the same:
I just changed the

 parser.add_argument(
        "--realesrgan",
        type=str,
        default="realesrgan-ncnn-vulkan",
        help="path to realesrgan executable"
    )

option to:

parser.add_argument(
        "--realesrgan",
        type=str,
        default="realesrgan-ncnn-vulkan/realesrgan-ncnn-vulkan.exe",
        help="path to realesrgan executable"
    )