Added single value adapter training

This commit is contained in:
Jaret Burkett
2024-04-28 06:04:47 -06:00
parent b96913d73c
commit 10e1ecf1e8
8 changed files with 462 additions and 7 deletions

View File

@@ -1341,6 +1341,12 @@ class SDTrainer(BaseSDTrainProcess):
quad_count=quad_count
)
if self.adapter and isinstance(self.adapter, CustomAdapter) and batch.extra_values is not None:
self.adapter.add_extra_values(batch.extra_values.detach())
if self.train_config.do_cfg:
self.adapter.add_extra_values(torch.zeros_like(batch.extra_values.detach()), is_unconditional=True)
self.before_unet_predict()
# do a prior pred if we have an unconditional image, we will swap out the giadance later