flux_load_transformer

Load a FLUX transformer from any checkpoint format

Description

Builds flux_transformer from the checkpoint’s embedded config and loads the weights. Dispatches on the checkpoint format:

Usage

flux_load_transformer(ckpt, device = "cuda", dtype = "bfloat16", pin = TRUE,
                      fp8_resident = FALSE, verbose = TRUE, ...)

Arguments

  • ckpt: A checkpoint from flux_open_checkpoint or flux_open_quantized.
  • device: Character. Compute device.
  • dtype: Character. Model dtype (“bfloat16” or “float32”). For quantized formats this sets the resident (non-quantized) tensors and must match the compute dtype: bfloat16 for GPU compute, float32 for CPU compute.
  • pin: Logical. Pin fp8 host memory for faster transfers (streamed fp8 only).
  • fp8_resident: Logical. Keep the fp8 weights on device instead of streaming from the CPU - right for models whose whole quantized footprint fits in VRAM (FLUX.2 klein-4B: ~4 GB).
  • verbose: Logical.
  • ...: Overrides for flux_transformer arguments (tiny test configs).

Details

Value

The loaded flux_transformer in eval mode.