BlafKing / sd-civitai-browser-plus

Extension to access CivitAI via WebUI: download, delete, scan for updates, list installed models, assign tags, and boost downloads with multi-threading.
GNU Affero General Public License v3.0
309 stars 53 forks source link

search fail #128

Closed lvyadong199997 closed 10 months ago

lvyadong199997 commented 10 months ago

Describe the bug.

1702098014157

Steps to reproduce the problem.

opening stable diffusion and want to search

Expected behavior

ERROR

System info

Console logs

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1435, in process_api
    result = await self.call_function(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1107, 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 "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 509, in update_model_list
    gl.json_data = api_to_data(content_type, sort_type, period_type, use_search_term, current_page, base_filter, only_liked, search_term, nsfw, timeOut, isNext)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 208, in api_to_data
    data = request_civit_api(full_url)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 1062, in request_civit_api
    'User-Agent': UserAgent().chrome,
NameError: name 'UserAgent' is not defined
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1435, in process_api
    result = await self.call_function(
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1107, 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 "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 509, in update_model_list
    gl.json_data = api_to_data(content_type, sort_type, period_type, use_search_term, current_page, base_filter, only_liked, search_term, nsfw, timeOut, isNext)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 208, in api_to_data
    data = request_civit_api(full_url)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_api.py", line 1062, in request_civit_api
    'User-Agent': UserAgent().chrome,
NameError: name 'UserAgent' is not defined

Additional information

No response

lvyadong199997 commented 10 months ago

CivitAI Browser+: Python module 'ZipUnicode' has not been imported correctly, please try to restart or install it manually. CivitAI Browser+: Python module 'fake_useragent' has not been imported correctly, please try to restart or install it manually. CivitAI Browser+: Aria2 RPC restarted CivitAI Browser+: Python module 'fake_useragent' has not been imported correctly, please try to restart or install it manually. CivitAI Browser+: Python module 'ZipUnicode' has not been imported correctly, please try to restart or install it manually. CivitAI Browser+: Python module 'fake_useragent' has not been imported correctly, please try to restart or install it manually.

lvyadong199997 commented 10 months ago

I use pip install fake-useragent,and it works

BlafKing commented 10 months ago

It looks like the automatic package installing of SD-WebUI has failed for you, usually SD-WebUI should fetch all the required packages before starting the application.

I see you've already installed fake user agent. To have full compatibility, please install all the package from the logs manually.

So in case you haven't yet, also install: pip install ZipUnicode

I'll close this issue, since the issue seems to be in SD-WebUI