Skip to content

Version 0.3.0

Compare
Choose a tag to compare
@kohya-ss kohya-ss released this 15 Jan 03:49
· 1393 commits to main since this release
c2c1261

Updates at January 14, 2023, 2023/1/14

  • Fix loading some VAE or .safetensors as VAE is failed for --vae option. Thanks to Fannovel16!
  • Add negative prompt scaling for gen_img_diffusers.py You can set another conditioning scale to the negative prompt with --negative_scale option, and --nl option for the prompt. Thanks to laksjdjf!
  • --vae オプションに一部のVAEや .safetensors 形式のモデルを指定するとエラーになる不具合を修正しました。Fannovel16氏に感謝します。
  • gen_img_diffusers.py に、ネガティブプロンプトに異なる guidance scale を設定できる --negative_scale オプションを追加しました。プロンプトからは --nl で指定できます。laksjdjf氏に感謝します。

Updates at January 12, 2023, 2023/1/12

  • Metadata is saved on the model (.safetensors only) (model name, VAE name, training steps, learning rate etc.) The metadata will be able to inspect by sd-webui-additional-networks extension in near future. If you do not want to save it, specify no_metadata option.
  • メタデータが保存されるようになりました( .safetensors 形式の場合のみ)(モデル名、VAE 名、ステップ数、学習率など)。近日中に拡張から確認できるようになる予定です。メタデータを保存したくない場合は no_metadata オプションをしてしてください。

Updates at Jan 9. 2023

All training scripts are updated.

Breaking Changes

  • The fine_tuning option in train_db.py is removed. Please use DreamBooth with captions or fine_tune.py.
  • The Hypernet feature in fine_tune.py is removed, will be implemented in train_network.py in future.

Features, Improvements and Bug Fixes

for all script: train_db.py, fine_tune.py and train_network.py

  • Added output_name option. The name of output file can be specified.
    • With --output_name style1, the output file is like style1_000001.ckpt (or .safetensors) for each epoch and style1.ckpt for last.
    • If ommitted (default), same to previous. epoch-000001.ckpt and last.ckpt.
  • Added save_last_n_epochs option. Keep only latest n files for the checkpoints and the states. Older files are removed. (Thanks to shirayu!)
    • If the options are --save_every_n_epochs=2 --save_last_n_epochs=3, in the end of epoch 8, epoch-000008.ckpt is created and epoch-000002.ckpt is removed.

train_db.py

  • Added max_token_length option. Captions can have more than 75 tokens.

fine_tune.py

  • The script now works without .npz files. If .npz is not found, the scripts get the latents with VAE.
    • You can omit prepare_buckets_latents.py in preprocessing. However, it is recommended if you train more than 1 or 2 epochs.
    • --resolution option is required to specify the training resolution.
  • Added cache_latents and color_aug options.

train_network.py

  • Now --gradient_checkpointing is effective for U-Net and Text Encoder.
    • The memory usage is reduced. The larger batch size is avilable, but the training speed will be slow.
    • The training might be possible with 6GB VRAM for dimension=4 with batch size=1.

Documents are not updated now, I will update one by one.

更新情報 (2023/1/9)

学習スクリプトを更新しました。

削除された機能

  • train_db.pyfine_tuning は削除されました。キャプション付きの DreamBooth または fine_tune.py を使ってください。
  • fine_tune.py の Hypernet学習の機能は削除されました。将来的にtrain_network.pyに追加される予定です。

その他の機能追加、バグ修正など

学習スクリプトに共通: train_db.py, fine_tune.py and train_network.py

  • output_nameオプションを追加しました。保存されるモデルファイルの名前を指定できます。
    • --output_name style1と指定すると、エポックごとに保存されるファイル名はstyle1_000001.ckpt (または .safetensors) に、最後に保存されるファイル名はstyle1.ckptになります。
    • 省略時は今までと同じです(epoch-000001.ckptおよびlast.ckpt)。
  • save_last_n_epochsオプションを追加しました。最新の n ファイル、stateだけ保存し、古いものは削除します。(shirayu氏に感謝します。)
    • たとえば--save_every_n_epochs=2 --save_last_n_epochs=3と指定した時、8エポック目の終了時には、epoch-000008.ckptが保存されepoch-000002.ckptが削除されます。

train_db.py

  • max_token_lengthオプションを追加しました。75文字を超えるキャプションが使えるようになります。

fine_tune.py

  • .npzファイルがなくても動作するようになりました。.npzファイルがない場合、VAEからlatentsを取得して動作します。
    • prepare_buckets_latents.pyを前処理で実行しなくても良くなります。ただし事前取得をしておいたほうが、2エポック以上学習する場合にはトータルで高速です。
    • この場合、解像度を指定するために--resolutionオプションが必要です。
  • cache_latentscolor_augオプションを追加しました。

train_network.py

  • --gradient_checkpointingがU-NetとText Encoderにも有効になりました。
    • メモリ消費が減ります。バッチサイズを大きくできますが、トータルでの学習時間は長くなるかもしれません。
    • dimension=4のLoRAはバッチサイズ1で6GB VRAMで学習できるかもしれません。

ドキュメントは未更新ですが少しずつ更新の予定です。