zixaphir / Stable-Diffusion-Webui-Civitai-Helper

Stable Diffusion Webui Extension for Civitai, to manage your model much more easily.
175 stars 24 forks source link

After the update, an error message is displayed, indicating that the CIVIT server cannot be connected to obtain image information about the model #29

Closed xiodf3 closed 8 months ago

xiodf3 commented 8 months ago

File "E:\sd-webui-aki-v4.4\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\downloader.py", line 23, in request_get request = requests.get( File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\api.py", line 76, in get return request('get', url, params=params, kwargs) File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, kwargs) File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

Is it a setup problem? Or the environment? I can only use the reduced version, but it is a little too troublesome. Is there any other way to solve this error?

zixaphir commented 8 months ago

I have to look into this but I will try to get back to you soon

zixaphir commented 8 months ago

I tried looking into this but without more information, I can't be sure what the exact cause is. I'm going to be updating the extension soon with a lot of changes to the underlying downloader code, and hopefully that will resolve it if it's an issue with the current code

mageofthesands commented 8 months ago

Yeah, I'm getting an error too. It might be related to this.

Civitai Helper: Checking preview image for model: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\synthwavepunk_v2.ckpt
Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Creating model info for: warthunderStyle_v15.ckpt
Civitai Helper: Using SD Webui SHA256
ERROR:asyncio:Exception in callback H11Protocol.timeout_keep_alive_handler()
handle: <TimerHandle when=1373887.687 H11Protocol.timeout_keep_alive_handler()>
Traceback (most recent call last):
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_state.py", line 249, in _fire_event_triggered_transitions
    new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Mots\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 363, in timeout_keep_alive_handler
    self.conn.send(event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 468, in send
    data_list = self.send_with_data_passthrough(event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 493, in send_with_data_passthrough
    self._process_event(self.our_role, event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 242, in _process_event
    self._cstate.process_event(role, type(event), server_switch_event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_state.py", line 238, in process_event
    self._fire_event_triggered_transitions(role, event_type)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_state.py", line 251, in _fire_event_triggered_transitions
    raise LocalProtocolError(
h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
Calculating sha256 for H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.ckpt: e1be07db82390c5bf3722bf65a64e6182a1777e6a84c155169aefa076af60014
Civitai Helper: Request model info from civitai
Civitai Helper: Fetching Parent Model Information
Civitai Helper: Request model info from civitai: 175434
Civitai Helper: Write model civitai info to file: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.civitai.info
Civitai Helper: Write model SD webui info to file: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.json
Civitai Helper: Write model webui info to file: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.json
Civitai Helper: delay: 0.2 second
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.ckpt
Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ff0c366a-a4f3-4248-8760-5155801f2b6c/width=1024/3139530.jpeg
Civitai Helper: Target file path: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.preview.png
Civitai Helper: File size: 146358
Civitai Helper: Downloading to temp file: H:\stable-diffusion-webui-directml\models\Stable-diffusion\Styles\warthunderStyle_v15.preview.png.downloading
  0%|                                                                                    | 0.00/143k [00:00<?, ?iB/s]*** API error: POST: http://127.0.0.1:7860/api/predict {'error': 'LocalProtocolError', 'detail': '', 'body': '', 'errors': "Can't send data when our state is ERROR"}
    Traceback (most recent call last):
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
        await self.app(scope, receive, _send)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 109, in __call__
        await response(scope, receive, send)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 270, in __call__
        async with anyio.create_task_group() as task_group:
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 597, in __aexit__
        raise exceptions[0]
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
        await func()
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
        return await super().stream_response(send)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
        await send(
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
        await send(message)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
        output = self.conn.send(event=response)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 468, in send
        data_list = self.send_with_data_passthrough(event)
      File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 483, in send_with_data_passthrough
        raise LocalProtocolError("Can't send data when our state is ERROR")
    h11._util.LocalProtocolError: Can't send data when our state is ERROR

---
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 109, in __call__
    await response(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 270, in __call__
    async with anyio.create_task_group() as task_group:
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 597, in __aexit__
    raise exceptions[0]
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
    await func()
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
    return await super().stream_response(send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
    await send(
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
    await send(message)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
    output = self.conn.send(event=response)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 468, in send
    data_list = self.send_with_data_passthrough(event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 483, in send_with_data_passthrough
    raise LocalProtocolError("Can't send data when our state is ERROR")
h11._util.LocalProtocolError: Can't send data when our state is ERROR
'AsyncRequest' object has no attribute '_json_response_data
xiodf3 commented 8 months ago

I used your updated version and now it works! Thank you very much!

zixaphir commented 8 months ago

Yeah, I'm getting an error too. It might be related to this.

This is a separate issue and should be tracked here: https://github.com/zixaphir/Stable-Diffusion-Webui-Civitai-Helper/issues/39