flux2_bn_normalize

Normalize patchified latents with the VAE BatchNorm statistics

Description

FLUX.2 has no scalar scaling/shift factor; latents are standardized per packed channel with the VAE’s bn.running_mean / bn.running_var (eps 1e-4). Reference: encode/decode paths of Flux2KleinPipeline.

Usage

flux2_bn_normalize(latents, bn_mean, bn_var, eps = 1e-04, inverse = FALSE)

Arguments

  • latents: Tensor [B, 128, H, W] (patchified).
  • eps: Numeric. BatchNorm epsilon.
  • inverse: Logical. De-normalize (decode path) instead.
  • bn_mean,bn_var: Float tensors [128].

Value

Tensor like latents.