zb0419 / sd-webui-additional-networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional Networks for generating images

日本語の文章は下のほうにあります。

Change History is moved to the bottom of the page. 更新履歴はページ末尾に移しました。

Stable Diffusion web UI now seems to support LoRA trained by sd-scripts (SD 1.x based only). Thank you for great work!!!

About

This extension is for AUTOMATIC1111's Stable Diffusion web UI, allows the Web UI to add some networks (e.g. LoRA) to the original Stable Diffusion model to generate images. Currently LoRA is supported. The addition is on-the-fly, the merging is not required.

This extension supports the LoRA models (*.ckpt or *.safetensors) trained by our scripts in sd-scripts. The models from other LoRA implementations are not supported.

This extension does not support training.

Other networks other than LoRA may be supported in the future.

Installation

  1. Open "Extensions" tab.
  2. Open "Install from URL" tab in the tab.
  3. Enter URL of this repo to "URL for extension's git repository".
  4. Press "Install" button.
  5. Restart Web UI.

How to use

Put the LoRA models (*.pt, *.ckpt or *.safetensors) inside the sd-webui-additional-networks/models/LoRA folder.

Open "Additional Networks" panel from the left bottom of Web UI.

Press "Refresh models" to update the models list.

Select "LoRA" for "Network module 1".

Choose the name of the LoRA model file in "Model 1".

Set the weight of the model (negative weight might be working but unexpected.)

Repeat them for the module/model/weight 2 to 5 if you have other models. Models are applied in the order of 1 to 5.

You can generate images with the model with these additional networks.

X/Y plot

If you use LoRA models to plot, put the comma separated list of the model names into AddNet Model X

image

You can get the list of models with the button next to Values. Please select any model in Model ? at Additional Networks in order to make the button work. Models in the same folder as the model will be listed.

image

The metadata of the model can be drawn as legends. Move to Settings tab, select Additional Networks at left bottom, and set Metadata to show. Available values are in Network metadata textbox in Additional Networks tab.

image

この Web UI 拡張について

LoRA などのネットワークを元の Stable Diffusion に追加し、画像生成を行うための拡張です。現在は LoRA のみ対応しています。

この拡張で使えるのはsd-scriptsリポジトリで学習した LoRA のモデル(*.ckpt または *.safetensors)です。他の LoRA リポジトリで学習したモデルは対応していません。

この拡張単体では学習はできません。

将来的に LoRA 以外のネットワークについてもサポートするかもしれません。

インストール

  1. Web UI で "Extensions" タブを開きます。
  2. さらに "Install from URL" タブを開きます。
  3. "URL for extension's git repository" 欄にこのリポジトリの URL を入れます。
  4. "Install"ボタンを押してインストールします。
  5. Web UI を再起動してください。

使用法

学習した LoRA のモデル(*.pt, *.ckpt, *.safetensors)をsd-webui-additional-networks/models/LoRAに置きます。

Web UI の左下のほうの "Additional Networks" のパネルを開きます。

"Network module 1""LoRA" を選択してください。

"Refresh models" で LoRA モデルのリストを更新します。

"Model 1" に学習した LoRA のモデル名を選択します。

"Weight" にこのモデルの 重み を指定します(負の値も指定できますがどんな効果があるかは未知数です)。

追加のモデルがある場合は 2~5 に指定してください。モデルは 1~5 の順番で適用されます。

以上を指定すると、それぞれのモデルが適用された状態で画像生成されます。

X/Y plot

LoRAモデルをX/Y plotの値(選択対象)として使う場合は、カンマ区切りのモデルのリストを与える必要があります。

image

モデルのリストは選択肢の隣にあるボタンで取得できます。いずれかのモデルを Additional NetworksModel ? で選択しておいてください。そのモデルと同じフォルダにあるモデルの一覧が取得されます。

image

モデルのメタデータ(学習時のパラメータなど)をX/Y plotのラベルに使用できます。Web UI上部の Settings タブを開き、左下から Additional Networks を選び、 Metadata to show にカンマ区切りで項目名を指定してください(ss_learning_rate, ss_num_epochs のような感じになります)。使える値は Additional NetworksNetwork metadata 欄にある値です。

image

Change History

  • 15 Feb. 2023, 2023/2/15
    • Fix a bug that additional networks are applied twice when restarting UI.
    • Now the cover image is not copied with Copy metadata in the metadata editor because it takes time.
    • Allow additional networks to be swapped out between batches for other extensions.
    • Thanks to space-nuko!
    • 各ネットワークがWeb UIの再起動後に二重に適用された状態になるバグを修正しました。
    • メタデータエディタで Copy metadata ボタンでカバー画像をコピーしなくなりました(処理に時間が掛かるため)。
    • バッチごとにネットワークを切り替えられるようになりました(他の拡張からLoRAを切り替えられます)。
    • space-nuko氏に感謝します。
  • 12 Feb. 2023, 2023/2/12
    • Dataset folder structure is shown in the metadata editor. Thanks to space-nuko!
    • メタデータエディタにデータセットのフォルダ構成が表示されるようになりました。space-nuko氏に感謝します。
  • 10 Feb. 2023, 2023/2/10
    • Fixed a bug that crashes the metadata editor on some latest models.
    • 一部のモデルでメタデータエディタを開けない不具合を修正しました。
  • 3 Feb. 2023, 2023/2/3
    • Tag frequency in training is shown in Training info in Additional Network tab. Thanks to space-nuko!
    • 学習時のタグ頻度情報が Additional Network タブの Training info に表示されるようになりました。space-nuko氏に感謝します。
  • 2 Feb. 2023, 2023/2/2
    • This repo now has AGPL-3.0 license. Thanks to shirayu!
    • リポジトリにAGPL-3.0ライセンスが追加されました。取りまとめいただいたshirayu氏に感謝します。
  • 1 Feb. 2023, 2023/2/1
    • Add send to metadata editor button in Additional Network in txt2img and other tabs. Thanks to space-nuko!
    • txt2imgタブ等にメタデータエディタに送るボタンが付きました。space-nuko氏に感謝します。
  • 31 Jan. 2023, 2023/1/31
    • Metadata editor for LoRA models is now integrated in Additional Network tab. Documentation will be added later. Thanks to space-nuko!
    • LoRAモデル用のメタデータエディタ Additional Network タブに追加されました。ドキュメントはのちほど追加予定です。space-nuko氏に感謝します。

Please read Releases for recent updates. 最近の更新情報は Release をご覧ください。

About

License:GNU Affero General Public License v3.0


Languages

Language:Python 97.6%Language:JavaScript 1.7%Language:CSS 0.7%