AlUlkesh / stable-diffusion-webui-images-browser

an images browse for stable-diffusion-webui
623 stars 111 forks source link

Delete image - error #221

Closed wknudsen closed 1 year ago

wknudsen commented 1 year ago

When clicking the Delete button I get an error. Verified on two different clean installations of A1111 1.5.1 and Image Browser Jul 31 version.

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1323, in process_api result = await self.call_function( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, *args) File "/workspace/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser/scripts/image_browser.py", line 412, in delete_image delete_recycle(filenames[i]) File "/workspace/sd/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser/scripts/image_browser.py", line 235, in delete_recycle send2trash(filename) File "/usr/local/lib/python3.10/dist-packages/send2trash/plat_gio.py", line 22, in send2trash raise TrashPermissionError("") send2trash.exceptions.TrashPermissionError: [Errno 13] Permission denied: ''

AlUlkesh commented 1 year ago

Let's see. Can you answer these questions first?

  1. Which OS are you using?
  2. Is this a local file or on a network drive?
  3. Can you delete the file manually, without getting the permission error?
wknudsen commented 1 year ago
  1. It's Linux, on a Runpod run Jupyter notebook. Delete has worked in this environment on a previous version last I tried a month or 2 ago.
  2. The file is local seen from the installation's point of view.
  3. I can delete it manually without any errors, from a terminal or the Jupyter file manager.
AlUlkesh commented 1 year ago

I see. It's hard for me to tell what does or does not work in that particular environment. It's possible there are further permissions necessary to move files to a system trashcan.

Best suggestion I have currently is to deactivate the trashcan in the Image Browser Settings and let the program do a direct delete:

image

wknudsen commented 1 year ago

Delete works with the recycle bin disabled, thanks for the suggestion.

wknudsen commented 1 year ago

... and thank you for a marvellous extension, it's about the first one I install on a new server.

AlUlkesh commented 1 year ago

Thank you.