-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
def set_timesteps_flux2(num_inference_steps=100, denoising_strength=1.0, dynamic_shift_len=None):
sigma_min = 1 / num_inference_steps
sigma_max = 1.0
num_train_timesteps = 1000
sigma_start = sigma_min + (sigma_max - sigma_min) * denoising_strength # 1.0
sigmas = torch.linspace(sigma_start, sigma_min, num_inference_steps) # [1.0000, 0.9990, ..., 0.0010]
if dynamic_shift_len is None: # TODO:看起来这是一个调整的参数mu,用于调整动态_shift_len的范围
# If you ask me why I set mu=0.8,
# I can only say that it yields better training results.
mu = 0.8
else:
mu = FlowMatchScheduler.compute_empirical_mu(dynamic_shift_len, num_inference_steps)
sigmas = math.exp(mu) / (math.exp(mu) + (1 / sigmas - 1)) # [1.0000, 0.9996, ..., 0.0022]
timesteps = sigmas * num_train_timesteps
return sigmas, timesteps
在跑flux2klein训练脚本时发现,训练时候dynamic_shift_len是None,但推理时为dynamic_shift_len=height // 16 * width // 16。这里为啥不需要对齐?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels