見出し画像

PaperspaceでAUTOMATIC1111/stable-diffusion-webui v1.6が動かなくなった対応

エラー発生状況


PaperspaceでAUTOMATIC1111/stable-diffusion-webui v1.6 を動かして画像生成しています。今朝(2023/11/4)、いつものように起動しようとしたところ、以下のエラーとなり、起動しなくなりました。ログの終わり辺りは以下のようです。

/notebooks/stable-diffusion-webui
Python 3.10.13 (main, Aug 25 2023, 13:20:03) [GCC 9.4.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Installing xformers
Launching Web UI with arguments: --xformers --enable-insecure-extension-access --share --gradio-queue --reinstall-xformers
Traceback (most recent call last):
  File "/notebooks/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/notebooks/stable-diffusion-webui/launch.py", line 44, in main
    start()
  File "/notebooks/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
    import webui
  File "/notebooks/stable-diffusion-webui/webui.py", line 13, in <module>
    initialize.imports()
  File "/notebooks/stable-diffusion-webui/modules/initialize.py", line 21, in imports
    import gradio  # noqa: F401
  File "/usr/local/lib/python3.10/dist-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/annotated_image.py", line 12, in <module>
    from gradio import utils
  File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 353, in <module>
    class AsyncRequest:
  File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 372, in AsyncRequest
    client = httpx.AsyncClient()
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1397, in __init__
    self._transport = self._init_transport(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1445, in _init_transport
    return AsyncHTTPTransport(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_transports/default.py", line 275, in __init__
    self._pool = httpcore.AsyncConnectionPool(
TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'

どうしたのでしょうか。Bardに聞いてみたところ、『a mismatch between the versions of `gradio` and `httpcore`』らしいようです。以下は回答の全文です。

The error message "TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'" means that the `gradio` package is trying to initialize an `httpcore.AsyncConnectionPool` object with a keyword argument that is not supported. This is likely due to a bug in the `gradio` package or a mismatch between the versions of `gradio` and `httpcore` that are installed.

There are a few things you can try to fix this error:

1. **Update your `gradio` package.** The latest version of `gradio` may have fixed the bug that is causing this error. To update `gradio`, run the following command:

"
pip install --upgrade gradio
"

2. **Downgrade your `httpcore` package.** If you are using a newer version of `httpcore` than what `gradio` is compatible with, you can try downgrading `httpcore` to a previous version. To downgrade `httpcore`, run the following command:

"
pip install httpcore==0.13.10
"

3. **Use a different HTTP client library.** If you are unable to fix the error by updating or downgrading your packages, you can try using a different HTTP client library, such as `aiohttp` or `requests`. To do this, you will need to modify the `gradio` code to use the different HTTP client library.

If you are still unable to fix the error, you can report it to the `gradio` developers.

Here are some additional tips for troubleshooting this error:

* Make sure that you have the latest version of Python installed.
* Try restarting your computer.
* Check the `gradio` documentation for more information on troubleshooting errors.

I hope this helps!

gradio のバージョンを上げるか、httpcoreのバージョンを下げろとのことです。
再起動したり、マシンを変えたりしても復旧しませんでした。

対処

stable-diffusion-webuiのバージョンを上げたら直るかも。以下実施しました。

#(4) AUTOMATIC1111アップデート(アップデートが必要な時のみ実行)

%cd /notebooks/stable-diffusion-webui
!git checkout master
!git pull

​>>結果
/notebooks/stable-diffusion-webui
Already on 'master'
Your branch is up to date with 'origin/master'.
remote: Enumerating objects: 94, done.
remote: Counting objects: 100% (94/94), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 94 (delta 54), reused 68 (delta 38), pack-reused 0
Unpacking objects: 100% (94/94), 71.61 KiB | 198.00 KiB/s, done.
From https://github.com/AUTOMATIC1111/stable-diffusion-webui
   5ef669de..4afaaf8a  master     -> origin/master
   464fbcd9..452ab8fe  dev        -> origin/dev
   5f9ddfa4..ddc2a349  test-fp8   -> origin/test-fp8
Updating 5ef669de..4afaaf8a
Fast-forward
 CHANGELOG.md              | 5 +++++
 requirements_versions.txt | 1 +
 2 files changed, 6 insertions(+)

その後、エラー解消して、起動しました。バージョンが v1.6.0-2-g4afaaf8a
に上がっていました。

起動後の画面。バージョンが上がった。

stable-diffusion-webui の CHANGELOG にも、同様の記載がありました。

CHANGELOG.md

無事生成できるようになりました!生成したPNGファイルにも、" Version: v1.6.0-2-g4afaaf8a"と記録されます。

Text string: masterpiece, ultra high res, absurdres, A beautiful young fashion model , detailed face, looking at viewer,smiling, (zip-up hoodie over a basic T-shirt:1.2), (skinny jeans, sneakers:1.2), She has medium-length, straight hair and a natural makeup, She also wears small earrings and a simple necklace and bracelet, (hip hop dancing:1.3), on the street, <lora:v2_lora_PanLeft:0.8> Negative prompt: (worst quality:2), (nsfw:2), (nipples:2), bradhands, (worst quality, low quality:2), (undressing:1.5), (long neck:2), (depth of field, bokeh, blurry, blurry background:1.4),man Steps: 50, Sampler: DPM++ 3M SDE Exponential, CFG scale: 6.5, Seed: 2502209034, Size: 512x768, Model hash: c8322011da, Model: _BlazingRealDrive_V02h, VAE hash: 551eac7037, VAE: vae-ft-mse-840000-ema-pruned.safetensors, Denoising strength: 0.45, Clip skip: 2, Hires upscale: 1.5, Hires steps: 20, Hires upscaler: R-ESRGAN 4x+, Lora hashes: "v2_lora_PanLeft: ed79025f8bea", Version: v1.6.0-2-g4afaaf8a


この記事が気に入ったらサポートをしてみませんか?