File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6483,10 +6483,10 @@ def get_noise_noisy_latents_and_timesteps(
64836483 timesteps = fixed_timesteps
64846484 if flow_model_enabled :
64856485 # We need to recover sigmas (float 0.0 to 1.0) from the discrete timesteps
6486- timestep_max = noise_scheduler .config .num_train_timesteps - 1
6487- sigmas = timesteps .float () / timestep_max
6486+ timestep_max = noise_scheduler .config .num_train_timesteps
6487+ sigmas = timesteps .float () / ( timestep_max - 1 )
64886488 elif flow_model_enabled :
6489- timestep_max = noise_scheduler .config .num_train_timesteps - 1
6489+ timestep_max = noise_scheduler .config .num_train_timesteps
64906490 distribution = getattr (args , "flow_timestep_distribution" , "logit_normal" )
64916491 if distribution == "logit_normal" :
64926492 logits = torch .normal (
@@ -6524,7 +6524,7 @@ def get_noise_noisy_latents_and_timesteps(
65246524 t_ref = sigmas
65256525 sigmas = ratios * t_ref / (1 + (ratios - 1 ) * t_ref )
65266526
6527- timesteps = torch .clamp ((sigmas * timestep_max ).long (), 0 , timestep_max )
6527+ timesteps = torch .clamp ((sigmas * timestep_max ).long (), 0 , timestep_max - 1 )
65286528 elif args .timestep_distribution == "logit_normal" :
65296529 logits = torch .normal (
65306530 mean = float (args .logit_normal_mean ),
You can’t perform that action at this time.
0 commit comments