You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I can help you with this. In ControlNeXt-SVD-v2-Training/models/unet_spatio_temporal_condition_controlnext.py, line 456 to 464, you can see:
ifidx==0andconditional_controlsisnotNone:
scale=conditional_controls['scale']
conditional_controls=conditional_controls['output']
mean_latents, std_latents=torch.mean(sample, dim=(1, 2, 3), keepdim=True), torch.std(sample, dim=(1, 2, 3), keepdim=True)
mean_control, std_control=torch.mean(conditional_controls, dim=(1, 2, 3), keepdim=True), torch.std(conditional_controls, dim=(1, 2, 3), keepdim=True)
conditional_controls= (conditional_controls-mean_control) * (std_latents/ (std_control+1e-5)) +mean_latentsconditional_controls=F.adaptive_avg_pool2d(conditional_controls, sample.shape[-2:])
# 0.2: This superparameter is used to adjust the control level: increasing this value will strengthen the control level.sample=sample+conditional_controls*scale*0.2
This is how the cross normalization is computed. Hope this may help.
Thanks a lot for such an amazing work and here are some questions about training code.
Looking forward to your reply~
The text was updated successfully, but these errors were encountered: