santa hat
deerdeer nosedeer glow
Sign In

如何在v预测模型上训练LoRA | How to train a LoRA on v-pred SDXL model

如何在v预测模型上训练LoRA | How to train a LoRA on v-pred SDXL model

V预测模型LoRA训练指南

V-Prediction SDXL Model LoRA Training Guide

此教程适用于基于sd-scripts的LoRA训练器
This tutorial is intended for LoRA trainers based on sd-scripts.

目前kohya-ss/sd-scripts训练器仅在dev分支对在v预测模型上训练LoRA进行了支持,使用主分支会导致花图。

Currently, the kohya-ss/sd-scripts trainer only supports training LoRA on v-prediction models in the dev branch. Using the main branch may result in corrupted images.

下面以秋叶LoRA训练包为例进行演示。
The following example uses the Aki LoRA training package.

  1. 在存放有训练包的文件夹下按shift+右键,点击“在终端中打开”。
    In the folder containing the training package, press Shift + Right-click and select "Open in Terminal.“



  2. 在弹出的命令行窗口内输入以下指令,clone dev分支的训练器到本地:
    In the command line window that appears, enter the following command to clone the dev branch of the trainer locally:

    git clone -b dev https://github.com/kohya-ss/sd-scripts.git

    (对于中国大陆用户,如遇网络问题,请自行打开VPN/加速工具/使用镜像)




  3. 进入秋叶包内,将原来的训练器文件夹改名做备份。不建议删除原来的,因为dev分支可能有bug。
    Go into the Autumn Leaf package and rename the original trainer folder to create a backup. It’s not recommended to delete the original, as the dev branch may contain bugs.




  4. 将新clone下来的sd-scripts拖到秋叶包内。
    Drag the newly cloned sd-scripts into the Aki package.






  5. 启动WebUI脚本,打开训练webUI。
    Start the WebUI script and open the training webUI.

  6. 在高级设置处添加如下参数:
    In the advanced settings, add the following parameter:

    v_parameterization = true
    zero_terminal_snr = true


    其余设置按照自己平时训练配置即可。
    The rest of the settings can follow your usual training configuration.




  7. 当训练时弹出如下警告,说明已开启v预测模式。
    When the following warning appears during training, it indicates that v-prediction mode is enabled.



训练成果 training result (nyalia lora on noob-vpred0.5):

以上即为全部教程。
That concludes the tutorial.

如果你使用命令行训练器/linux,那么仅需在切换sd-scripts为dev分支后,在训练时为训练参数添加--v_parameterization true

If you are a command-line trainer/Linux user, simply switch sd-scripts to the dev branch, then add

--v_parameterization true --zero_terminal_snr = true 

to the training parameters during training.

如遇bug,请自行把sd-script文件夹改名改回去。
If you encounter any bugs, rename the sd-scripts folder back to its original name.

62

Comments