flux_pack_latents

Pack FLUX latents into a patch sequence

Description

Packs a [B, C, H, W] latent into 2x2 patches, giving a sequence [B, (H/2) * (W/2), C * 4]. Reference: FluxPipeline._pack_latents.

Usage

flux_pack_latents(latents)

Arguments

  • latents: Tensor of shape [B, C, H, W]; H and W must be even.

Value

Tensor of shape [B, (H/2) * (W/2), C * 4].