flux2_unpack_latents_with_ids

Unpack FLUX.2 tokens back to a latent grid via position ids

Description

Scatters tokens to (H, W) positions taken from the id columns (H = column 2, W = column 3, 0-based values). Reference: Flux2KleinPipeline._unpack_latents_with_ids.

Usage

flux2_unpack_latents_with_ids(x, ids, height, width)

Arguments

  • x: Tensor [B, S, C] of tokens.
  • ids: Tensor [S, 4] (or [B, S, 4]) of position ids.
  • height,width: Integers. Packed grid dimensions.

Value

Tensor [B, C, height, width].