mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-30 11:11:37 +00:00
Added training for Wan2.1. Not finalized, wait.
This commit is contained in:
@@ -137,6 +137,8 @@ def match_noise_to_target_mean_offset(noise, target, mix=0.5, dim=None):
|
||||
def apply_noise_offset(noise, noise_offset):
|
||||
if noise_offset is None or (noise_offset < 0.000001 and noise_offset > -0.000001):
|
||||
return noise
|
||||
if len(noise.shape) > 4:
|
||||
raise ValueError("Applying noise offset not supported for video models at this time.")
|
||||
noise = noise + noise_offset * torch.randn((noise.shape[0], noise.shape[1], 1, 1), device=noise.device)
|
||||
return noise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user