Text-to-Image
Diffusers
Safetensors
recoilme commited on
Commit
1760d36
·
1 Parent(s): b1db6f1
Files changed (1) hide show
  1. train.py +4 -4
train.py CHANGED
@@ -716,10 +716,10 @@ for epoch in range(start_epoch, start_epoch + num_epochs):
716
  # шум
717
  noise = torch.randn_like(latents, dtype=latents.dtype)
718
 
719
- # 3. Время t (сэмплим, как и раньше, но чуть сжимаем края)
720
- #u = torch.rand(latents.shape[0], device=latents.device, dtype=latents.dtype)
721
- #t = u * (1 - 2 * 1e-5) + 1e-5 # Теперь t строго в (0.00001 ... 0.99999)
722
- t = torch.sigmoid(torch.randn(latents.shape[0], device=latents.device, dtype=latents.dtype))
723
  # интерполяция между x0 и шумом
724
  noisy_latents = (1.0 - t.view(-1, 1, 1, 1)) * latents + t.view(-1, 1, 1, 1) * noise
725
  # делаем integer timesteps для UNet
 
716
  # шум
717
  noise = torch.randn_like(latents, dtype=latents.dtype)
718
 
719
+ # 3. Время t, bias = -0.5 (Фокус на Деталях ~300) bias = 0.5 (Фокус на структуре) bias = 0 (колокол/ равномерно)
720
+ bias = 0.0
721
+ t = torch.sigmoid(torch.randn(latents.shape[0], device=latents.device, dtype=latents.dtype) + bias)
722
+
723
  # интерполяция между x0 и шумом
724
  noisy_latents = (1.0 - t.view(-1, 1, 1, 1)) * latents + t.view(-1, 1, 1, 1) * noise
725
  # делаем integer timesteps для UNet