Releases: kohya-ss/sd-scripts
Version 0.7.1
Dec 24, 2023 / 2023/12/24
-
Fixed to work
tools/convert_diffusers20_original_sd.py
. Thanks to Disty0! PR #1016 -
tools/convert_diffusers20_original_sd.py
が動かなくなっていたのが修正されました。Disty0 氏に感謝します。 PR #1016
Dec 21, 2023 / 2023/12/21
-
The issues in multi-GPU training are fixed. Thanks to Isotr0py! PR #989 and #1000
--ddp_gradient_as_bucket_view
and--ddp_static_graph
options are added tosdxl_train.py
. Please specify these options for multi-GPU training.
-
IPEX support is updated. Thanks to Disty0!
-
Fixed the bug that the size of the bucket becomes less than
min_bucket_reso
. Thanks to Cauldrath! PR #1008 -
--sample_at_first
option is added to each training script. This option is useful to generate images at the first step, before training. Thanks to shirayu! PR #907 -
--ss
option is added to the sampling prompt in training. You can specify the scheduler for the sampling like--ss euler_a
. Thanks to shirayu! PR #906 -
keep_tokens_separator
is added to the dataset config. This option is useful to keep (prevent from shuffling) the tokens in the captions. See #975 for details. Thanks to Linaqruf!- You can specify the separator with an option like
--keep_tokens_separator "|||"
or withkeep_tokens_separator: "|||"
in.toml
. The tokens before|||
are not shuffled.
- You can specify the separator with an option like
-
Attention processor hook is added. See #961 for details. Thanks to rockerBOO!
-
The optimizer
PagedAdamW
is added. Thanks to xzuyn! PR #955 -
NaN replacement in SDXL VAE is sped up. Thanks to liubo0902! PR #1009
-
Fixed the path error in
finetune/make_captions.py
. Thanks to CjangCjengh! PR #986 -
マルチGPUでの学習の不具合を修正しました。Isotr0py 氏に感謝します。 PR #989 および #1000
sdxl_train.py
に--ddp_gradient_as_bucket_view
と--ddp_bucket_view
オプションが追加されました。マルチGPUでの学習時にはこれらのオプションを指定してください。
-
IPEX サポートが更新されました。Disty0 氏に感謝します。
-
Aspect Ratio Bucketing で bucket のサイズが
min_bucket_reso
未満になる不具合を修正しました。Cauldrath 氏に感謝します。 PR #1008 -
各学習スクリプトに
--sample_at_first
オプションが追加されました。学習前に画像を生成することで、学習結果が比較しやすくなります。shirayu 氏に感謝します。 PR #907 -
学習時のプロンプトに
--ss
オプションが追加されました。--ss euler_a
のようにスケジューラを指定できます。shirayu 氏に感謝します。 PR #906 -
データセット設定に
keep_tokens_separator
が追加されました。キャプション内のトークンをどの位置までシャッフルしないかを指定できます。詳細は #975 を参照してください。Linaqruf 氏に感謝します。- オプションで
--keep_tokens_separator "|||"
のように指定するか、.toml
でkeep_tokens_separator: "|||"
のように指定します。|||
の前のトークンはシャッフルされません。
- オプションで
-
Attention processor hook が追加されました。詳細は #961 を参照してください。rockerBOO 氏に感謝します。
-
オプティマイザ
PagedAdamW
が追加されました。xzuyn 氏に感謝します。 PR #955 -
学習時、SDXL VAE で NaN が発生した時の置き換えが高速化されました。liubo0902 氏に感謝します。 PR #1009
-
finetune/make_captions.py
で相対パス指定時のエラーが修正されました。CjangCjengh 氏に感謝します。 PR #986
Dec 3, 2023 / 2023/12/3
-
finetune\tag_images_by_wd14_tagger.py
now supports the separator other than,
with--caption_separator
option. Thanks to KohakuBlueleaf! PR #913 -
Min SNR Gamma with V-predicition (SD 2.1) is fixed. Thanks to feffy380! PR#934
- See #673 for details.
-
--min_diff
and--clamp_quantile
options are added tonetworks/extract_lora_from_models.py
. Thanks to wkpark! PR #936- The default values are same as the previous version.
-
Deep Shrink hires fix is supported in
sdxl_gen_img.py
andgen_img_diffusers.py
.--ds_timesteps_1
and--ds_timesteps_2
options denote the timesteps of the Deep Shrink for the first and second stages.--ds_depth_1
and--ds_depth_2
options denote the depth (block index) of the Deep Shrink for the first and second stages.--ds_ratio
option denotes the ratio of the Deep Shrink.0.5
means the half of the original latent size for the Deep Shrink.--dst1
,--dst2
,--dsd1
,--dsd2
and--dsr
prompt options are also available.
-
finetune\tag_images_by_wd14_tagger.py
で--caption_separator
オプションでカンマ以外の区切り文字を指定できるようになりました。KohakuBlueleaf 氏に感謝します。 PR #913 -
V-predicition (SD 2.1) での Min SNR Gamma が修正されました。feffy380 氏に感謝します。 PR#934
- 詳細は #673 を参照してください。
-
networks/extract_lora_from_models.py
に--min_diff
と--clamp_quantile
オプションが追加されました。wkpark 氏に感謝します。 PR #936- デフォルト値は前のバージョンと同じです。
-
sdxl_gen_img.py
とgen_img_diffusers.py
で Deep Shrink hires fix をサポートしました。--ds_timesteps_1
と--ds_timesteps_2
オプションは Deep Shrink の第一段階と第二段階の timesteps を指定します。--ds_depth_1
と--ds_depth_2
オプションは Deep Shrink の第一段階と第二段階の深さ(ブロックの index)を指定します。--ds_ratio
オプションは Deep Shrink の比率を指定します。0.5
を指定すると Deep Shrink 適用時の latent は元のサイズの半分になります。--dst1
、--dst2
、--dsd1
、--dsd2
、--dsr
プロンプトオプションも使用できます。
Nov 5, 2023 / 2023/11/5
-
sdxl_train.py
now supports different learning rates for each Text Encoder.- Example:
--learning_rate 1e-6
: train U-Net only--train_text_encoder --learning_rate 1e-6
: train U-Net and two Text Encoders with the same learning rate (same as the previous version)--train_text_encoder --learning_rate 1e-6 --learning_rate_te1 1e-6 --learning_rate_te2 1e-6
: train U-Net and two Text Encoders with the different learning rates--train_text_encoder --learning_rate 0 --learning_rate_te1 1e-6 --learning_rate_te2 1e-6
: train two Text Encoders only--train_text_encoder --learning_rate 1e-6 --learning_rate_te1 1e-6 --learning_rate_te2 0
: train U-Net and one Text Encoder only--train_text_encoder --learning_rate 0 --learning_rate_te1 0 --learning_rate_te2 1e-6
: train one Text Encoder only
- Example:
-
train_db.py
andfine_tune.py
now support different learning rates for Text Encoder. Specify with--learning_rate_te
option.- To train Text Encoder with
fine_tune.py
, specify--train_text_encoder
option too.train_db.py
trains Text Encoder by default.
- To train Text Encoder with
-
Fixed the bug that Text Encoder is not trained when block lr is specified in
sdxl_train.py
. -
Debiased Estimation loss is added to each training script. Thanks to sdbds!
- Specify
--debiased_estimation_loss
option to enable it. See PR #889 for details.
- Specify
-
Training of Text Encoder is improved in
train_network.py
andsdxl_train_network.py
. Thanks to KohakuBlueleaf! PR #895 -
The moving average of the loss is now displayed in the progress bar in each training script. Thanks to shirayu! PR #899
-
PagedAdamW32bit optimizer is supported. Specify
--optimizer_type=PagedAdamW32bit
. Thanks to xzuyn! PR #900 -
Other bug fixes and improvements.
-
sdxl_train.py
で、二つのText Encoderそれぞれに独立した学習率が指定できるようになりました。サンプルは上の英語版を参照してください。 -
train_db.py
およびfine_tune.py
で Text Encoder に別の学習率を指定できるようになりました。--learning_rate_te
オプションで指定してください。fine_tune.py
で Text Encoder を学習するには--train_text_encoder
オプションをあわせて指定してください。train_db.py
はデフォルトで学習します。
-
sdxl_train.py
で block lr を指定すると Text Encoder が学習されない不具合を修正しました。 -
Debiased Estimation loss が各学習スクリプトに追加されました。sdbsd 氏に感謝します。
--debiased_estimation_loss
を指定すると有効になります。詳細は PR #889 を参照してください。
-
train_network.py
とsdxl_train_network.py
でText Encoderの学習が改善されました。KohakuBlueleaf 氏に感謝します。 PR #895 -
各学習スクリプトで移動平均のlossがプログレスバーに表示されるようになりました。shirayu 氏に感謝します。 PR #899
-
PagedAdamW32bit オプティマイザがサポートされました。
--optimizer_type=PagedAdamW32bit
と指定してください。xzuyn 氏に感謝します。 PR #900 -
その他のバグ修正と改善。
Version 0.7.0
SDXL training is now available.
Oct 11, 2023 / 2023/10/11
-
Fix to work
make_captions_by_git.py
with the latest version of transformers. -
Improve
gen_img_diffusers.py
andsdxl_gen_img.py
. Both scripts now support the following options:--network_merge_n_models
option can be used to merge some of the models. The remaining models aren't merged, so the multiplier can be changed, and the regional LoRA also works.--network_regional_mask_max_color_codes
is added. Now you can use up to 7 regions.- When this option is specified, the mask of the regional LoRA is the color code based instead of the channel based. The value is the maximum number of the color codes (up to 7).
- You can specify the mask for each LoRA by colors: 0x0000ff, 0x00ff00, 0x00ffff, 0xff0000, 0xff00ff, 0xffff00, 0xffffff.
-
make_captions_by_git.py
が最新の transformers で動作するように修正しました。 -
gen_img_diffusers.py
とsdxl_gen_img.py
を更新し、以下のオプションを追加しました。--network_merge_n_models
オプションで一部のモデルのみマージできます。残りのモデルはマージされないため、重みを変更したり、領域別LoRAを使用したりできます。--network_regional_mask_max_color_codes
を追加しました。最大7つの領域を使用できます。- このオプションを指定すると、領域別LoRAのマスクはチャンネルベースではなくカラーコードベースになります。値はカラーコードの最大数(最大7)です。
- 各LoRAに対してマスクをカラーで指定できます:0x0000ff、0x00ff00、0x00ffff、0xff0000、0xff00ff、0xffff00、0xffffff。
Oct 9. 2023 / 2023/10/9
-
tag_images_by_wd_14_tagger.py
now supports Onnx. If you use Onnx, TensorFlow is not required anymore. #864 Thanks to Isotr0py!--onnx
option is added. If you use Onnx, specify--onnx
option.- Please install Onnx and other required packages.
- Uninstall TensorFlow.
pip install tensorboard==2.14.1
This is required for the specified version of protobuf.pip install protobuf==3.20.3
This is required for Onnx.pip install onnx==1.14.1
pip install onnxruntime-gpu==1.16.0
orpip install onnxruntime==1.16.0
-
--append_tags
option is added totag_images_by_wd_14_tagger.py
. This option appends the tags to the existing tags, instead of replacing them. #858 Thanks to a-l-e-x-d-s-9! -
OFT is now supported.
- You can use
networks.oft
for the network module insdxl_train_network.py
. The usage is the same asnetworks.lora
. Some options are not supported. sdxl_gen_img.py
also supports OFT as--network_module
.- OFT only supports SDXL currently. Because current OFT tweaks Q/K/V and O in the transformer, and SD1/2 have extremely fewer transformers than SDXL.
- The implementation is heavily based on laksjdjf's OFT implementation. Thanks to laksjdjf!
- You can use
-
Other bug fixes and improvements.
-
tag_images_by_wd_14_tagger.py
が Onnx をサポートしました。Onnx を使用する場合は TensorFlow は不要です。#864 Isotr0py氏に感謝します。- Onnxを使用する場合は、
--onnx
オプションを指定してください。 - Onnx とその他の必要なパッケージをインストールしてください。
- TensorFlow をアンインストールしてください。
pip install tensorboard==2.14.1
protobufの指定バージョンにこれが必要。pip install protobuf==3.20.3
Onnxのために必要。pip install onnx==1.14.1
pip install onnxruntime-gpu==1.16.0
またはpip install onnxruntime==1.16.0
- Onnxを使用する場合は、
-
tag_images_by_wd_14_tagger.py
に--append_tags
オプションが追加されました。このオプションを指定すると、既存のタグに上書きするのではなく、新しいタグのみが既存のタグに追加されます。 #858 a-l-e-x-d-s-9氏に感謝します。 -
OFT をサポートしました。
sdxl_train_network.py
の--network_module
にnetworks.oft
を指定してください。使用方法はnetworks.lora
と同様ですが一部のオプションは未サポートです。sdxl_gen_img.py
でも同様に OFT を指定できます。- OFT は現在 SDXL のみサポートしています。OFT は現在 transformer の Q/K/V と O を変更しますが、SD1/2 は transformer の数が SDXL よりも極端に少ないためです。
- 実装は laksjdjf 氏の OFT実装 を多くの部分で参考にしています。laksjdjf 氏に感謝します。
-
その他のバグ修正と改善。
Oct 1. 2023 / 2023/10/1
-
SDXL training is now available in the main branch. The sdxl branch is merged into the main branch.
-
SAI Model Spec metadata is now supported partially.
hash_sha256
is not supported yet.- The main items are set automatically.
- You can set title, author, description, license and tags with
--metadata_xxx
options in each training script. - Merging scripts also support minimum SAI Model Spec metadata. See the help message for the usage.
- Metadata editor will be available soon.
-
bitsandbytes
is now optional. Please install it if you want to use it. The insructions are in the later section. -
albumentations
is not required anymore. -
--v_pred_like_loss ratio
option is added. This option adds the loss like v-prediction loss in SDXL training.0.1
means that the loss is added 10% of the v-prediction loss. The default value is None (disabled).- In v-prediction, the loss is higher in the early timesteps (near the noise). This option can be used to increase the loss in the early timesteps.
-
Arbitrary options can be used for Diffusers' schedulers. For example
--lr_scheduler_args "lr_end=1e-8"
. -
LoRA-FA is added experimentally. Specify
--network_module networks.lora_fa
option instead of--network_module networks.lora
. The trained model can be used as a normal LoRA model. -
JPEG XL is supported. #786
-
Input perturbation noise is added. See #798 for details.
-
Dataset subset now has
caption_prefix
andcaption_suffix
options. The strings are added to the beginning and the end of the captions before shuffling. You can specify the options in.toml
. -
Intel ARC support with IPEX is added. #825
-
Other bug fixes and improvements.
Version 0.6.6
Minor fixes.
細かいバグ修正などを行いました。
Version 0.6.5
Updates on 15 Jun. 2023, 2023/06/15
-
Prodigy optimizer is supported in each training script. It is a member of D-Adaptation and is effective for DyLoRA training. PR #585 Please see the PR for details. Thanks to sdbds!
- Install the package with
pip install prodigyopt
. Then specify the option like--optimizer_type="prodigy"
.
- Install the package with
-
Arbitrary Dataset is supported in each training script (except XTI). You can use it by defining a Dataset class that returns images and captions.
- Prepare a Python script and define a class that inherits
train_util.MinimalDataset
. Then specify the option like--dataset_class package.module.DatasetClass
in each training script. - Please refer to
MinimalDataset
for implementation. I will prepare a sample later.
- Prepare a Python script and define a class that inherits
-
The following features have been added to the generation script.
- Added an option
--highres_fix_disable_control_net
to disable ControlNet in the 2nd stage of Highres. Fix. Please try it if the image is disturbed by some ControlNet such as Canny. - Added Variants similar to sd-dynamic-propmpts in the prompt.
- If you specify
{spring|summer|autumn|winter}
, one of them will be randomly selected. - If you specify
{2$$chocolate|vanilla|strawberry}
, two of them will be randomly selected. - If you specify
{1-2$$ and $$chocolate|vanilla|strawberry}
, one or two of them will be randomly selected and connected byand
. - You can specify the number of candidates in the range
0-2
. You cannot omit one side like-2
or1-
. - It can also be specified for the prompt option.
- If you specify
e
orE
, all candidates will be selected and the prompt will be repeated multiple times (--images_per_prompt
is ignored). It may be useful for creating X/Y plots. - You can also specify
--am {e$$0.2|0.4|0.6|0.8|1.0},{e$$0.4|0.7|1.0} --d 1234
. In this case, 15 prompts will be generated with 5*3. - There is no weighting function.
- If you specify
- Added an option
-
各学習スクリプトでProdigyオプティマイザがサポートされました。D-Adaptationの仲間でDyLoRAの学習に有効とのことです。 PR #585 詳細はPRをご覧ください。sdbds氏に感謝します。
pip install prodigyopt
としてパッケージをインストールしてください。また--optimizer_type="prodigy"
のようにオプションを指定します。
-
各学習スクリプトで任意のDatasetをサポートしました(XTIを除く)。画像とキャプションを返すDatasetクラスを定義することで、学習スクリプトから利用できます。
- Pythonスクリプトを用意し、
train_util.MinimalDataset
を継承するクラスを定義してください。そして各学習スクリプトのオプションで--dataset_class package.module.DatasetClass
のように指定してください。 - 実装方法は
MinimalDataset
を参考にしてください。のちほどサンプルを用意します。
- Pythonスクリプトを用意し、
-
生成スクリプトに以下の機能追加を行いました。
- Highres. Fixの2nd stageでControlNetを無効化するオプション
--highres_fix_disable_control_net
を追加しました。Canny等一部のControlNetで画像が乱れる場合にお試しください。 - プロンプトでsd-dynamic-propmptsに似たVariantをサポートしました。
{spring|summer|autumn|winter}
のように指定すると、いずれかがランダムに選択されます。{2$$chocolate|vanilla|strawberry}
のように指定すると、いずれか2個がランダムに選択されます。{1-2$$ and $$chocolate|vanilla|strawberry}
のように指定すると、1個か2個がランダムに選択されand
で接続されます。- 個数のレンジ指定では
0-2
のように0個も指定可能です。-2
や1-
のような片側の省略はできません。 - プロンプトオプションに対しても指定可能です。
{e$$chocolate|vanilla|strawberry}
のようにe
またはE
を指定すると、すべての候補が選択されプロンプトが複数回繰り返されます(--images_per_prompt
は無視されます)。X/Y plotの作成に便利かもしれません。--am {e$$0.2|0.4|0.6|0.8|1.0},{e$$0.4|0.7|1.0} --d 1234
のような指定も可能です。この場合、5*3で15回のプロンプトが生成されます。- Weightingの機能はありません。
- Highres. Fixの2nd stageでControlNetを無効化するオプション
Updates on 8 Jun. 2023, 2023/06/08
- Fixed a bug where clip skip did not work when training with weighted captions (
--weighted_captions
specified) and when generating sample images during training. - 重みづけキャプションでの学習時(
--weighted_captions
指定時)および学習中のサンプル画像生成時にclip skipが機能しない不具合を修正しました。
Updates on 6 Jun. 2023, 2023/06/06
- Fix
train_network.py
to probably work with older versions of LyCORIS. gen_img_diffusers.py
now supportsBREAK
syntax.train_network.py
がLyCORISの以前のバージョンでも恐らく動作するよう修正しました。gen_img_diffusers.py
でBREAK
構文をサポートしました。
Updates on 3 Jun. 2023, 2023/06/03
-
Max Norm Regularization is now available in
train_network.py
. PR #545 Thanks to AI-Casanova!- Max Norm Regularization is a technique to stabilize network training by limiting the norm of network weights. It may be effective in suppressing overfitting of LoRA and improving stability when used with other LoRAs. See PR for details.
- Specify as
--scale_weight_norms=1.0
. It seems good to try from1.0
. - The networks other than LoRA in this repository (such as LyCORIS) do not support this option.
-
Three types of dropout have been added to
train_network.py
and LoRA network.- Dropout is a technique to suppress overfitting and improve network performance by randomly setting some of the network outputs to 0.
--network_dropout
is a normal dropout at the neuron level. In the case of LoRA, it is applied to the output of down. Proposed in PR #545 Thanks to AI-Casanova!--network_dropout=0.1
specifies the dropout probability to0.1
.- Note that the specification method is different from LyCORIS.
- For LoRA network,
--network_args
can specifyrank_dropout
to dropout each rank with specified probability. Alsomodule_dropout
can be specified to dropout each module with specified probability.- Specify as
--network_args "rank_dropout=0.2" "module_dropout=0.1"
.
- Specify as
--network_dropout
,rank_dropout
, andmodule_dropout
can be specified at the same time.- Values of 0.1 to 0.3 may be good to try. Values greater than 0.5 should not be specified.
rank_dropout
andmodule_dropout
are original techniques of this repository. Their effectiveness has not been verified yet.- The networks other than LoRA in this repository (such as LyCORIS) do not support these options.
-
Added an option
--scale_v_pred_loss_like_noise_pred
to scale v-prediction loss like noise prediction in each training script.- By scaling the loss according to the time step, the weights of global noise prediction and local noise prediction become the same, and the improvement of details may be expected.
- See this article by xrg for details (written in Japanese). Thanks to xrg for the great suggestion!
-
Max Norm Regularizationが
train_network.py
で使えるようになりました。PR #545 AI-Casanova氏に感謝します。- Max Norm Regularizationは、ネットワークの重みのノルムを制限することで、ネットワークの学習を安定させる手法です。LoRAの過学習の抑制、他のLoRAと併用した時の安定性の向上が期待できるかもしれません。詳細はPRを参照してください。
--scale_weight_norms=1.0
のように--scale_weight_norms
で指定してください。1.0
から試すと良いようです。- LyCORIS等、当リポジトリ以外のネットワークは現時点では未対応です。
-
train_network.py
およびLoRAに計三種類のdropoutを追加しました。- dropoutはネットワークの一部の出力をランダムに0にすることで、過学習の抑制、ネットワークの性能向上等を図る手法です。
--network_dropout
はニューロン単位の通常のdropoutです。LoRAの場合、downの出力に対して適用されます。PR #545 で提案されました。AI-Casanova氏に感謝します。--network_dropout=0.1
などとすることで、dropoutの確率を指定できます。- LyCORISとは指定方法が異なりますのでご注意ください。
- LoRAの場合、
--network_args
にrank_dropout
を指定することで各rankを指定確率でdropoutします。また同じくLoRAの場合、--network_args
にmodule_dropout
を指定することで各モジュールを指定確率でdropoutします。--network_args "rank_dropout=0.2" "module_dropout=0.1"
のように指定します。
--network_dropout
、rank_dropout
、module_dropout
は同時に指定できます。- それぞれの値は0.1~0.3程度から試してみると良いかもしれません。0.5を超える値は指定しない方が良いでしょう。
rank_dropout
およびmodule_dropout
は当リポジトリ独自の手法です。有効性の検証はまだ行っていません。- これらのdropoutはLyCORIS等、当リポジトリ以外のネットワークは現時点では未対応です。
-
各学習スクリプトにv-prediction lossをnoise predictionと同様の値にスケールするオプション
--scale_v_pred_loss_like_noise_pred
を追加しました。- タイムステップに応じてlossをスケールすることで、 大域的なノイズの予測と局所的なノイズの予測の重みが同じになり、ディテールの改善が期待できるかもしれません。
- 詳細はxrg氏のこちらの記事をご参照ください:noise_predictionモデルとv_predictionモデルの損失 - 勾配降下党青年局 xrg氏の素晴らしい記事に感謝します。
Updates on 31 May 2023, 2023/05/31
-
Show warning when image caption file does not exist during training. PR #533 Thanks to TingTingin!
- Warning is also displayed when using class+identifier dataset. Please ignore if it is intended.
-
train_network.py
now supports merging network weights before training. PR #542 Thanks to u-haru!--base_weights
option specifies LoRA or other model files (multiple files are allowed) to merge.--base_weights_multiplier
option specifies multiplier of the weights to merge (multiple values are allowed). If omitted or less thanbase_weights
, 1.0 is used.- This is useful for incremental learning. See PR for details.
-
Show warning and continue training when uploading to HuggingFace fails.
-
学習時に画像のキャプションファイルが存在しない場合、警告が表示されるようになりました。 PR #533 TingTingin氏に感謝します。
- class+identifier方式のデータセットを利用している場合も警告が表示されます。意図している通りの場合は無視してください。
-
train_network.py
に学習前にモデルにnetworkの重みをマージする機能が追加されました。 PR #542 u-haru氏に感謝します。--base_weights
オプションでLoRA等のモデルファイル(複数可)を指定すると、それらの重みをマージします。--base_weights_multiplier
オプションでマージする重みの倍率(複数可)を指定できます。省略時またはbase_weights
よりも数が少ない場合は1.0になります。- 差分追加学習などにご利用ください。詳細はPRをご覧ください。
-
HuggingFaceへのアップロードに失敗した場合、警告を表示しそのまま学習を続行するよう変更しました。
Updates on 25 May 2023, 2023/05/25
- D-Adaptation v3.0 is now supported. PR #530 Thanks to sdbds!
--optimizer_type
now acceptsDAdaptAdamPreprint
,DAdaptAdanIP
, andDAdaptLion
.DAdaptAdam
is now new. The oldDAdaptAdam
is available withDAdaptAdamPreprint
.- Simply specifying
DAdaptation
will useDAdaptAdamPreprint
(same behavior as before). - You need to install D-Adaptation v3.0. After activating venv, please do
pip install -U dadaptation
. - See ...
Version 0.6.4
Updated at 3 May 2023, 2023/05/03
-
When saving v2 models in Diffusers format in training scripts and conversion scripts, it was found that the U-Net configuration is different from those of Hugging Face's stabilityai models (this repository is
"use_linear_projection": false
, stabilityai istrue
). Please note that the weight shapes are different, so please be careful when using the weight files directly. We apologize for the inconvenience.- Since the U-Net model is created based on the configuration, it should not cause any problems in training or inference.
- Added
--unet_use_linear_projection
option toconvert_diffusers20_original_sd.py
script. If you specify this option, you can save a Diffusers format model with the same configuration as stabilityai's model from an SD format model (a single*.safetensors
or*.ckpt
file). Unfortunately, it is not possible to convert a Diffusers format model to the same format.
-
Lion8bit optimizer is supported. PR #447 Thanks to sdbds!
- Currently it is optional because you need to update
bitsandbytes
version. See "Optional: Use Lion8bit" in installation instructions to use it.
- Currently it is optional because you need to update
-
Multi-GPU training with DDP is supported in each training script. PR #448 Thanks to Isotr0py!
-
Multi resolution noise (pyramid noise) is supported in each training script. PR #471 Thanks to pamparamm!
- See PR and this page Multi-Resolution Noise for Diffusion Model Training for details.
-
学習スクリプトや変換スクリプトでDiffusers形式でv2モデルを保存するとき、U-Netの設定がHugging Faceのstabilityaiのモデルと異なることがわかりました(当リポジトリでは
"use_linear_projection": false
、stabilityaiはtrue
)。重みの形状が異なるため、直接重みファイルを利用する場合にはご注意ください。ご不便をお掛けし申し訳ありません。- U-Netのモデルは設定に基づいて作成されるため、通常、学習や推論で問題になることはないと思われます。
convert_diffusers20_original_sd.py
スクリプトに--unet_use_linear_projection
オプションを追加しました。これを指定するとSD形式のモデル(単一の*.safetensors
または*.ckpt
ファイル)から、stabilityaiのモデルと同じ形状の重みファイルを持つDiffusers形式モデルが保存できます。なお、Diffusers形式のモデルを同形式に変換することはできません。
-
Lion8bitオプティマイザがサポートされました。PR #447 sdbds氏に感謝します。
bitsandbytes
のバージョンを更新する必要があるため、現在はオプションです。使用するにはインストール手順の「オプション:Lion8bitを使う」を参照してください。
-
各学習スクリプトでDDPによるマルチGPU学習がサポートされました。PR #448 Isotr0py氏に感謝します。
-
Multi resolution noise (pyramid noise) が各学習スクリプトでサポートされました。PR #471 pamparamm氏に感謝します。
- 詳細はPRおよびこちらのページ Multi-Resolution Noise for Diffusion Model Training を参照してください。
--multires_noise_iterations
に数値を指定すると有効になります。6
~10
程度の値が良いようです。--multires_noise_discount
に0.1
~0.3
程度の値(LoRA学習等比較的データセットが小さい場合のPR作者の推奨)、ないしは0.8
程度の値(元記事の推奨)を指定してください(デフォルトは0.3
)。
Version 0.6.3
Updated at 30 Apr. 2023, 2023/04/30
- Added Chinese translation of DreamBooth guide and LoRA guide. PR #459 Thanks to tomj2ee!
- Added documentation for image generation script
gen_img_diffusers.py
(Japanese version only). - 中国語版のDreamBoothガイドとLoRAガイドが追加されました。 PR #459 tomj2ee氏に感謝します。
- 画像生成スクリプト
gen_img_diffusers.py
の簡単なドキュメントを追加しました(日本語版のみ)。
Updated at 26 Apr. 2023, 2023/04/26
- Added Chinese translation of training guide. PR #445 Thanks to tomj2ee!
tag_images_by_wd14_tagger.py
can now get arguments from outside. PR #453 Thanks to mio2333!- 学習に関するドキュメントの中国語版が追加されました。 PR #445 tomj2ee氏に感謝します。
tag_images_by_wd14_tagger.py
の引数を外部から取得できるようになりました。 PR #453 mio2333氏に感謝します。
Updated at 25 Apr. 2023, 2023/04/25
-
Please do not update for a while if you cannot revert the repository to the previous version when something goes wrong, because the model saving part has been changed.
-
Added
--save_every_n_steps
option to each training script. The model is saved every specified steps.--save_last_n_steps
option can be used to save only the specified number of models (old models will be deleted).- If you specify the
--save_state
option, the state will also be saved at the same time. You can specify the number of steps to keep the state with the--save_last_n_steps_state
option (the same value as--save_last_n_steps
is used if omitted). - You can use the epoch-based model saving and state saving options together.
- Not tested in multi-GPU environment. Please report any bugs.
-
--cache_latents_to_disk
option automatically enables--cache_latents
option when specified. #438 -
Fixed a bug in
gen_img_diffusers.py
where latents upscaler would fail with a batch size of 2 or more. -
モデル保存部分を変更していますので、何か不具合が起きた時にリポジトリを前のバージョンに戻せない場合には、しばらく更新を控えてください。
-
各学習スクリプトに
--save_every_n_steps
オプションを追加しました。指定ステップごとにモデルを保存します。--save_last_n_steps
オプションに数値を指定すると、そのステップ数のモデルのみを保存します(古いモデルは削除されます)。--save_state
オプションを指定するとstateも同時に保存します。--save_last_n_steps_state
オプションでstateを残すステップ数を指定できます(省略時は--save_last_n_steps
と同じ値が使われます)。- エポックごとのモデル保存、state保存のオプションと共存できます。
- マルチGPU環境でのテストを行っていないため、不具合等あればご報告ください。
-
--cache_latents_to_disk
オプションが指定されたとき、--cache_latents
オプションが自動的に有効になるようにしました。 #438 -
gen_img_diffusers.py
でlatents upscalerがバッチサイズ2以上でエラーとなる不具合を修正しました。
Version 0.6.2
Updated at 23 Apr. 2023, 2023/4/23:
- Fixed to log to TensorBoard when
--logging_dir
is specified and--log_with
is not specified. --logging_dir
を指定し--log_with
を指定しない場合に、以前と同様にTensorBoardへログ出力するよう修正しました。
Updated at 22 Apr. 2023, 2023/4/22:
-
Added support for logging to wandb. Please refer to PR #428. Thank you p1atdev!
wandb
installation is required. Please install it withpip install wandb
. Login to wandb withwandb login
command, or set--wandb_api_key
option for automatic login.- Please let me know if you find any bugs as the test is not complete.
-
You can automatically login to wandb by setting the
--wandb_api_key
option. Please be careful with the handling of API Key. PR #435 Thank you Linaqruf! -
Improved the behavior of
--debug_dataset
on non-Windows environments. PR #429 Thank you tsukimiya! -
Fixed
--face_crop_aug
option not working in Fine tuning method. -
Prepared code to use any upscaler in
gen_img_diffusers.py
. -
wandbへのロギングをサポートしました。詳細は PR #428をご覧ください。p1atdev氏に感謝します。
wandb
のインストールが別途必要です。pip install wandb
でインストールしてください。またwandb login
でログインしてください(学習スクリプト内でログインする場合は--wandb_api_key
オプションを設定してください)。- テスト未了のため不具合等ありましたらご連絡ください。
-
wandbへのロギング時に
--wandb_api_key
オプションを設定することで自動ログインできます。API Keyの扱いにご注意ください。 PR #435 Linaqruf氏に感謝します。 -
Windows以外の環境での
--debug_dataset
の動作を改善しました。PR #429 tsukimiya氏に感謝します。 -
--face_crop_aug
オプションがFine tuning方式で動作しなかったのを修正しました。 -
gen_img_diffusers.py
に任意のupscalerを利用するためのコード準備を行いました。
Updated at 19 Apr. 2023, 2023/4/19:
- Fixed
lora_interrogator.py
not working. Please refer to PR #392 for details. Thank you A2va and heyalexchoi! - Fixed the handling of tags containing
_
intag_images_by_wd14_tagger.py
. lora_interrogator.py
が動作しなくなっていたのを修正しました。詳細は PR #392 をご参照ください。A2va氏およびheyalexchoi氏に感謝します。tag_images_by_wd14_tagger.py
で_
を含むタグの取り扱いを修正しました。
Updated at 17 Apr. 2023, 2023/4/17:
- Added the
--recursive
option to each script in thefinetune
folder to process folders recursively. Please refer to PR #400 for details. Thanks to Linaqruf! finetune
フォルダ内の各スクリプトに再起的にフォルダを処理するオプション--recursive
を追加しました。詳細は PR #400 を参照してください。Linaqruf 氏に感謝します。
Updated at 14 Apr. 2023, 2023/4/14:
- Fixed a bug that caused an error when loading DyLoRA with the
--network_weight
option intrain_network.py
. train_network.py
で、DyLoRAを--network_weight
オプションで読み込むとエラーになる不具合を修正しました。
Updated at 13 Apr. 2023, 2023/4/13:
-
Added support for DyLoRA in
train_network.py
. Please refer to here for details (currently only in Japanese). -
Added support for caching latents to disk in each training script. Please specify both
--cache_latents
and--cache_latents_to_disk
options.- The files are saved in the same folder as the images with the extension
.npz
. If you specify the--flip_aug
option, the files with_flip.npz
will also be saved. - Multi-GPU training has not been tested.
- This feature is not tested with all combinations of datasets and training scripts, so there may be bugs.
- The files are saved in the same folder as the images with the extension
-
Added workaround for an error that occurs when training with
fp16
orbf16
infine_tune.py
. -
train_network.py
でDyLoRAをサポートしました。詳細はこちらをご覧ください。 -
各学習スクリプトでlatentのディスクへのキャッシュをサポートしました。
--cache_latents
オプションに 加えて、--cache_latents_to_disk
オプションを指定してください。- 画像と同じフォルダに、拡張子
.npz
で保存されます。--flip_aug
オプションを指定した場合、_flip.npz
が付いたファイルにも保存されます。 - マルチGPUでの学習は未テストです。
- すべてのDataset、学習スクリプトの組み合わせでテストしたわけではないため、不具合があるかもしれません。
- 画像と同じフォルダに、拡張子
-
fine_tune.py
で、fp16
およびbf16
の学習時にエラーが出る不具合に対して対策を行いました。
Version 0.6.1
Updates at 8 Apr. 2023, 2023/4/8:
-
Added support for training with weighted captions. Thanks to AI-Casanova for the great contribution!
- Please refer to the PR for details: PR #336
- Specify the
--weighted_captions
option. It is available for all training scripts except Textual Inversion and XTI. - This option is also applicable to token strings of the DreamBooth method.
- The syntax for weighted captions is almost the same as the Web UI, and you can use things like
(abc)
,[abc]
, and(abc:1.23)
. Nesting is also possible. - If you include a comma in the parentheses, the parentheses will not be properly matched in the prompt shuffle/dropout, so do not include a comma in the parentheses.
-
重みづけキャプションによる学習に対応しました。 AI-Casanova 氏の素晴らしい貢献に感謝します。
- 詳細はこちらをご確認ください。PR #336
--weighted_captions
オプションを指定してください。Textual InversionおよびXTIを除く学習スクリプトで使用可能です。- キャプションだけでなく DreamBooth 手法の token string でも有効です。
- 重みづけキャプションの記法はWeb UIとほぼ同じで、
(abc)
や[abc]
、(abc:1.23)
などが使用できます。入れ子も可能です。 - 括弧内にカンマを含めるとプロンプトのshuffle/dropoutで括弧の対応付けがおかしくなるため、括弧内にはカンマを含めないでください。
Updates at 6 Apr. 2023, 2023/4/6:
-
Added a feature to upload model and state to HuggingFace. Thanks to ddPn08 for the contribution! PR #348
- When
--huggingface_repo_id
is specified, the model is uploaded to HuggingFace at the same time as saving the model. - Please note that the access token is handled with caution. Please refer to the HuggingFace documentation.
- For example, specify other arguments as follows.
--huggingface_repo_id "your-hf-name/your-model" --huggingface_path_in_repo "path" --huggingface_repo_type model --huggingface_repo_visibility private --huggingface_token hf_YourAccessTokenHere
- If
public
is specified for--huggingface_repo_visibility
, the repository will be public. If the option is omitted orprivate
(or anything other thanpublic
) is specified, it will be private. - If you specify
--save_state
and--save_state_to_huggingface
, the state will also be uploaded. - If you specify
--resume
and--resume_from_huggingface
, the state will be downloaded from HuggingFace and resumed.- In this case, the
--resume
option is--resume {repo_id}/{path_in_repo}:{revision}:{repo_type}
. For example:--resume_from_huggingface --resume your-hf-name/your-model/path/test-000002-state:main:model
- In this case, the
- If you specify
--async_upload
, the upload will be done asynchronously.
- When
-
Added the documentation for applying LoRA to generate with the standard pipeline of Diffusers. training LoRA (Japanese only)
-
Support for Attention Couple and regional LoRA in
gen_img_diffusers.py
.- If you use
AND
to separate the prompts, each sub-prompt is sequentially applied to LoRA.--mask_path
is treated as a mask image. The number of sub-prompts and the number of LoRA must match.
- If you use
-
モデルおよびstateをHuggingFaceにアップロードする機能を各スクリプトに追加しました。 PR #348 ddPn08 氏の貢献に感謝します。
--huggingface_repo_id
が指定されているとモデル保存時に同時にHuggingFaceにアップロードします。- アクセストークンの取り扱いに注意してください。HuggingFaceのドキュメントを参照してください。
- 他の引数をたとえば以下のように指定してください。
--huggingface_repo_id "your-hf-name/your-model" --huggingface_path_in_repo "path" --huggingface_repo_type model --huggingface_repo_visibility private --huggingface_token hf_YourAccessTokenHere
--huggingface_repo_visibility
にpublic
を指定するとリポジトリが公開されます。省略時またはprivate
(などpublic
以外)を指定すると非公開になります。--save_state
オプション指定時に--save_state_to_huggingface
を指定するとstateもアップロードします。--resume
オプション指定時に--resume_from_huggingface
を指定するとHuggingFaceからstateをダウンロードして再開します。- その時の
--resume
オプションは--resume {repo_id}/{path_in_repo}:{revision}:{repo_type}
になります。例:--resume_from_huggingface --resume your-hf-name/your-model/path/test-000002-state:main:model
- その時の
--async_upload
オプションを指定するとアップロードを非同期で行います。
-
LoRAの文書に、LoRAを適用してDiffusersの標準的なパイプラインで生成する方法を追記しました。
-
gen_img_diffusers.py
で Attention Couple および領域別LoRAに対応しました。- プロンプトを
AND
で区切ると各サブプロンプトが順にLoRAに適用されます。--mask_path
がマスク画像として扱われます。サブプロンプトの数とLoRAの数は一致している必要があります。
- プロンプトを
Version 0.6.0
Updates at 4 Apr. 2023, 2023/4/4:
-
The learning rate and dim (rank) of each block may not work with other modules (LyCORIS, etc.) because the module needs to be changed.
-
Fix some bugs and add some features.
- Fix an issue that
.json
format dataset config files cannot be read. issue #351 Thanks to rockerBOO! - Raise an error when an invalid
--lr_warmup_steps
option is specified (when warmup is not valid for the specified scheduler). PR #364 Thanks to shirayu! - Add
min_snr_gamma
to metadata intrain_network.py
. PR #373 Thanks to rockerBOO! - Fix the data type handling in
fine_tune.py
. This may fix an error that occurs in some environments when using xformers, npz format cache, and mixed_precision.
- Fix an issue that
-
Add options to
train_network.py
to specify block weights for learning rates. PR #355 Thanks to u-haru for the great contribution!- Specify the weights of 25 blocks for the full model.
- No LoRA corresponds to the first block, but 25 blocks are specified for compatibility with 'LoRA block weight' etc. Also, if you do not expand to conv2d3x3, some blocks do not have LoRA, but please specify 25 values for the argument for consistency.
- Specify the following arguments with
--network_args
. down_lr_weight
: Specify the learning rate weight of the down blocks of U-Net. The following can be specified.- The weight for each block: Specify 12 numbers such as
"down_lr_weight=0,0,0,0,0,0,1,1,1,1,1,1"
. - Specify from preset: Specify such as
"down_lr_weight=sine"
(the weights by sine curve). sine, cosine, linear, reverse_linear, zeros can be specified. Also, if you add+number
such as"down_lr_weight=cosine+.25"
, the specified number is added (such as 0.25~1.25).
- The weight for each block: Specify 12 numbers such as
mid_lr_weight
: Specify the learning rate weight of the mid block of U-Net. Specify one number such as"down_lr_weight=0.5"
.up_lr_weight
: Specify the learning rate weight of the up blocks of U-Net. The same as down_lr_weight.- If you omit the some arguments, the 1.0 is used. Also, if you set the weight to 0, the LoRA modules of that block are not created.
block_lr_zero_threshold
: If the weight is not more than this value, the LoRA module is not created. The default is 0.
- Specify the weights of 25 blocks for the full model.
-
Add options to
train_network.py
to specify block dims (ranks) for variable rank.- Specify 25 values for the full model of 25 blocks. Some blocks do not have LoRA, but specify 25 values always.
- Specify the following arguments with
--network_args
. block_dims
: Specify the dim (rank) of each block. Specify 25 numbers such as"block_dims=2,2,2,2,4,4,4,4,6,6,6,6,8,6,6,6,6,4,4,4,4,2,2,2,2"
.block_alphas
: Specify the alpha of each block. Specify 25 numbers as with block_dims. If omitted, the value of network_alpha is used.conv_block_dims
: Expand LoRA to Conv2d 3x3 and specify the dim (rank) of each block.conv_block_alphas
: Specify the alpha of each block when expanding LoRA to Conv2d 3x3. If omitted, the value of conv_alpha is used.
-
階層別学習率、階層別dim(rank)についてはモジュール側の変更が必要なため、当リポジトリ内のnetworkモジュール以外(LyCORISなど)では現在は動作しないと思われます。
-
いくつかのバグ修正、機能追加を行いました。
.json
形式のdataset設定ファイルを読み込めない不具合を修正しました。 issue #351 rockerBOO 氏に感謝します。- 無効な
--lr_warmup_steps
オプション(指定したスケジューラでwarmupが無効な場合)を指定している場合にエラーを出すようにしました。 PR #364 shirayu 氏に感謝します。 train_network.py
でmin_snr_gamma
をメタデータに追加しました。 PR #373 rockerBOO 氏に感謝します。fine_tune.py
でデータ型の取り扱いが誤っていたのを修正しました。一部の環境でxformersを使い、npz形式のキャッシュ、mixed_precisionで学習した時にエラーとなる不具合が解消されるかもしれません。
-
階層別学習率を
train_network.py
で指定できるようになりました。PR #355 u-haru 氏の多大な貢献に感謝します。- フルモデルの25個のブロックの重みを指定できます。
- 最初のブロックに該当するLoRAは存在しませんが、階層別LoRA適用等との互換性のために25個としています。またconv2d3x3に拡張しない場合も一部のブロックにはLoRAが存在しませんが、記述を統一するため常に25個の値を指定してください。
---network_args
で以下の引数を指定してください。
- 最初のブロックに該当するLoRAは存在しませんが、階層別LoRA適用等との互換性のために25個としています。またconv2d3x3に拡張しない場合も一部のブロックにはLoRAが存在しませんが、記述を統一するため常に25個の値を指定してください。
down_lr_weight
: U-Netのdown blocksの学習率の重みを指定します。以下が指定可能です。- ブロックごとの重み :
"down_lr_weight=0,0,0,0,0,0,1,1,1,1,1,1"
のように12個の数値を指定します。 - プリセットからの指定 :
"down_lr_weight=sine"
のように指定します(サインカーブで重みを指定します)。sine, cosine, linear, reverse_linear, zeros が指定可能です。また"down_lr_weight=cosine+.25"
のように+数値
を追加すると、指定した数値を加算します(0.25~1.25になります)。
- ブロックごとの重み :
mid_lr_weight
: U-Netのmid blockの学習率の重みを指定します。"down_lr_weight=0.5"
のように数値を一つだけ指定します。up_lr_weight
: U-Netのup blocksの学習率の重みを指定します。down_lr_weightと同様です。- 指定を省略した部分は1.0として扱われます。また重みを0にするとそのブロックのLoRAモジュールは作成されません。
block_lr_zero_threshold
: 重みがこの値以下の場合、LoRAモジュールを作成しません。デフォルトは0です。
- フルモデルの25個のブロックの重みを指定できます。
-
階層別dim (rank)を
train_network.py
で指定できるようになりました。- フルモデルの25個のブロックのdim (rank)を指定できます。階層別学習率と同様に一部のブロックにはLoRAが存在しない場合がありますが、常に25個の値を指定してください。
--network_args
で以下の引数を指定してください。block_dims
: 各ブロックのdim (rank)を指定します。"block_dims=2,2,2,2,4,4,4,4,6,6,6,6,8,6,6,6,6,4,4,4,4,2,2,2,2"
のように25個の数値を指定します。block_alphas
: 各ブロックのalphaを指定します。block_dimsと同様に25個の数値を指定します。省略時はnetwork_alphaの値が使用されます。conv_block_dims
: LoRAをConv2d 3x3に拡張し、各ブロックのdim (rank)を指定します。conv_block_alphas
: LoRAをConv2d 3x3に拡張したときの各ブロックのalphaを指定します。省略時はconv_alphaの値が使用されます。
-
階層別学習率コマンドライン指定例 / Examples of block learning rate command line specification:
--network_args "down_lr_weight=0.5,0.5,0.5,0.5,1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5" "mid_lr_weight=2.0" "up_lr_weight=1.5,1.5,1.5,1.5,1.0,1.0,1.0,1.0,0.5,0.5,0.5,0.5"
--network_args "block_lr_zero_threshold=0.1" "down_lr_weight=sine+.5" "mid_lr_weight=1.5" "up_lr_weight=cosine+.5"
-
階層別学習率tomlファイル指定例 / Examples of block learning rate toml file specification
network_args = [ "down_lr_weight=0.5,0.5,0.5,0.5,1.0,1.0,1.0,1.0,1.5,1.5,1.5,1.5", "mid_lr_weight=2.0", "up_lr_weight=1.5,1.5,1.5,1.5,1.0,1.0,1.0,1.0,0.5,0.5,0.5,0.5",]
network_args = [ "block_lr_zero_threshold=0.1", "down_lr_weight=sine+.5", "mid_lr_weight=1.5", "up_lr_weight=cosine+.5", ]
-
階層別dim (rank)コマンドライン指定例 / Examples of block dim (rank) command line specification:
--network_args "block_dims=2,4,4,4,8,8,8,8,12,12,12,12,16,12,12,12,12,8,8,8,8,4,4,4,2"
--network_args "block_dims=2,4,4,4,8,8,8,8,12,12,12,12,16,12,12,12,12,8,8,8,8,4,4,4,2" "conv_block_dims=2,2,2,2,4,4,4,4,6,6,6,6,8,6,6,6,6,4,4,4,4,2,2,2,2"
--network_args "block_dims=2,4,4,4,8,8,8,8,12,12,12,12,16,12,12,12,12,8,8,8,8,4,4,4,2" "block_alphas=2,2,2,2,4,4,4,4,6,6,6,6,8,6,6,6,6,4,4,4,4,2,2,2,2"
-
階層別dim (rank)tomlファイル指定例 / Examples of block dim (rank) toml file specification
network_args = [ "block_dims=2,4,4,4,8,8,8,8,12,12,12,12,16,12,12,12,12,8,8,8,8,4,4,4,2",]
network_args = [ "block_dims=2,4,4,4,8,8,8,8,12,12,12,12,16,12,12,12,12,8,8,8,8,4,4,4,2", "block_alphas=2,2,2,2,4,4,4,4,6,6,6,6,8,6,6,6,6,4,4,4,4,2,2,2,2",]
Version 0.5.4
Updates at 1 Apr. 2023, 2023/4/1:
- Fix an issue that
merge_lora.py
does not work with the latest version. - Fix an issue that
merge_lora.py
does not merge Conv2d3x3 weights. - 最新のバージョンで
merge_lora.py
が動作しない不具合を修正しました。 merge_lora.py
でno module found for LoRA weight: ...
と表示され Conv2d3x3 拡張の重みがマージされない不具合を修正しました。
Updates at 31 Mar. 2023, 2023/3/31:
- Fix an issue that the VRAM usage temporarily increases when loading a model in
train_network.py
. - Fix an issue that an error occurs when loading a
.safetensors
model intrain_network.py
. #354 train_network.py
でモデル読み込み時にVRAM使用量が一時的に大きくなる不具合を修正しました。train_network.py
で.safetensors
形式のモデルを読み込むとエラーになる不具合を修正しました。#354
Updates at 30 Mar. 2023, 2023/3/30:
-
Support P+ training. Thank you jakaline-dev!
- See #327 for details.
- Use
train_textual_inversion_XTI.py
for training. The usage is almost the same astrain_textual_inversion.py
. However, sample image generation during training is not supported. - Use
gen_img_diffusers.py
for image generation (I think Web UI is not supported). Specify the embedding with--XTI_embeddings
option.
-
Reduce RAM usage at startup in
train_network.py
. #332 Thank you guaneec! -
Support pre-merge for LoRA in
gen_img_diffusers.py
. Specify--network_merge
option. Note that the--am
option of the prompt option is no longer available with this option. -
P+ の学習に対応しました。jakaline-dev氏に感謝します。
- 詳細は #327 をご参照ください。
- 学習には
train_textual_inversion_XTI.py
を使用します。使用法はtrain_textual_inversion.py
とほぼ同じです。た
だし学習中のサンプル生成には対応していません。 - 画像生成には
gen_img_diffusers.py
を使用してください(Web UIは対応していないと思われます)。--XTI_embeddings
オプションで学習したembeddingを指定してください。
-
train_network.py
で起動時のRAM使用量を削減しました。#332 guaneec氏に感謝します。 -
gen_img_diffusers.py
でLoRAの事前マージに対応しました。--network_merge
オプションを指定してください。なおプロンプトオプションの--am
は使用できなくなります。