kohya-ss/sd-scripts

Shouldn't fix_noise_scheduler_betas_for_zero_terminal_snr be applied BEFORE prepare_scheduler_for_custom_training?

開放

#1,905 建立於 2025年1月27日

 (2 則留言) (0 個反應) (0 位負責人)Python (1,217 個分叉)batch import
help wanted

倉庫指標

星標
 (7,201 顆星)
PR 合併指標
 (平均合併 18小時 39分鐘) (30 天內合併 16 個 PR)

描述

Hello,

Reference code: https://github.com/kohya-ss/sd-scripts/blob/0778dd9b1df0d6aa33287ded3ce4195f3d03251b/train_network.py#L195

I noticed that fix_noise_scheduler_betas_for_zero_terminal_snr modifies the alphas_cumprod for the noise scheduler, and prepare_scheduler_for_custom_training uses alphas_cumprod to calculate all_snr. The issue with the current order is that all_snr will reflect NON-ztsnr snrs, not ztsnr, causing anything that uses all_snr to use snrs that do not align with ztsnr.

As such, shouldn't fix_noise_scheduler_betas_for_zero_terminal_snr always be applied before prepare_scheduler_for_custom_training?

Thank you.

貢獻者指南