sunnyark / civitai-shortcut

140 stars 13 forks source link

can´t download user generated image from the galerie #31

Closed JasonKillsUs closed 1 year ago

JasonKillsUs commented 1 year ago

since today i get an error when i try to download from the user galerie_tab:

"Traceback (most recent call last): File "S:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "S:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api result = await self.call_function( File "S:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function prediction = await anyio.to_thread.run_sync( File "S:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "S:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "S:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, *args) File "S:\stable-diffusion-webui\extensions\civitai-shortcut\scripts\civitai_manager_libs\civitai_gallery_action.py", line 359, in on_usergal_page_url_change return load_gallery_page(usergal_page_url) File "S:\stable-diffusion-webui\extensions\civitai-shortcut\scripts\civitai_manager_libs\civitai_gallery_action.py", line 419, in load_gallery_page page_info, image_url, images_meta = get_gallery_information(usergal_page_url, False) File "S:\stable-diffusion-webui\extensions\civitai-shortcut\scripts\civitai_manager_libs\civitai_gallery_action.py", line 444, in get_gallery_information page_info, images_url, images_meta , images_list = get_user_gallery(modelid, page_url, show_nsfw) File "S:\stable-diffusion-webui\extensions\civitai-shortcut\scripts\civitai_manager_libs\civitai_gallery_action.py", line 453, in get_user_gallery page_info , image_data = get_image_page(modelid, page_url, show_nsfw) File "S:\stable-diffusion-webui\extensions\civitai-shortcut\scripts\civitai_manager_libs\civitai_gallery_action.py", line 510, in get_image_page page_info['totalItems'] = json_data['metadata']['totalItems'] KeyError: 'totalItems'"

the rest seems to work fine: version: [v1.4.0] •  python: 3.10.11  •  torch: 2.0.1+cu118  •  xformers: 0.0.17  •  gradio: 3.32.0  •  checkpoint: [297006f398] win10pro/firefox

thanks for looking into it.

aijpcs commented 1 year ago

It seems to be a Civitai update agreement, so it is not possible to download. At the same time, it is suggested that once the user's gallery has been downloaded, it should not be loaded from Civitai anymore, but directly from the hard drive. This can greatly save network resources and provide a better experience for users who need to use proxies.

sunnyark commented 1 year ago

@JasonKillsUs The parameters related to user images are being provided differently than what was announced in the updated API by Civitai. It is necessary to confirm if this is a temporary error. Obtaining the total number of pages is crucial for our needs, so it seems that some time will be required for the necessary modifications. We will strive to make the necessary corrections as quickly as possible.

JasonKillsUs commented 1 year ago

i did suspected a change of the api, thanks a ton for the info .

sunnyark commented 1 year ago

@JasonKillsUs @aijpcs I have made modifications to the user gallery in accordance with the changes in the civitai image API.

aijpcs commented 1 year ago

OK, thanks