(Writing this up on mobile atm, sorry for any bad formatting)
Hi, when trying to grab tags from a Danbooru post, I get the following error in the console after the extension fails to grab the tags:
Traceback (most recent call last):
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 284, in run_
predict
output = await app.blocks.process_api(
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 982, in proc
ess_api
result = await self.call_function(fn_index, inputs, iterator)
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 824, in call
_function
prediction = await anyio.to_thread.run_sync(
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run
_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 9
37, in run_sync_in_worker_thread
return await future
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 8
67, in run
result = context.run(func, *args)
File "/run/media/renny/Sabrent Rocket 4/Users/renny/source/diffusing/stable-diff
usion-webui/extensions/booru2prompt/scripts/main.py", line 287, in grabtags
urlretrieve(imageurl, edirectory + "tempimages\\temp.jpg")
File "/usr/lib/python3.10/urllib/request.py", line 251, in urlretrieve
tfp = open(filename, 'wb')
OSError: [Errno 22] Invalid argument: '/run/media/renny/Sabrent Rocket 4/Users/ren
al/source/diffusing/stable-diffusion-webui/extensions/booru2prompt/tempimages\\tem
p.jpg'
I think this may be caused by the \\ in the file path for the temp image, as the urlretrieve(imageurl, edirectory + "tempimages\\temp.jpg") seems to be creating an invalid path (double backslashes being a Windows thing?). Could this be resolved by using something like os.path.join(edirectory, "tempimages", "temp.jpg") to create a platform independent path?
(Writing this up on mobile atm, sorry for any bad formatting)
Hi, when trying to grab tags from a Danbooru post, I get the following error in the console after the extension fails to grab the tags:
I think this may be caused by the
\\
in the file path for the temp image, as theurlretrieve(imageurl, edirectory + "tempimages\\temp.jpg")
seems to be creating an invalid path (double backslashes being a Windows thing?). Could this be resolved by using something likeos.path.join(edirectory, "tempimages", "temp.jpg")
to create a platform independent path?