mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-01-26 16:39:47 +00:00
Added support for training vision direct weight adapters
This commit is contained in:
@@ -1584,6 +1584,8 @@ class SDTrainer(BaseSDTrainProcess):
|
||||
self.scaler.update()
|
||||
|
||||
self.optimizer.zero_grad(set_to_none=True)
|
||||
if self.adapter and isinstance(self.adapter, CustomAdapter):
|
||||
self.adapter.post_weight_update()
|
||||
if self.ema is not None:
|
||||
with self.timer('ema_update'):
|
||||
self.ema.update()
|
||||
|
||||
Reference in New Issue
Block a user