Change hidream to be proper x0 prediction and use a custom weighing scheme for x0 models.

This commit is contained in:
Jaret Burkett committed 2026-09-10 11:49:54 -06:00
1 parent b1bf3e4381
commit f56b5a1d40
5 files changed
+1035 -20

No files matched your search

+4 -1
View File
@@ -962,7 +962,8 @@ class SDTrainer(BaseSDTrainProcess):
timestep_weight = self.sd.noise_scheduler.get_weights_for_timesteps(
timesteps,
v2=self.train_config.linear_timesteps2,
timestep_type=self.train_config.timestep_type
timestep_type=self.train_config.timestep_type,
x0_pred=self.sd.x0_pred,
).to(loss.device, dtype=loss.dtype)
if len(loss.shape) == 4:
timestep_weight = timestep_weight.view(-1, 1, 1, 1).detach()
@@ -1079,6 +1080,8 @@ class SDTrainer(BaseSDTrainProcess):
if additional_model_loss is not None:
loss = loss + additional_model_loss
self.additional_logs["additional_model_loss"] = additional_model_loss.item()
# per-term breakdown, if the model keeps one
self.additional_logs.update(getattr(self.sd, "additional_loss_logs", None) or {})
if self.train_config.max_loss_debug and self.train_config.max_loss is not None:
if loss.item() > self.train_config.max_loss: