Tips/GenerativeAI/Stable Diffusion WebUI のバックアップソース(No.9)

#contents
----
* 概要 [#ff9346f0]
- StableDiffusionをローカル実行できる
- 最新の拡張なども積極的に取り込まれている
* 導入 [#e9b7bfe2]
- dockerリポジトリのclone
#geshi(bash){{
git clone https://github.com/AbdBarho/stable-diffusion-webui-docker.git
}}

- 起動オプションの変更

-- docker-compose.yml
#geshi{{
  auto: &automatic
    <<: *base_service
    profiles: ["auto"]
    build: ./services/AUTOMATIC1111
    image: sd-auto:51
    environment:
      - CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api <追加起動オプション>
      <追加オプション>
}}

-- 追加起動オプション
|オプション|概要|h
|--opt-sdp-attention||
|--opt-sdp-no-mem-attention||
|--xformers|xformersライブラリを使用する&br;再現性を犠牲に高速化&メモリ消費を低減できる|
|--xformers-flash-attention|promptの選別を行い、重要度が低いものを除外する&br;再現性が改善し更に高速化&メモリ消費を低減できる|
|--medvram|若干遅くなるがVRAM使用率を下げる&br;モデルをcond,1st-stage,unetの3つに分割する。&br;常に1つだけをVRAM上にロードし、それ以外はRAMに退避し省メモリ化する|
|--lowvram|遅くなるが更にVRAM使用率を下げる&br;--medvramに加えて、unetをさらに細かく分割する|
|--theme dark|UIテーマをダークテーマにする|

-- 追加オプション
|オプション|概要|h
|- TZ=Asia/Tokyo|ログやファイル名のタイムゾーンを日本時刻にする|

- dockerイメージのビルド
#geshi(bash){{
docker compose --profile download up --build
}}

- dockerイメージの起動
#geshi(bash){{
docker compose --profile auto up --build
}}

- アクセス
http://localhost:7860 にアクセスする
** 参照リンク [#d88e8a86]
- [[stable-diffusion-webui>https://github.com/AUTOMATIC1111/stable-diffusion-webui]]
--[[Command Line Arguments and Settings>https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings]]
- [[stable-diffusion-webui-docker>https://github.com/AbdBarho/stable-diffusion-webui-docker]]
- [[Stable Diffusion WebUI メモリ削減&高速化(VRAM6GB環境) >https://note.com/runo0044/n/n395e6ac18e09]]
* 拡張機能 [#j528e3b3]
* 使い方 [#oc18e0ff]
* Tips [#jefd1053]
* 参考リンク [#l7343052]