xyz_plot_script icon indicating copy to clipboard operation
xyz_plot_script copied to clipboard

[Support for Colab] FileNotFoundError: [Errno 2] No such file or directory

Open Arkanosmalkier opened this issue 3 years ago • 6 comments

Hello, The following error occurs whenever attempting to generate an image using your script: FileNotFoundError: [Errno 2] No such file or directory: 'outputs/txt2img-images\xyz\00000\index.html'

Details from the webui console: Traceback (most recent call last): File "C:\dif\stable-diffusion-webui-master\modules\ui.py", line 212, in f res = list(func(*args, **kwargs)) File "C:\dif\stable-diffusion-webui-master\webui.py", line 64, in f res = func(*args, **kwargs) File "C:\dif\stable-diffusion-webui-master\modules\txt2img.py", line 41, in txt2img processed = modules.scripts.scripts_txt2img.run(p, *args) File "C:\dif\stable-diffusion-webui-master\modules\scripts.py", line 162, in run processed = script.run(p, *script_args) File "C:\dif\stable-diffusion-webui-master\scripts\xyz_grid.py", line 363, in run processed = draw_xyz_grid( File "C:\dif\stable-diffusion-webui-master\scripts\xyz_grid.py", line 188, in draw_xyz_grid shutil.copy2('scripts/xyz_grid.template.html', os.path.join(web_path, 'index.html')) File "C:\Users\aurik\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 434, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "C:\Users\aurik\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 256, in copyfile with open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: 'outputs/txt2img-images\xyz\00000\index.html'

Arkanosmalkier avatar Oct 18 '22 06:10 Arkanosmalkier

Same issue, but the error here is:

FileNotFoundError: [Errno 2] No such file or directory: 'outputs/txt2img-images\\xyz\\00000\\index.html'

Additionally, 'Executing webui-user.bat file...' yields this error:

Error loading script: xyz_grid.py
Traceback (most recent call last):
  File "C:\Users\<username>\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\Text To Image\stable-diffusion-webui\modules\scripts.py", line 72, in load_scripts
    compiled = compile(text, path, 'exec')
  File "C:\Users\<username>\AppData\Roaming\Visions of Chaos\Examples\MachineLearning\Text To Image\stable-diffusion-webui\scripts\xyz_grid.py", line 188
    shutil.copy2('scripts\xyz_grid.template.html', os.path.join(web_path, 'index.html'))

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 7-8: truncated \xXX escape

therug avatar Oct 19 '22 09:10 therug

Can you please provide the following information:

  • Operating system version and type
  • Running locally or on a "colab" environment?
  • Version of AUTOMATIC1111's UI (you can find this by going to your WebUI base folder, opening a command prompt there, and running: git show --quiet --oneline)

zer0TF avatar Oct 20 '22 00:10 zer0TF

OS info: Windows 11 Home, Version 21H2 64bit Running locally Version of AUTOMATIC1111's UI: 7f8ab1e

Please let me know if you need additional info

Arkanosmalkier avatar Oct 20 '22 06:10 Arkanosmalkier

  • Operating system version and type

Microsoft Windows 10 Pro, 10.0.19044 Build 19044

  • Running locally or on a "colab" environment?

Locally, via Visions of Chaos's automatic1111 SD webui install

  • Version of AUTOMATIC1111's UI (you can find this by going to your WebUI base folder, opening a command prompt there, and running: git show --quiet --oneline)

7f8able (HEAD -> master, origin/master, origin/HEAD)

I think the second problem in my post (unicode error) is erroring because it is treating the '\U' in 'C:\Users' as the start of a unicode character. There are discussions of this on webui repo, e.g. here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1987 or maybe the string can be escaped to avoid.

therug avatar Oct 20 '22 07:10 therug

I've got a similar error when running the script via colab as well, all the images are generated but when the script is going to create the HTML visualization it yields this message and stop the process:

Error completing request
Arguments: ('anaisMitchell person portrait, very detailed painting by [Van Gogh: Monet: 0.95]', 'starry night, blur, deformed, mutant, bad anatomy, distorted, photo', 'None', 'None', 50, 0, False, False, 1, 1, 8.5, 2282058685.0, -1.0, 0, 0, 0, False, 704, 512, False, 0.7, 512, 704, 4, False, False, None, '', 1, '', 0, '', True, False, False, 5, '7,8,9,10,11', 9, '7427fd93, 0f9ffa39, cdb5a574, a68fe510, 736be93e, 81417e93, acc16700, 307f9a5a, fd17da24, e04cabd4, 068fdd47, 3b4d9ba9, a5b8f7d5, 28191597, dbb59a46, d122e9fa', 1, '2282058685, 2282058686, 786837865, 2842975558, 322643274, 1646118765, 627260684', False) {}
Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 212, in f
    res = list(func(*args, **kwargs))
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 63, in f
    res = func(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/txt2img.py", line 41, in txt2img
    processed = modules.scripts.scripts_txt2img.run(p, *args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 173, in run
    processed = script.run(p, *script_args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/scripts/xyz_grid.py", line 372, in run
    web_path=web_path
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/scripts/xyz_grid.py", line 188, in draw_xyz_grid
    shutil.copy2('scripts/xyz_grid.template.html', os.path.join(web_path, 'index.html'))
  File "/usr/lib/python3.7/shutil.py", line 266, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
**FileNotFoundError: [Errno 2] No such file or directory: 'scripts/xyz_grid.template.html'**

The colab I'm using is this one: https://github.com/TheLastBen/fast-stable-diffusion

igoralvarezz avatar Oct 21 '22 14:10 igoralvarezz

I did not build in explicit support for colab because I don't use colab, but if there's something easy that I can fix to make it work both on colab and on native PCs, then I would accept a PR for that.

zer0TF avatar Nov 12 '22 21:11 zer0TF