civitai / sd_civitai_extension

All of the Civitai models inside Automatic 1111 Stable Diffusion Web UI
MIT License
2.34k stars 443 forks source link

Download paths #62

Open mw88-personal opened 1 year ago

mw88-personal commented 1 year ago

I have a problem with the download of "some" models from civitai, e.g. from "Photo_v1.1 - GalaxyTimeMachine's "ForYou-Photo" (https://civitai.com/api/download/models/67424?type=Model&format=SafeTensor&size=full&fp=fp32).

Console spits out the following error:

Traceback (most recent call last):
  File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1299, in process_api
    result = await self.call_function(
  File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1022, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\stable-diffusion-webui\extensions\sd-civitai-browser\scripts\civitai-api.py", line 204, in save_text_file
    os.makedirs(model_folder)
  File "C:\Program Files\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch: 'models/Stable-diffusion\\GalaxyTimeMachine\'s_"ForYou-Photo"'

Error is in German, I'm afraid, but the problem is most certainly due to illegal characters in the file name and path. I suggest to properly encode the names in a uniform minimal supported way for all operating systems and strip the illegal characters.

My OS is Windows 11, I'm running sd_civitai_extension on commit cc67adf8.